ChildCollisionShape childCollisionShape = it.next(); CollisionShape ccollisionShape = childCollisionShape.shape; Geometry geometry = createDebugShape(ccollisionShape); debugShape = createDebugShape(collisionShape);
private static Geometry createDebugShape(CollisionShape shape) { Geometry geom = new Geometry(); geom.setMesh(DebugShapeFactory.getDebugMesh(shape)); // geom.setLocalScale(shape.getScale()); geom.updateModelBound(); return geom; }
/** * Instantiate an enabled control to visualize the specified character. * * @param debugAppState which app state (not null, alias created) * @param body the character to visualize (not null, alias created) */ public BulletCharacterDebugControl(BulletDebugAppState debugAppState, PhysicsCharacter body) { super(debugAppState); this.body = body; myShape = body.getCollisionShape(); oldScale.set(myShape.getScale()); this.geom = DebugShapeFactory.getDebugShape(myShape); this.geom.setName(body.toString()); geom.setMaterial(debugAppState.DEBUG_PINK); }
public static Mesh getDebugMesh(CollisionShape shape) { Mesh mesh = null; if (shape.getCShape() instanceof ConvexShape) { mesh = new Mesh(); mesh.setBuffer(Type.Position, 3, getVertices((ConvexShape) shape.getCShape())); mesh.getFloatBuffer(Type.Position).clear(); } else if (shape.getCShape() instanceof ConcaveShape) { mesh = new Mesh(); mesh.setBuffer(Type.Position, 3, getVertices((ConcaveShape) shape.getCShape())); mesh.getFloatBuffer(Type.Position).clear(); } return mesh; }
/** * Create a mesh for visualizing the specified shape. * * @param shape (not null, unaffected) * @return a new mesh (not null) */ public static Mesh getDebugMesh(CollisionShape shape) { Mesh mesh = new Mesh(); DebugMeshCallback callback = new DebugMeshCallback(); long id = shape.getObjectId(); getVertices(id, callback); mesh.setBuffer(Type.Position, 3, callback.getVertices()); mesh.getFloatBuffer(Type.Position).clear(); return mesh; }
/** * Instantiate an enabled control to visualize the specified character. * * @param debugAppState which app state (not null, alias created) * @param body the character to visualize (not null, alias created) */ public BulletCharacterDebugControl(BulletDebugAppState debugAppState, PhysicsCharacter body) { super(debugAppState); this.body = body; myShape = body.getCollisionShape(); oldScale.set(myShape.getScale()); this.geom = DebugShapeFactory.getDebugShape(myShape); this.geom.setName(body.toString()); geom.setMaterial(debugAppState.DEBUG_PINK); }
/** * Create a geometry for visualizing the specified shape. * * @param shape (not null, unaffected) * @return a new geometry (not null) */ private static Geometry createDebugShape(CollisionShape shape) { Geometry geom = new Geometry(); geom.setMesh(DebugShapeFactory.getDebugMesh(shape)); // geom.setLocalScale(shape.getScale()); geom.updateModelBound(); return geom; }
public static Mesh getDebugMesh(CollisionShape shape) { Mesh mesh = null; if (shape.getCShape() instanceof ConvexShape) { mesh = new Mesh(); mesh.setBuffer(Type.Position, 3, getVertices((ConvexShape) shape.getCShape())); mesh.getFloatBuffer(Type.Position).clear(); } else if (shape.getCShape() instanceof ConcaveShape) { mesh = new Mesh(); mesh.setBuffer(Type.Position, 3, getVertices((ConcaveShape) shape.getCShape())); mesh.getFloatBuffer(Type.Position).clear(); } return mesh; }
ChildCollisionShape childCollisionShape = it.next(); CollisionShape ccollisionShape = childCollisionShape.shape; Geometry geometry = createDebugShape(ccollisionShape); debugShape = createDebugShape(collisionShape);
/** * Instantiate an enabled control to visualize the specified ghost object. * * @param debugAppState which app state (not null, alias created) * @param body which object to visualize (not null, alias created) */ public BulletGhostObjectDebugControl(BulletDebugAppState debugAppState, PhysicsGhostObject body) { super(debugAppState); this.body = body; myShape = body.getCollisionShape(); oldScale.set(myShape.getScale()); this.geom = DebugShapeFactory.getDebugShape(myShape); this.geom.setName(body.toString()); geom.setMaterial(debugAppState.DEBUG_YELLOW); }
private static Geometry createDebugShape(CollisionShape shape) { Geometry geom = new Geometry(); geom.setMesh(DebugShapeFactory.getDebugMesh(shape)); // geom.setLocalScale(shape.getScale()); geom.updateModelBound(); return geom; }
public static Mesh getDebugMesh(CollisionShape shape) { Mesh mesh = new Mesh(); mesh = new Mesh(); DebugMeshCallback callback = new DebugMeshCallback(); getVertices(shape.getObjectId(), callback); mesh.setBuffer(Type.Position, 3, callback.getVertices()); mesh.getFloatBuffer(Type.Position).clear(); return mesh; }
ChildCollisionShape childCollisionShape = it.next(); CollisionShape ccollisionShape = childCollisionShape.shape; Geometry geometry = createDebugShape(ccollisionShape); debugShape = createDebugShape(collisionShape);
/** * Instantiate an enabled control to visualize the specified body. * * @param debugAppState which app state (not null, alias created) * @param body which body to visualize (not null, alias created) */ public BulletRigidBodyDebugControl(BulletDebugAppState debugAppState, PhysicsRigidBody body) { super(debugAppState); this.body = body; myShape = body.getCollisionShape(); oldScale.set(myShape.getScale()); this.geom = DebugShapeFactory.getDebugShape(myShape); this.geom.setName(body.toString()); geom.setMaterial(debugAppState.DEBUG_BLUE); }
private static Geometry createDebugShape(CollisionShape shape) { Geometry geom = new Geometry(); geom.setMesh(DebugShapeFactory.getDebugMesh(shape)); // geom.setLocalScale(shape.getScale()); geom.updateModelBound(); return geom; }
public static Mesh getDebugMesh(CollisionShape shape) { Mesh mesh = new Mesh(); DebugMeshCallback callback = new DebugMeshCallback(); /* * Populate the mesh based on an unscaled shape; * the shape's scale will be applied later, to the geometry. */ Vector3f savedScale = shape.getScale().clone(); shape.setScale(Vector3f.UNIT_XYZ); getVertices(shape.getObjectId(), callback); shape.setScale(savedScale); mesh.setBuffer(Type.Position, 3, callback.getVertices()); mesh.getFloatBuffer(Type.Position).clear(); return mesh; }
ChildCollisionShape childCollisionShape = it.next(); CollisionShape ccollisionShape = childCollisionShape.shape; Geometry geometry = createDebugShape(ccollisionShape); debugShape = createDebugShape(collisionShape);
/** * Instantiate an enabled control to visualize the specified ghost object. * * @param debugAppState which app state (not null, alias created) * @param body which object to visualize (not null, alias created) */ public BulletGhostObjectDebugControl(BulletDebugAppState debugAppState, PhysicsGhostObject body) { super(debugAppState); this.body = body; myShape = body.getCollisionShape(); oldScale.set(myShape.getScale()); this.geom = DebugShapeFactory.getDebugShape(myShape); this.geom.setName(body.toString()); geom.setMaterial(debugAppState.DEBUG_YELLOW); }
private static Geometry createDebugShape(CollisionShape shape) { Geometry geom = new Geometry(); geom.setMesh(DebugShapeFactory.getDebugMesh(shape)); // geom.setLocalScale(shape.getScale()); geom.updateModelBound(); return geom; }
ChildCollisionShape childCollisionShape = it.next(); CollisionShape ccollisionShape = childCollisionShape.shape; Geometry geometry = createDebugShape(ccollisionShape); debugShape = createDebugShape(collisionShape);