當前位置: 首頁>>代碼示例>>Java>>正文


Java Vector3f.set方法代碼示例

本文整理匯總了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;
}
 
開發者ID:DA-CS-Lab,項目名稱:Victorum,代碼行數:25,代碼來源:PlayerAppState.java

示例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());
}
 
開發者ID:JavaSaBr,項目名稱:jmonkeybuilder,代碼行數:25,代碼來源:Vector3FPropertyControl.java

示例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());
}
 
開發者ID:JavaSaBr,項目名稱:jmonkeybuilder,代碼行數:25,代碼來源:Vector3FSingleRowPropertyControl.java

示例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);
}
 
開發者ID:JavaSaBr,項目名稱:jmonkeybuilder,代碼行數:48,代碼來源:AdvancedAbstractEditor3DState.java


注:本文中的com.jme3.math.Vector3f.set方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。