Пример #1
0
 private StaticPhysicsNode loadCheckpointModel(String modelPath) {
   StaticPhysicsNode checkPoint = physicsSpace.createStaticNode();
   checkPoint.setLocalTranslation(trackLocation);
   checkPoint.attachChild(ModelUtil.convertOBJToStatial(ResourcesPath.MODELS_PATH + modelPath));
   checkPoint.setLocalScale(1f);
   checkPoint.setMaterial(Material.GHOST);
   StateUtil.makeTransparent(checkPoint);
   return checkPoint;
 }
Пример #2
0
 private void createTrack(Vector3f trackLocation) {
   track = physicsSpace.createStaticNode();
   track.setLocalTranslation(trackLocation);
   track.setLocalScale(1f);
   track.attachChild(
       ModelUtil.convertOBJToStatial(ResourcesPath.MODELS_PATH + "obj/raceTrack.obj"));
   track.generatePhysicsGeometry(true);
   track.setMaterial(Material.IRON);
   this.attachChild(track);
 }
Пример #3
0
  /*
   * (non-Javadoc)
   *
   * @see org.rifidi.designer.entities.Entity#init()
   */
  @Override
  public void init() {
    if (!(getNode() instanceof StaticPhysicsNode)) {
      StaticPhysicsNode phys = physicsSpace.createStaticNode();
      phys.setLocalTranslation(getNode().getWorldTranslation());
      for (Spatial spatial : new ArrayList<Spatial>(getNode().getChildren())) {
        phys.attachChild(spatial);
      }

      getNode().removeFromParent();
      setNode(phys);
      phys.generatePhysicsGeometry();
      loaded();
      fieldService.registerField(this);
    }
  }