Ejemplo n.º 1
0
 private void addCharacter(PhysicsCharacter node) {
   if (physicsCharacters.containsKey(node.getObjectId())) {
     logger.log(Level.WARNING, "Character {0} already exists in PhysicsSpace, cannot add.", node);
     return;
   }
   physicsCharacters.put(node.getObjectId(), node);
   logger.log(
       Level.FINE, "Adding character {0} to physics space.", Long.toHexString(node.getObjectId()));
   addCharacterObject(physicsSpaceId, node.getObjectId());
   addAction(physicsSpaceId, node.getControllerId());
   //        dynamicsWorld.addCollisionObject(node.getObjectId(),
   // CollisionFilterGroups.CHARACTER_FILTER, (short) (CollisionFilterGroups.STATIC_FILTER |
   // CollisionFilterGroups.DEFAULT_FILTER));
   //        dynamicsWorld.addAction(node.getControllerId());
 }
Ejemplo n.º 2
0
 private void removeCharacter(PhysicsCharacter node) {
   if (!physicsCharacters.containsKey(node.getObjectId())) {
     logger.log(
         Level.WARNING, "Character {0} does not exist in PhysicsSpace, cannot remove.", node);
     return;
   }
   physicsCharacters.remove(node.getObjectId());
   logger.log(
       Level.FINE,
       "Removing character {0} from physics space.",
       Long.toHexString(node.getObjectId()));
   removeAction(physicsSpaceId, node.getControllerId());
   removeCharacterObject(physicsSpaceId, node.getObjectId());
   //        dynamicsWorld.removeAction(node.getControllerId());
   //        dynamicsWorld.removeCollisionObject(node.getObjectId());
 }