/** * Create a collision shape based on the scale parameter. The new shape is a * compound shape containing an offset capsule. * * @return a new compound shape (not null) */ 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; }
/** * Create a collision shape based on the scale parameter. The new shape is a * compound shape containing an offset capsule. * * @return a new compound shape (not null) */ 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; }
/** * Create a collision shape based on the scale parameter. The new shape is a * compound shape containing an offset capsule. * * @return a new compound shape (not null) */ 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 a new collision shape based on the current scale parameter. The * created collisionshape is a capsule collision shape that is attached to a * compound collision shape with an offset to set the object center at the * bottom of the capsule. * * @return */ 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; }