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; }
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); }
/* * (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); } }
public Savable load(InputCapsule inputCapsule) { return physicsSpace.createJoint(); }