public void reset() {
   world.removeRigidBody(rigidBody);
   trans = new Transform();
   trans.setIdentity();
   trans.origin.set(originPosition.x, originPosition.y, originPosition.z);
   state = new DefaultMotionState(trans);
   init(this.restitution, this.friction, this.mass);
 }
Exemple #2
0
  public void destroy() {
    int i;

    // Remove all constraints
    for (i = 0; i < JOINT_COUNT; ++i) {
      ownerWorld.removeConstraint(joints[i]);
      // joints[i].destroy();
      joints[i] = null;
    }

    // Remove all bodies and shapes
    for (i = 0; i < BodyPart.BODYPART_COUNT.ordinal(); ++i) {
      ownerWorld.removeRigidBody(bodies[i]);

      // bodies[i].getMotionState().destroy();

      bodies[i].destroy();
      bodies[i] = null;

      // shapes[i].destroy();
      shapes[i] = null;
    }
  }