public void putArrow(Vector3f pos, Vector3f dir, ColorRGBA color){ Arrow arrow = new Arrow(dir); putShape(arrow, color, 4).setLocalTranslation(pos); }
/** * Instantiate an enabled control to visualize the specified joint. * * @param debugAppState which app state (not null, alias created) * @param body the joint to visualize (not null, alias created) */ 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); }
/** * Instantiate an enabled control to visualize the specified joint. * * @param debugAppState which app state (not null, alias created) * @param body the joint to visualize (not null, alias created) */ 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); }
/** A red ball that marks the last spot that was "hit" by the "shot". */ protected void initMark() { Arrow arrow = new Arrow(Vector3f.UNIT_Z.mult(2f)); //Sphere sphere = new Sphere(30, 30, 0.2f); mark = new Geometry("BOOM!", arrow); //mark = new Geometry("BOOM!", sphere); Material mark_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mark_mat.getAdditionalRenderState().setLineWidth(3); mark_mat.setColor("Color", ColorRGBA.Red); mark.setMaterial(mark_mat); }
Geometry arrowX = new Geometry("arrowX", new Arrow(new Vector3f(arrowSize, 0, 0))); arrowX.setMaterial(redMat); Geometry arrowY = new Geometry("arrowY", new Arrow(new Vector3f(0, arrowSize, 0))); arrowY.setMaterial(greenMat); Geometry arrowZ = new Geometry("arrowZ", new Arrow(new Vector3f(0, 0, arrowSize))); arrowZ.setMaterial(blueMat); axis.attachChild(arrowX);
Geometry arrowX = new Geometry("arrowX", new Arrow(new Vector3f(arrowSize, 0, 0))); arrowX.setMaterial(redMat); Geometry arrowY = new Geometry("arrowY", new Arrow(new Vector3f(0, arrowSize, 0))); arrowY.setMaterial(greenMat); Geometry arrowZ = new Geometry("arrowZ", new Arrow(new Vector3f(0, 0, arrowSize))); arrowZ.setMaterial(blueMat); axis.attachChild(arrowX);
private void createVehicle() { suspensionNode.detachAllChildren(); for (int i = 0; i < body.getNumWheels(); i++) { VehicleWheel physicsVehicleWheel = body.getWheel(i); Vector3f location = physicsVehicleWheel.getLocation().clone(); Vector3f direction = physicsVehicleWheel.getDirection().clone(); Vector3f axle = physicsVehicleWheel.getAxle().clone(); float restLength = physicsVehicleWheel.getRestLength(); float radius = physicsVehicleWheel.getRadius(); Arrow locArrow = new Arrow(location); Arrow axleArrow = new Arrow(axle.normalizeLocal().multLocal(0.3f)); Arrow wheelArrow = new Arrow(direction.normalizeLocal().multLocal(radius)); Arrow dirArrow = new Arrow(direction.normalizeLocal().multLocal(restLength)); Geometry locGeom = new Geometry("WheelLocationDebugShape" + i, locArrow); Geometry dirGeom = new Geometry("WheelDirectionDebugShape" + i, dirArrow); Geometry axleGeom = new Geometry("WheelAxleDebugShape" + i, axleArrow); Geometry wheelGeom = new Geometry("WheelRadiusDebugShape" + i, wheelArrow); dirGeom.setLocalTranslation(location); axleGeom.setLocalTranslation(location.add(direction)); wheelGeom.setLocalTranslation(location.add(direction)); locGeom.setMaterial(debugAppState.DEBUG_MAGENTA); dirGeom.setMaterial(debugAppState.DEBUG_MAGENTA); axleGeom.setMaterial(debugAppState.DEBUG_MAGENTA); wheelGeom.setMaterial(debugAppState.DEBUG_MAGENTA); suspensionNode.attachChild(locGeom); suspensionNode.attachChild(dirGeom); suspensionNode.attachChild(axleGeom); suspensionNode.attachChild(wheelGeom); } }
private void createVehicle() { suspensionNode.detachAllChildren(); for (int i = 0; i < body.getNumWheels(); i++) { VehicleWheel physicsVehicleWheel = body.getWheel(i); Vector3f location = physicsVehicleWheel.getLocation().clone(); Vector3f direction = physicsVehicleWheel.getDirection().clone(); Vector3f axle = physicsVehicleWheel.getAxle().clone(); float restLength = physicsVehicleWheel.getRestLength(); float radius = physicsVehicleWheel.getRadius(); Arrow locArrow = new Arrow(location); Arrow axleArrow = new Arrow(axle.normalizeLocal().multLocal(0.3f)); Arrow wheelArrow = new Arrow(direction.normalizeLocal().multLocal(radius)); Arrow dirArrow = new Arrow(direction.normalizeLocal().multLocal(restLength)); Geometry locGeom = new Geometry("WheelLocationDebugShape" + i, locArrow); Geometry dirGeom = new Geometry("WheelDirectionDebugShape" + i, dirArrow); Geometry axleGeom = new Geometry("WheelAxleDebugShape" + i, axleArrow); Geometry wheelGeom = new Geometry("WheelRadiusDebugShape" + i, wheelArrow); dirGeom.setLocalTranslation(location); axleGeom.setLocalTranslation(location.add(direction)); wheelGeom.setLocalTranslation(location.add(direction)); locGeom.setMaterial(debugAppState.DEBUG_MAGENTA); dirGeom.setMaterial(debugAppState.DEBUG_MAGENTA); axleGeom.setMaterial(debugAppState.DEBUG_MAGENTA); wheelGeom.setMaterial(debugAppState.DEBUG_MAGENTA); suspensionNode.attachChild(locGeom); suspensionNode.attachChild(dirGeom); suspensionNode.attachChild(axleGeom); suspensionNode.attachChild(wheelGeom); } }
private void createMarker() { // collision marker Sphere sphere = new Sphere(8, 8, 0.5f); marker = new Geometry("Marker"); marker.setMesh(sphere); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setColor("Color", new ColorRGBA(251f/255f, 130f/255f, 0f, 0.6f)); mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha); marker.setMaterial(mat); rootNode.attachChild(marker); // surface normal marker Arrow arrow = new Arrow(new Vector3f(0,1,0)); markerNormal = new Geometry("MarkerNormal"); markerNormal.setMesh(arrow); markerNormal.setMaterial(mat); rootNode.attachChild(markerNormal); } }
Arrow a = new Arrow(new Vector3f(0, 50, 0)); Geometry g = new Geometry("a", a); g.setLocalTranslation(terrain.getLocalTranslation());
public Spatial draw(DrawableCombiner3d dc, Primitive3d primitive, SpaceObject sobj, ViewportJMonkey vp) { arrow = new Arrow(sizelocal); arrow.setLineWidth(2); geo = new Geometry(identifier, arrow); return geo; }
protected Spatial attachDebugShape(Material material) { debugMaterialBlue = material; debugMaterialGreen = material; debugMaterialRed = material; debugMaterialYellow = material; debugArrow = new Arrow(Vector3f.UNIT_XYZ); debugArrowGeom = new Geometry("DebugArrow", debugArrow); debugArrowGeom.setMaterial(debugMaterialGreen); return attachDebugShape(); }
public static void showVector3fArrow(AssetManager am, Node n, Vector3f v, ColorRGBA color, String name) { Arrow a = new Arrow(v); Material mat = DebugUtils.makeMaterial(am, "Common/MatDefs/Misc/Unshaded.j3md", color); Geometry geom = makeGeometry(a, mat, name); n.attachChild(geom); }
private void attachCoordinateAxes(Node node, Vector3f pos){ Arrow arrow = new Arrow(Vector3f.UNIT_X); arrow.setLineWidth(4); // make arrow thicker putShape(node, arrow, ColorRGBA.Red).setLocalTranslation(pos); arrow = new Arrow(Vector3f.UNIT_Y); arrow.setLineWidth(4); // make arrow thicker putShape(node, arrow, ColorRGBA.Green).setLocalTranslation(pos); arrow = new Arrow(Vector3f.UNIT_Z); arrow.setLineWidth(4); // make arrow thicker putShape(node, arrow, ColorRGBA.Blue).setLocalTranslation(pos); }
private void attachCoordinateAxes(Node node, Vector3f pos){ Arrow arrow = new Arrow(Vector3f.UNIT_X); arrow.setLineWidth(4); // make arrow thicker putShape(node, arrow, ColorRGBA.Red).setLocalTranslation(pos); arrow = new Arrow(Vector3f.UNIT_Y); arrow.setLineWidth(4); // make arrow thicker putShape(node, arrow, ColorRGBA.Green).setLocalTranslation(pos); arrow = new Arrow(Vector3f.UNIT_Z); arrow.setLineWidth(4); // make arrow thicker putShape(node, arrow, ColorRGBA.Blue).setLocalTranslation(pos); }
public static void attachCoordinateAxes(Vector3f pos, float size, AssetManager assetManager, Node rootNode) { Arrow arrow = new Arrow(Vector3f.UNIT_X.mult(size)); arrow.setLineWidth(4); // make arrow thicker putShape(arrow, ColorRGBA.Green, assetManager, rootNode).setLocalTranslation(pos); arrow = new Arrow(Vector3f.UNIT_Y.mult(size)); arrow.setLineWidth(4); // make arrow thicker putShape(arrow, ColorRGBA.Blue, assetManager, rootNode).setLocalTranslation(pos); arrow = new Arrow(Vector3f.UNIT_Z.mult(size)); arrow.setLineWidth(4); // make arrow thicker putShape(arrow, ColorRGBA.Red, assetManager, rootNode).setLocalTranslation(pos); }
public static Geometry createArrow(Material mat, Vector3f pos, Vector3f dir) { Arrow arrow = new Arrow(dir.subtract(pos)); arrow.setLineWidth(4); // make arrow thicker Geometry arrowGeom = new Geometry("Arrow", arrow); arrowGeom.setMaterial(mat); arrowGeom.setLocalTranslation(pos); return arrowGeom; }
public static Geometry createArrow(Material mat, Vector3f pos, Vector3f dir) { Arrow arrow = new Arrow(dir.subtract(pos)); arrow.setLineWidth(4); // make arrow thicker Geometry arrowGeom = new Geometry("Arrow", arrow); arrowGeom.setMaterial(mat); arrowGeom.setLocalTranslation(pos); return arrowGeom; }
private void putArrow(Vector3f pos, Vector3f dir, ColorRGBA color) { Arrow arrow = new Arrow(dir); arrow.setArrowExtent(dir); arrow.setPointSize(0.2f); arrow.setLineWidth(5); // make arrow thicker putShape(arrow, color).setLocalTranslation(pos); }
public static Geometry giveArrow (ColorRGBA color, float thickness, Vector3f direction, AssetManager assetManager) { Arrow a = new Arrow(direction); a.setLineWidth(thickness); Geometry ret = new Geometry("arrrow " + direction.toString(), a); Material m = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); m.setColor("Color", color); ret.setMaterial(m); return ret; } }