Search in sources :

Example 11 with CompoundShape

use of com.bulletphysics.collision.shapes.CompoundShape in project jmonkeyengine by jMonkeyEngine.

the class CompoundCollisionShape method addChildShapeDirect.

private void addChildShapeDirect(CollisionShape shape, Vector3f location, Matrix3f rotation) {
    if (shape instanceof CompoundCollisionShape) {
        throw new IllegalStateException("CompoundCollisionShapes cannot have CompoundCollisionShapes as children!");
    }
    Transform transA = new Transform(Converter.convert(rotation));
    Converter.convert(location, transA.origin);
    Converter.convert(rotation, transA.basis);
    ((CompoundShape) cShape).addChildShape(transA, shape.getCShape());
}
Also used : CompoundShape(com.bulletphysics.collision.shapes.CompoundShape) Transform(com.bulletphysics.linearmath.Transform)

Aggregations

CompoundShape (com.bulletphysics.collision.shapes.CompoundShape)11 Transform (com.bulletphysics.linearmath.Transform)10 CollisionShape (com.bulletphysics.collision.shapes.CollisionShape)7 Stack (com.bulletphysics.util.Stack)6 ConcaveShape (com.bulletphysics.collision.shapes.ConcaveShape)3 Vector3f (javax.vecmath.Vector3f)3 CastResult (com.bulletphysics.collision.narrowphase.ConvexCast.CastResult)2 SubsimplexConvexCast (com.bulletphysics.collision.narrowphase.SubsimplexConvexCast)2 VoronoiSimplexSolver (com.bulletphysics.collision.narrowphase.VoronoiSimplexSolver)2 BvhTriangleMeshShape (com.bulletphysics.collision.shapes.BvhTriangleMeshShape)2 ConvexShape (com.bulletphysics.collision.shapes.ConvexShape)2 SphereShape (com.bulletphysics.collision.shapes.SphereShape)2 ChildCollisionShape (com.jme3.bullet.collision.shapes.infos.ChildCollisionShape)2 ConvexCast (com.bulletphysics.collision.narrowphase.ConvexCast)1 GjkConvexCast (com.bulletphysics.collision.narrowphase.GjkConvexCast)1 GjkEpaPenetrationDepthSolver (com.bulletphysics.collision.narrowphase.GjkEpaPenetrationDepthSolver)1 ManifoldPoint (com.bulletphysics.collision.narrowphase.ManifoldPoint)1 CapsuleShape (com.bulletphysics.collision.shapes.CapsuleShape)1 ConeShape (com.bulletphysics.collision.shapes.ConeShape)1 CylinderShape (com.bulletphysics.collision.shapes.CylinderShape)1