private static Geometry createDebugShape(CollisionShape shape) { Geometry geom = new Geometry(); geom.setMesh(DebugShapeFactory.getDebugMesh(shape)); // geom.setLocalScale(shape.getScale()); geom.updateModelBound(); return geom; }
/** * 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); }
/** * Create a geometry for visualizing the specified shape. * * @param shape (not null, unaffected) * @return a new geometry (not null) */ private static Geometry createDebugShape(CollisionShape shape) { Geometry geom = new Geometry(); geom.setMesh(DebugShapeFactory.getDebugMesh(shape)); // geom.setLocalScale(shape.getScale()); geom.updateModelBound(); return geom; }
private void createCollisionMarker() { Sphere s = new Sphere(6, 6, 1); collisionMarker = new Geometry("collisionMarker"); collisionMarker.setMesh(s); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setColor("Color", ColorRGBA.Orange); collisionMarker.setMaterial(mat); rootNode.attachChild(collisionMarker); } private ActionListener actionListener = new ActionListener() {
/** * used by attachBoundChildren() */ private void attachBoundingBox(BoundingBox bb, Node parent) { WireBox wb = new WireBox(bb.getXExtent(), bb.getYExtent(), bb.getZExtent()); Geometry g = new Geometry(); g.setMesh(wb); g.setLocalTranslation(bb.getCenter()); parent.attachChild(g); }
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); } }
batch.geometry.setMesh(m); batch.geometry.getMesh().updateCounts(); batch.geometry.updateModelBound();
if (FastMath.nextRandomInt(0, 1) == 1) mesh = mesh2; else mesh = mesh1; geom.setMesh(mesh);
mesh.updateCounts(); mesh.updateBound(); geom.setMesh(mesh);
private void nextFrame() { currentIndex++; if (currentIndex >= currentSequence.length) { currentIndex = 0; if (sequenceEndTask != null) { sequenceEndTask.run(); } } geometry.setMesh(currentSequence[currentIndex]); }
geom.setMesh(new Box(5, 1, 1)); checkFilteredLights(1);
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); }
private static Geometry createDebugShape(CollisionShape shape) { Geometry geom = new Geometry(); geom.setMesh(DebugShapeFactory.getDebugMesh(shape)); // geom.setLocalScale(shape.getScale()); geom.updateModelBound(); return geom; }
private static Geometry createDebugShape(CollisionShape shape) { Geometry geom = new Geometry(); geom.setMesh(DebugShapeFactory.getDebugMesh(shape)); // geom.setLocalScale(shape.getScale()); geom.updateModelBound(); return geom; }
private static Geometry createDebugShape(CollisionShape shape) { Geometry geom = new Geometry(); geom.setMesh(DebugShapeFactory.getDebugMesh(shape)); // geom.setLocalScale(shape.getScale()); geom.updateModelBound(); return geom; }
/** * used by attachBoundChildren() */ private void attachBoundingBox(BoundingBox bb, Node parent) { WireBox wb = new WireBox(bb.getXExtent(), bb.getYExtent(), bb.getZExtent()); Geometry g = new Geometry(); g.setMesh(wb); g.setLocalTranslation(bb.getCenter()); parent.attachChild(g); }