Package com.bulletphysics.collision.shapes

Examples of com.bulletphysics.collision.shapes.ConvexHullShape


        startTransform.basis.rotX((float) -Math.PI / 2f);
        startTransform.origin.set(0, -10, 0);
        //startTransform.origin.set(0, 0, -10f);
       
        // this create an internal copy of the vertices
        CollisionShape shape = new ConvexHullShape(vertices);
        collisionShapes.add(shape);

        //btRigidBody* body = m_demoApp->localCreateRigidBody(mass, startTransform,shape);
        localCreateRigidBody(mass, startTransform, shape);
      }
View Full Code Here


        // can use a shift
        startTransform.setIdentity();
        startTransform.origin.set(0, 0, -10f);
       
        // this create an internal copy of the vertices
        CollisionShape shape = new ConvexHullShape(vertices);
        collisionShapes.add(shape);

        //btRigidBody* body = m_demoApp->localCreateRigidBody(mass, startTransform,shape);
        localCreateRigidBody(mass, startTransform, shape);
      }
View Full Code Here

                newVert.x = iterator.next();
                newVert.y = iterator.next();
                newVert.z = iterator.next();
                verts.add(newVert);
            }
            return new ConvexHullShape(verts);
        }
        CharacterMovementComponent characterMovementComponent = entity.getComponent(CharacterMovementComponent.class);
        if (characterMovementComponent != null) {
            return new CapsuleShape(characterMovementComponent.radius, characterMovementComponent.height);
        }
View Full Code Here

            }

            if (collisionInfo.has(CONVEX_HULL) && collisionInfo.get(CONVEX_HULL).isJsonPrimitive()
                    && collisionInfo.get(CONVEX_HULL).getAsJsonPrimitive().isBoolean()) {
                ObjectArrayList<Vector3f> verts = buildVertList(shape);
                ConvexHullShape convexHull = new ConvexHullShape(verts);
                shape.setCollisionShape(convexHull);
            } else if (collisionInfo.has(COLLIDERS) && collisionInfo.get(COLLIDERS).isJsonArray()
                    && collisionInfo.get(COLLIDERS).getAsJsonArray().size() > 0) {
                JsonArray colliderArray = collisionInfo.get(COLLIDERS).getAsJsonArray();
                processColliders(context, colliderArray, shape);
View Full Code Here

                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<>();
            for (Vector3f vert : convexHull.getPoints()) {
                transformedVerts.add(QuaternionUtil.quatRotate(rot, vert, new Vector3f()));
            }
            return new ConvexHullShape(transformedVerts);
        }
        return shape;
    }
View Full Code Here

TOP

Related Classes of com.bulletphysics.collision.shapes.ConvexHullShape

Copyright © 2018 www.massapicom. 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.