当前位置: 首页>>代码示例>>Java>>正文


Java Vector3f.ZERO属性代码示例

本文整理汇总了Java中com.jme3.math.Vector3f.ZERO属性的典型用法代码示例。如果您正苦于以下问题:Java Vector3f.ZERO属性的具体用法?Java Vector3f.ZERO怎么用?Java Vector3f.ZERO使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.jme3.math.Vector3f的用法示例。


在下文中一共展示了Vector3f.ZERO属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reload

@Override
@FXThread
protected void reload() {

    final Vector3f vector = getPropertyValue() == null ? Vector3f.ZERO : getPropertyValue();

    final FloatTextField xField = getXField();
    xField.setValue(vector.getX());
    xField.positionCaret(xField.getText().length());

    final FloatTextField yFiled = getYFiled();
    yFiled.setValue(vector.getY());
    yFiled.positionCaret(xField.getText().length());

    final FloatTextField zField = getZField();
    zField.setValue(vector.getZ());
    zField.positionCaret(xField.getText().length());
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:18,代码来源:Vector3FPropertyControl.java

示例2: updateVector

/**
 * 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,代码行数:24,代码来源:Vector3FPropertyControl.java

示例3: reload

@Override
@FXThread
protected void reload() {

    final Vector3f vector = getPropertyValue() == null ? Vector3f.ZERO : getPropertyValue();

    final FloatTextField xField = getXField();
    xField.setValue(vector.getX());
    xField.positionCaret(xField.getText().length());

    final FloatTextField yField = getYField();
    yField.setValue(vector.getY());
    yField.positionCaret(yField.getText().length());

    final FloatTextField zField = getZField();
    zField.setValue(vector.getZ());
    zField.positionCaret(zField.getText().length());
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:18,代码来源:Vector3FSingleRowPropertyControl.java

示例4: updateVector

/**
 * 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,代码行数:24,代码来源:Vector3FSingleRowPropertyControl.java

示例5: createForceFieldProducer

public static ForceProducer createForceFieldProducer(Vector3f halfExtents, Vector3f force){
    return new ForceProducer(r  -> {
        if(r.x <= halfExtents.x && r.x >= -halfExtents.x
                && r.y <= halfExtents.y && r.y >= -halfExtents.y
                && r.z <= halfExtents.z && r.z >= -halfExtents.z){
            return force;
        }
        return Vector3f.ZERO;
    });
}
 
开发者ID:jvpichowski,项目名称:ZayES-Bullet,代码行数:10,代码来源:ForceProducerFactory.java

示例6: createConstantBoundedForceProducer

/**
 *
 * @param factor
 * @param radius
 * @return
 */
public static ForceProducer createConstantBoundedForceProducer(float factor, float radius){
    return new ForceProducer(r -> {
        if(r.lengthSquared() > radius*radius){
            return Vector3f.ZERO;
        }
        return r.normalize().mult(factor);
    });
}
 
开发者ID:jvpichowski,项目名称:ZayES-Bullet,代码行数:14,代码来源:ForceProducerFactory.java

示例7: BulletJointDebugControl

public BulletJointDebugControl(BulletDebugAppState debugAppState, PhysicsJoint body) {
    super(debugAppState);
    this.body = body;
    this.geomA = new Geometry(body.toString());
    arrowA = new Arrow(Vector3f.ZERO);
    geomA.setMesh(arrowA);
    //  geomA.setMaterial(debugAppState.DEBUG_GREEN);
    this.geomB = new Geometry(body.toString());
    arrowB = new Arrow(Vector3f.ZERO);
    geomB.setMesh(arrowB);
    // geomB.setMaterial(debugAppState.DEBUG_GREEN);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder-extension,代码行数:12,代码来源:BulletJointDebugControl.java

示例8: SlopeTerrainToolControl

/**
 * Instantiates a new Slope terrain tool control.
 *
 * @param component the component
 */
public SlopeTerrainToolControl(@NotNull final TerrainEditingComponent component) {
    super(component);

    this.baseMarker = new Geometry("BaseMarker", new Sphere(8, 8, 1));
    this.baseMarker.setMaterial(createMaterial(ColorRGBA.Red));
    this.targetMarker = new Geometry("TargetMarker", new Sphere(8, 8, 1));
    this.targetMarker.setMaterial(createMaterial(ColorRGBA.Blue));
    this.line = new Geometry("line", new Line(Vector3f.ZERO, Vector3f.ZERO));
    this.line.setMaterial(createMaterial(ColorRGBA.White));
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:15,代码来源:SlopeTerrainToolControl.java

示例9: ViewLocation

public ViewLocation() {
    this(Vector3f.ZERO);
}
 
开发者ID:jvpichowski,项目名称:ZayES-Bullet,代码行数:3,代码来源:ViewLocation.java

示例10: PhysicsToViewLocation

public PhysicsToViewLocation() {
    this(Vector3f.ZERO);
}
 
开发者ID:jvpichowski,项目名称:ZayES-Bullet,代码行数:3,代码来源:PhysicsToViewLocation.java


注:本文中的com.jme3.math.Vector3f.ZERO属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。