本文整理匯總了Java中com.jme3.math.Vector3f.set方法的典型用法代碼示例。如果您正苦於以下問題:Java Vector3f.set方法的具體用法?Java Vector3f.set怎麽用?Java Vector3f.set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.jme3.math.Vector3f
的用法示例。
在下文中一共展示了Vector3f.set方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: applyVelocitySeparately
import com.jme3.math.Vector3f; //導入方法依賴的package包/類
private boolean applyVelocitySeparately(Vector3f velocity, float tpf){
float x = velocity.getX();
float y = velocity.getY();
float z = velocity.getZ();
boolean hit = false;
velocity.set(0, 0, 0);
velocity.setX(x);
if(applyVelocity(velocity, tpf)) hit = true;
velocity.setX(0);
velocity.setY(y);
if(applyVelocity(velocity, tpf)) hit = true;
velocity.setY(0);
velocity.setZ(z);
if(applyVelocity(velocity, tpf)) hit = true;
velocity.setZ(0);
velocity.set(x, y, z);
return hit;
}
示例2: updateVector
import com.jme3.math.Vector3f; //導入方法依賴的package包/類
/**
* Update the vector.
*
* @param event the event
*/
@FXThread
protected void updateVector(@Nullable final KeyEvent event) {
if (isIgnoreListener() || (event != null && event.getCode() != KeyCode.ENTER)) return;
final FloatTextField xField = getXField();
final float x = xField.getValue();
final FloatTextField yFiled = getYFiled();
final float y = yFiled.getValue();
final FloatTextField zField = getZField();
final float z = zField.getValue();
final Vector3f oldValue = getPropertyValue() == null ? Vector3f.ZERO : getPropertyValue();
final Vector3f newValue = new Vector3f();
newValue.set(x, y, z);
changed(newValue, oldValue.clone());
}
示例3: updateVector
import com.jme3.math.Vector3f; //導入方法依賴的package包/類
/**
* Update the current value.
*
* @param event the change event.
*/
@FXThread
private void updateVector(@Nullable final KeyEvent event) {
if (isIgnoreListener() || (event != null && event.getCode() != KeyCode.ENTER)) return;
final FloatTextField xField = getXField();
final float x = xField.getValue();
final FloatTextField yField = getYField();
final float y = yField.getValue();
final FloatTextField zField = getZField();
final float z = zField.getValue();
final Vector3f oldValue = getPropertyValue() == null ? Vector3f.ZERO : getPropertyValue();
final Vector3f newValue = new Vector3f();
newValue.set(checkResultXValue(x, y, z), checkResultYValue(x, y, z), checkResultZValue(x, y, z));
changed(newValue, oldValue.clone());
}
示例4: checkCameraChanges
import com.jme3.math.Vector3f; //導入方法依賴的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);
}