@Override protected void controlUpdate( float tpf ) { if( spatial != null ) { spatial.rotate(rotate[0] * tpf, rotate[1] * tpf, rotate[2] * tpf); } }
@Override public void simpleUpdate(float tpf){ teapot.rotate(0,tpf,0); tracer.update(); }
public void setupModel(){ Spatial model = assetManager.loadModel("Models/MonkeyHead/MonkeyHead.mesh.xml"); makeToonish(model); model.rotate(0, FastMath.PI, 0); // signpost.setLocalTranslation(12, 3.5f, 30); // model.scale(0.10f); // signpost.setShadowMode(ShadowMode.CastAndReceive); rootNode.attachChild(model); }
/** * Rotates the spatial by the xAngle, yAngle and zAngle angles (in radians), * (aka pitch, yaw, roll) in the local coordinate space. * * @return The spatial on which this method is called, e.g <code>this</code>. */ public Spatial rotate(float xAngle, float yAngle, float zAngle) { TempVars vars = TempVars.get(); Quaternion q = vars.quat1; q.fromAngles(xAngle, yAngle, zAngle); rotate(q); vars.release(); return this; }
public void setupSignpost() { Spatial signpost = assetManager.loadModel("Models/Sign Post/Sign Post.mesh.xml"); Material mat = assetManager.loadMaterial("Models/Sign Post/Sign Post.j3m"); signpost.setMaterial(mat); signpost.rotate(0, FastMath.HALF_PI, 0); signpost.setLocalTranslation(12, 3.5f, 30); signpost.setLocalScale(4); signpost.setShadowMode(ShadowMode.CastAndReceive); rootNode.attachChild(signpost); }
public void setupSignpost(){ Spatial signpost = assetManager.loadModel("Models/Sign Post/Sign Post.mesh.xml"); Material mat = assetManager.loadMaterial("Models/Sign Post/Sign Post.j3m"); signpost.setMaterial(mat); signpost.rotate(0, FastMath.HALF_PI, 0); signpost.setLocalTranslation(12, 3.5f, 30); signpost.setLocalScale(4); signpost.setShadowMode(ShadowMode.CastAndReceive); rootNode.attachChild(signpost); }
public void setupSignpost(){ Spatial signpost = assetManager.loadModel("Models/Sign Post/Sign Post.mesh.xml"); Material mat = assetManager.loadMaterial("Models/Sign Post/Sign Post.j3m"); // mat.setBoolean("VertexLighting", true); signpost.setMaterial(mat); signpost.rotate(0, FastMath.HALF_PI, 0); signpost.setLocalTranslation(12, 3.5f, 30); signpost.setLocalScale(4); signpost.setShadowMode(ShadowMode.CastAndReceive); TangentBinormalGenerator.generate(signpost); rootNode.attachChild(signpost); }
public void setupSignpost() { Spatial signpost = assetManager.loadModel("Models/Sign Post/Sign Post.mesh.xml"); Material matSp = assetManager.loadMaterial("Models/Sign Post/Sign Post.j3m"); TangentBinormalGenerator.generate(signpost); signpost.setMaterial(matSp); signpost.rotate(0, FastMath.HALF_PI, 0); signpost.setLocalTranslation(12, 23.5f, 30); signpost.setLocalScale(4); signpost.setShadowMode(ShadowMode.CastAndReceive); rootNode.attachChild(signpost); }
public void setupSignpost() { Spatial signpost = assetManager.loadModel("Models/Sign Post/Sign Post.mesh.xml"); Material mat = assetManager.loadMaterial("Models/Sign Post/Sign Post.j3m"); TangentBinormalGenerator.generate(signpost); signpost.setMaterial(mat); signpost.rotate(0, FastMath.HALF_PI, 0); signpost.setLocalTranslation(12, 23.5f, 30); signpost.setLocalScale(4); signpost.setShadowMode(ShadowMode.CastAndReceive); rootNode.attachChild(signpost); }
public void setupSignpost() { Spatial signpost = assetManager.loadModel("Models/Sign Post/Sign Post.mesh.xml"); Material mat = assetManager.loadMaterial("Models/Sign Post/Sign Post.j3m"); // mat.setBoolean("VertexLighting", true); signpost.setMaterial(mat); signpost.rotate(0, FastMath.HALF_PI, 0); signpost.setLocalTranslation(12, 3.5f, 30); signpost.setLocalScale(4); signpost.setShadowMode(ShadowMode.CastAndReceive); TangentBinormalGenerator.generate(signpost); rootNode.attachChild(signpost); }
public void makeMissile() { Vector3f pos = spaceCraft.getWorldTranslation().clone(); Quaternion rot = spaceCraft.getWorldRotation(); Vector3f dir = rot.getRotationColumn(2); Spatial missile = assetManager.loadModel("Models/SpaceCraft/Rocket.mesh.xml"); missile.scale(0.5f); missile.rotate(0, FastMath.PI, 0); missile.updateGeometricState(); BoundingBox box = (BoundingBox) missile.getWorldBound(); final Vector3f extent = box.getExtent(null); BoxCollisionShape boxShape = new BoxCollisionShape(extent); missile.setName("Missile"); missile.rotate(rot); missile.setLocalTranslation(pos.addLocal(0, extent.y * 4.5f, 0)); missile.setLocalRotation(hoverControl.getPhysicsRotation()); missile.setShadowMode(ShadowMode.Cast); RigidBodyControl control = new BombControl(assetManager, boxShape, 20); control.setLinearVelocity(dir.mult(100)); control.setCollisionGroup(PhysicsCollisionObject.COLLISION_GROUP_03); missile.addControl(control); rootNode.attachChild(missile); getPhysicsSpace().add(missile); }
teapot.rotate(FastMath.HALF_PI, FastMath.HALF_PI, FastMath.HALF_PI); teapot.setMaterial(mat); rootNode.attachChild(teapot);
pickUp.rotate(pickUpSpeed, pickUpSpeed, pickUpSpeed);
ninja.rotate(0.0f, -3.0f, 0.0f); ninja.setLocalTranslation(0.0f, -5.0f, -2.0f); rootNode.attachChild(ninja);
@Override protected void controlUpdate(float tpf) { if (spatial != null) { //Rotate spatial.rotate(0, tpf * TURN_RATE, 0); } }
private Spatial constructPillar(Node node, Point p, float yAngle) { Spatial part = AssetUtils.loadModel(assetManager, getPillarResource()); moveSpatial(part, p); if (yAngle != 0) { part.rotate(0, yAngle, 0); } node.attachChild(part); return part; }
/** * Adds two candles to the tile, one to each side * * @param n node to attach to * @param assetManager the asset manager instance * @param start starting point for the room * @param p this tile coordinate */ private void addCandles(Node n, AssetManager assetManager, Point start, Point p) { // The "candles" n.attachChild(loadObject(OBJECT_CHAIN_ID, assetManager, start, p, true).move(-1f, 0, 0)); float yAngle = -FastMath.PI; n.attachChild(loadObject(OBJECT_CHAIN_ID, assetManager, start, p, true) .rotate(0, yAngle, 0).move(1f, 0, 1f)); }
private void handleSide(TileData tile, Node pageNode) { Point p = tile.getLocation(); Node sideTileNode = getTileNode(p, (Node) pageNode.getChild(WALL_INDEX)); for (WallDirection direction : WallDirection.values()) { Spatial wall = getWallSpatial(tile, direction); if (wall != null) { wall.rotate(0, direction.getAngle(), 0); sideTileNode.attachChild(wall); } } setTileMaterialToGeometries(tile, sideTileNode); AssetUtils.translateToTile(sideTileNode, p); tile.setSideNode(sideTileNode); }