/** * Alter the location and extent of the blue arrow. * * @param location the coordinates of the tail (not null, unaffected) * @param extent the offset of the tip from the tail (not null, unaffected) */ public void setBlueArrow(Vector3f location, Vector3f extent) { arrowBlueGeom.setLocalTranslation(location); arrowBlue.setArrowExtent(extent); }
/** * Alter the location and extent of the green arrow. * * @param location the coordinates of the tail (not null, unaffected) * @param extent the offset of the tip from the tail (not null, unaffected) */ public void setGreenArrow(Vector3f location, Vector3f extent) { arrowGreenGeom.setLocalTranslation(location); arrowGreen.setArrowExtent(extent); }
/** * Alter the location and extent of the red arrow. * * @param location the coordinates of the tail (not null, unaffected) * @param extent the offset of the tip from the tail (not null, unaffected) */ public void setRedArrow(Vector3f location, Vector3f extent) { arrowRedGeom.setLocalTranslation(location); arrowRed.setArrowExtent(extent); }
/** * Alter the location and extent of the red arrow. * * @param location the coordinates of the tail (not null, unaffected) * @param extent the offset of the tip from the tail (not null, unaffected) */ public void setRedArrow(Vector3f location, Vector3f extent) { arrowRedGeom.setLocalTranslation(location); arrowRed.setArrowExtent(extent); }
/** * Alter the location and extent of the magenta arrow. * * @param location the coordinates of the tail (not null, unaffected) * @param extent the offset of the tip from the tail (not null, unaffected) */ public void setMagentaArrow(Vector3f location, Vector3f extent) { arrowMagentaGeom.setLocalTranslation(location); arrowMagenta.setArrowExtent(extent); }
/** * Alter the location and extent of the pink arrow. * * @param location the coordinates of the tail (not null, unaffected) * @param extent the offset of the tip from the tail (not null, unaffected) */ public void setPinkArrow(Vector3f location, Vector3f extent) { arrowPinkGeom.setLocalTranslation(location); arrowPink.setArrowExtent(extent); }
/** * Alter the location and extent of the green arrow. * * @param location the coordinates of the tail (not null, unaffected) * @param extent the offset of the tip from the tail (not null, unaffected) */ public void setGreenArrow(Vector3f location, Vector3f extent) { arrowGreenGeom.setLocalTranslation(location); arrowGreen.setArrowExtent(extent); }
/** * Alter the location and extent of the magenta arrow. * * @param location the coordinates of the tail (not null, unaffected) * @param extent the offset of the tip from the tail (not null, unaffected) */ public void setMagentaArrow(Vector3f location, Vector3f extent) { arrowMagentaGeom.setLocalTranslation(location); arrowMagenta.setArrowExtent(extent); }
/** * Alter the location and extent of the yellow arrow. * * @param location the coordinates of the tail (not null, unaffected) * @param extent the offset of the tip from the tail (not null, unaffected) */ public void setYellowArrow(Vector3f location, Vector3f extent) { arrowYellowGeom.setLocalTranslation(location); arrowYellow.setArrowExtent(extent); }
/** * Alter the location and extent of the blue arrow. * * @param location the coordinates of the tail (not null, unaffected) * @param extent the offset of the tip from the tail (not null, unaffected) */ public void setBlueArrow(Vector3f location, Vector3f extent) { arrowBlueGeom.setLocalTranslation(location); arrowBlue.setArrowExtent(extent); }
/** * Alter the location and extent of the pink arrow. * * @param location the coordinates of the tail (not null, unaffected) * @param extent the offset of the tip from the tail (not null, unaffected) */ public void setPinkArrow(Vector3f location, Vector3f extent) { arrowPinkGeom.setLocalTranslation(location); arrowPink.setArrowExtent(extent); }
/** * Alter the location and extent of the yellow arrow. * * @param location the coordinates of the tail (not null, unaffected) * @param extent the offset of the tip from the tail (not null, unaffected) */ public void setYellowArrow(Vector3f location, Vector3f extent) { arrowYellowGeom.setLocalTranslation(location); arrowYellow.setArrowExtent(extent); }
/** * Update this control. Invoked once per frame during the logical-state * update, provided the control is enabled and added to a scene. Should be * invoked only by a subclass or by AbstractControl. * * @param tpf the time interval between frames (in seconds, ≥0) */ @Override protected void controlUpdate(float tpf) { body.getBodyA().getPhysicsLocation(a.getTranslation()); body.getBodyA().getPhysicsRotation(a.getRotation()); body.getBodyB().getPhysicsLocation(b.getTranslation()); body.getBodyB().getPhysicsRotation(b.getRotation()); geomA.setLocalTransform(a); geomB.setLocalTransform(b); arrowA.setArrowExtent(body.getPivotA()); arrowB.setArrowExtent(body.getPivotB()); }
/** * Update this control. Invoked once per frame during the logical-state * update, provided the control is enabled and added to a scene. Should be * invoked only by a subclass or by AbstractControl. * * @param tpf the time interval between frames (in seconds, ≥0) */ @Override protected void controlUpdate(float tpf) { body.getBodyA().getPhysicsLocation(a.getTranslation()); body.getBodyA().getPhysicsRotation(a.getRotation()); body.getBodyB().getPhysicsLocation(b.getTranslation()); body.getBodyB().getPhysicsRotation(b.getRotation()); geomA.setLocalTransform(a); geomB.setLocalTransform(b); arrowA.setArrowExtent(body.getPivotA()); arrowB.setArrowExtent(body.getPivotB()); }
locArrow.setArrowExtent(location); Arrow axleArrow = (Arrow) axleGeom.getMesh(); axleArrow.setArrowExtent(axle.normalizeLocal().multLocal(0.3f)); Arrow wheelArrow = (Arrow) wheelGeom.getMesh(); wheelArrow.setArrowExtent(direction.normalizeLocal().multLocal(radius)); Arrow dirArrow = (Arrow) dirGeom.getMesh(); dirArrow.setArrowExtent(direction.normalizeLocal().multLocal(restLength));
locArrow.setArrowExtent(location); Arrow axleArrow = (Arrow) axleGeom.getMesh(); axleArrow.setArrowExtent(axle.normalizeLocal().multLocal(0.3f)); Arrow wheelArrow = (Arrow) wheelGeom.getMesh(); wheelArrow.setArrowExtent(direction.normalizeLocal().multLocal(radius)); Arrow dirArrow = (Arrow) dirGeom.getMesh(); dirArrow.setArrowExtent(direction.normalizeLocal().multLocal(restLength));
@Override public void simpleUpdate(float tpf){ Vector3f intersection = getWorldIntersection(); updateHintText(intersection); if (raiseTerrain){ if (intersection != null) { adjustHeight(intersection, 64, tpf * 60); } }else if (lowerTerrain){ if (intersection != null) { adjustHeight(intersection, 64, -tpf * 60); } } if (terrain != null && intersection != null) { float h = terrain.getHeight(new Vector2f(intersection.x, intersection.z)); Vector3f tl = terrain.getWorldTranslation(); marker.setLocalTranslation(tl.add(new Vector3f(intersection.x, h, intersection.z)) ); markerNormal.setLocalTranslation(tl.add(new Vector3f(intersection.x, h, intersection.z)) ); Vector3f normal = terrain.getNormal(new Vector2f(intersection.x, intersection.z)); ((Arrow)markerNormal.getMesh()).setArrowExtent(normal); } }
/** * Alter the location and extent of the magenta arrow. * * @param location the coordinates of the tail (not null, unaffected) * @param extent the offset of the tip from the tail (not null, unaffected) */ public void setMagentaArrow(Vector3f location, Vector3f extent) { arrowMagentaGeom.setLocalTranslation(location); arrowMagenta.setArrowExtent(extent); }
/** * Alter the location and extent of the green arrow. * * @param location the coordinates of the tail (not null, unaffected) * @param extent the offset of the tip from the tail (not null, unaffected) */ public void setGreenArrow(Vector3f location, Vector3f extent) { arrowGreenGeom.setLocalTranslation(location); arrowGreen.setArrowExtent(extent); }
@Override protected void controlUpdate(float tpf) { body.getBodyA().getPhysicsLocation(a.getTranslation()); body.getBodyA().getPhysicsRotation(a.getRotation()); body.getBodyB().getPhysicsLocation(b.getTranslation()); body.getBodyB().getPhysicsRotation(b.getRotation()); geomA.setLocalTransform(a); geomB.setLocalTransform(b); arrowA.setArrowExtent(body.getPivotA()); arrowB.setArrowExtent(body.getPivotB()); }