/** * Test whether physics-space coordinates should match the spatial's local * coordinates. * * @return true if matching local coordinates, false if matching world * coordinates */ public boolean isApplyPhysicsLocal() { return motionState.isApplyPhysicsLocal(); }
/** * Alter whether physics-space coordinates should match the spatial's local * coordinates. * * @param applyPhysicsLocal true→match local coordinates, * false→match world coordinates (default=false) */ public void setApplyPhysicsLocal(boolean applyPhysicsLocal) { motionState.setApplyPhysicsLocal(applyPhysicsLocal); }
private native void getWorldRotation(long stateId, Matrix3f vec);
public void update(float tpf) { if (enabled && spatial != null) { getMotionState().applyTransform(spatial); } }
private native void getWorldRotationQuat(long stateId, Quaternion vec);
private native void getWorldLocation(long stateId, Vector3f vec);
@Override protected void postRebuild() { super.postRebuild(); motionState.setVehicle(this); createVehicle(physicsSpace); }
/** * Sets the physics object location * @param location the location of the actual physics object */ public void setPhysicsLocation(Vector3f location) { rBody.getCenterOfMassTransform(tempTrans); Converter.convert(location, tempTrans.origin); rBody.setCenterOfMassTransform(tempTrans); motionState.setWorldTransform(tempTrans); }
/** * Test whether physics-space coordinates should match the spatial's local * coordinates. * * @return true if matching local coordinates, false if matching world * coordinates */ public boolean isApplyPhysicsLocal() { return motionState.isApplyPhysicsLocal(); }
/** * Alter whether physics-space coordinates should match the spatial's local * coordinates. * * @param applyPhysicsLocal true→match local coordinates, * false→match world coordinates (default=false) */ public void setApplyPhysicsLocal(boolean applyPhysicsLocal) { motionState.setApplyPhysicsLocal(applyPhysicsLocal); }
/** * Test whether physics-space coordinates should match the spatial's local * coordinates. * * @return true if matching local coordinates, false if matching world * coordinates */ public boolean isApplyPhysicsLocal() { return motionState.isApplyPhysicsLocal(); }
/** * Test whether physics-space coordinates should match the spatial's local * coordinates. * * @return true if matching local coordinates, false if matching world * coordinates */ public boolean isApplyPhysicsLocal() { return motionState.isApplyPhysicsLocal(); }
private Quaternion getSpatialRotation(){ if(motionState.isApplyPhysicsLocal()){ return spatial.getLocalRotation(); } return spatial.getWorldRotation(); }
private Vector3f getSpatialTranslation(){ if(motionState.isApplyPhysicsLocal()){ return spatial.getLocalTranslation(); } return spatial.getWorldTranslation(); }
/** * Access whichever spatial translation corresponds to the physics location. * * @return the pre-existing vector (not null) */ private Vector3f getSpatialTranslation(){ if(motionState.isApplyPhysicsLocal()){ return spatial.getLocalTranslation(); } return spatial.getWorldTranslation(); }
private Vector3f getSpatialTranslation(){ if(motionState.isApplyPhysicsLocal()){ return spatial.getLocalTranslation(); } return spatial.getWorldTranslation(); }
/** * Access whichever spatial rotation corresponds to the physics rotation. * * @return the pre-existing quaternion (not null) */ private Quaternion getSpatialRotation(){ if(motionState.isApplyPhysicsLocal()){ return spatial.getLocalRotation(); } return spatial.getWorldRotation(); }
/** * Access whichever spatial translation corresponds to the physics location. * * @return the pre-existing vector (not null) */ private Vector3f getSpatialTranslation(){ if(motionState.isApplyPhysicsLocal()){ return spatial.getLocalTranslation(); } return spatial.getWorldTranslation(); }
/** * Access whichever spatial rotation corresponds to the physics rotation. * * @return the pre-existing quaternion (not null) */ private Quaternion getSpatialRotation(){ if(motionState.isApplyPhysicsLocal()){ return spatial.getLocalRotation(); } return spatial.getWorldRotation(); }
private Quaternion getSpatialRotation(){ if(motionState.isApplyPhysicsLocal()){ return spatial.getLocalRotation(); } return spatial.getWorldRotation(); }