本文整理匯總了Java中com.jme3.scene.Node.getLocalTranslation方法的典型用法代碼示例。如果您正苦於以下問題:Java Node.getLocalTranslation方法的具體用法?Java Node.getLocalTranslation怎麽用?Java Node.getLocalTranslation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.jme3.scene.Node
的用法示例。
在下文中一共展示了Node.getLocalTranslation方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: checkCameraChanges
import com.jme3.scene.Node; //導入方法依賴的package包/類
/**
* Check camera changes.
*
* @param editorCamera the editor camera
*/
@JMEThread
protected void checkCameraChanges(@NotNull final EditorCamera editorCamera) {
int changes = 0;
final Node nodeForCamera = getNodeForCamera();
final Vector3f prevCameraLocation = getPrevCameraLocation();
final Vector3f cameraLocation = nodeForCamera.getLocalTranslation();
final float prevHRotation = getPrevHRotation();
final float hRotation = editorCamera.getHorizontalRotation();
final float prevVRotation = getPrevVRotation();
final float vRotation = editorCamera.getVerticalRotation();
final float prevTargetDistance = getPrevTargetDistance();
final float targetDistance = editorCamera.getTargetDistance();
final float cameraSpeed = getCameraSpeed();
final float prevCameraSpeed = getPrevCameraSpeed();
if (!prevCameraLocation.equals(cameraLocation)) {
changes++;
} else if (prevHRotation != hRotation || prevVRotation != vRotation) {
changes++;
} else if (prevTargetDistance != targetDistance) {
changes++;
} else if (cameraSpeed != prevCameraSpeed) {
changes++;
}
if (changes > 0) {
notifyChangedCameraSettings(cameraLocation, hRotation, vRotation, targetDistance, cameraSpeed);
}
prevCameraLocation.set(cameraLocation);
setPrevHRotation(hRotation);
setPrevVRotation(vRotation);
setPrevTargetDistance(targetDistance);
setPrevCameraSpeed(cameraSpeed);
}