Examples of addChildShape()


Examples of com.bulletphysics.collision.shapes.CompoundShape.addChildShape()

      CollisionShape forkShapeC = new BoxShape(new Vector3f(0.1f,0.02f,0.6f));
      collisionShapes.add(forkShapeC);
      forkLocalTrans.setIdentity();
      forkLocalTrans.origin.set(0.9f, -0.08f, 0.7f);
      forkCompound.addChildShape(forkLocalTrans, forkShapeC);

      Transform forkTrans = new Transform();
      forkStartPos.set(0.0f, 0.6f, 3.2f);
      forkTrans.setIdentity();
      forkTrans.origin.set(forkStartPos);
View Full Code Here

Examples of com.bulletphysics.collision.shapes.CompoundShape.addChildShape()

      collisionShapes.add(loadCompound);
      CollisionShape loadShapeA = new BoxShape(new Vector3f(2.0f,0.5f,0.5f));
      collisionShapes.add(loadShapeA);
      Transform loadTrans = new Transform();
      loadTrans.setIdentity();
      loadCompound.addChildShape(loadTrans, loadShapeA);
      CollisionShape loadShapeB = new BoxShape(new Vector3f(0.1f,1.0f,1.0f));
      collisionShapes.add(loadShapeB);
      loadTrans.setIdentity();
      loadTrans.origin.set(2.1f, 0.0f, 0.0f);
      loadCompound.addChildShape(loadTrans, loadShapeB);
View Full Code Here

Examples of com.bulletphysics.collision.shapes.CompoundShape.addChildShape()

      loadCompound.addChildShape(loadTrans, loadShapeA);
      CollisionShape loadShapeB = new BoxShape(new Vector3f(0.1f,1.0f,1.0f));
      collisionShapes.add(loadShapeB);
      loadTrans.setIdentity();
      loadTrans.origin.set(2.1f, 0.0f, 0.0f);
      loadCompound.addChildShape(loadTrans, loadShapeB);
      CollisionShape loadShapeC = new BoxShape(new Vector3f(0.1f,1.0f,1.0f));
      collisionShapes.add(loadShapeC);
      loadTrans.setIdentity();
      loadTrans.origin.set(-2.1f, 0.0f, 0.0f);
      loadCompound.addChildShape(loadTrans, loadShapeC);
View Full Code Here

Examples of com.bulletphysics.collision.shapes.CompoundShape.addChildShape()

      loadCompound.addChildShape(loadTrans, loadShapeB);
      CollisionShape loadShapeC = new BoxShape(new Vector3f(0.1f,1.0f,1.0f));
      collisionShapes.add(loadShapeC);
      loadTrans.setIdentity();
      loadTrans.origin.set(-2.1f, 0.0f, 0.0f);
      loadCompound.addChildShape(loadTrans, loadShapeC);
      loadTrans.setIdentity();
      loadStartPos.set(0.0f, -3.5f, 7.0f);
      loadTrans.origin.set(loadStartPos);
      loadBody  = localCreateRigidBody(4, loadTrans, loadCompound);
    }
View Full Code Here

Examples of com.bulletphysics.collision.shapes.CompoundShape.addChildShape()

        private ColliderInfo processCompoundShape(List<ColliderInfo> colliders) {
            CompoundShape collisionShape = new CompoundShape();

            for (ColliderInfo collider : colliders) {
                Transform transform = new Transform(new Matrix4f(Rotation.none().getQuat4f(), collider.offset, 1.0f));
                collisionShape.addChildShape(transform, collider.collisionShape);
            }
            return new ColliderInfo(new Vector3f(), collisionShape);
        }

        private ColliderInfo processAABBShape(JsonDeserializationContext context, JsonObject colliderDef) {
View Full Code Here

Examples of com.bulletphysics.collision.shapes.CompoundShape.addChildShape()

            CompoundShape compound = (CompoundShape) shape;
            CompoundShape newShape = new CompoundShape();
            for (CompoundShapeChild child : compound.getChildList()) {
                CollisionShape rotatedChild = rotate(child.childShape, rot);
                Vector3f offset = QuaternionUtil.quatRotate(rot, child.transform.origin, new Vector3f());
                newShape.addChildShape(new Transform(new Matrix4f(Rotation.none().getQuat4f(), offset, 1.0f)), rotatedChild);
            }
            return newShape;
        } else if (shape instanceof ConvexHullShape) {
            ConvexHullShape convexHull = (ConvexHullShape) shape;
            ObjectArrayList<Vector3f> transformedVerts = new ObjectArrayList<>();
View Full Code Here

Examples of com.jme3.bullet.collision.shapes.CompoundCollisionShape.addChildShape()

    protected CollisionShape getShape() {
        //TODO: cleanup size mess..
        CapsuleCollisionShape capsuleCollisionShape = new CapsuleCollisionShape(getFinalRadius(), (getFinalHeight() - (2 * getFinalRadius())));
        CompoundCollisionShape compoundCollisionShape = new CompoundCollisionShape();
        Vector3f addLocation = new Vector3f(0, (getFinalHeight() / 2.0f), 0);
        compoundCollisionShape.addChildShape(capsuleCollisionShape, addLocation);
        return compoundCollisionShape;
    }

    /**
     * Gets the scaled height.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.