Beispiel #1
0
 /** Detach this component's entity from its parent entity. */
 protected void detachFromParentEntity() {
   if (parentEntity != null) {
     parentEntity.removeEntity(entity);
     RenderComponent rcEntity = (RenderComponent) entity.getComponent(RenderComponent.class);
     if (rcEntity != null) {
       rcEntity.setAttachPoint(null);
     }
   }
   parentEntity = null;
 }
Beispiel #2
0
 /** Attach this component's entity to its parent entity. */
 protected void attachToParentEntity() {
   if (parentEntity != null) {
     parentEntity.addEntity(entity);
     RenderComponent rcParentEntity =
         (RenderComponent) parentEntity.getComponent(RenderComponent.class);
     RenderComponent rcEntity = (RenderComponent) entity.getComponent(RenderComponent.class);
     if (rcParentEntity != null && rcParentEntity.getSceneRoot() != null && rcEntity != null) {
       rcEntity.setAttachPoint(rcParentEntity.getSceneRoot());
     }
   }
 }