本文整理了Java中com.jme3.scene.Spatial.setShadowMode()
方法的一些代码示例,展示了Spatial.setShadowMode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Spatial.setShadowMode()
方法的具体详情如下:
包路径:com.jme3.scene.Spatial
类名称:Spatial
方法名:setShadowMode
[英]Sets the shadow mode of the spatial The shadow mode determines how the spatial should be shadowed, when a shadowing technique is used. See the documentation for the class ShadowMode for more information.
[中]设置空间的阴影模式。阴影模式确定在使用阴影技术时应如何对空间进行阴影。有关更多信息,请参阅ShadowMode类的文档。
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
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);
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
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);
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
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);
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
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);
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
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);
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
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);
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
spatial.setShadowMode(ShadowMode.Receive);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
private void buildPlayer() {
spaceCraft = assetManager.loadModel("Models/HoverTank/Tank2.mesh.xml");
CollisionShape colShape = CollisionShapeFactory.createDynamicMeshShape(spaceCraft);
spaceCraft.setShadowMode(ShadowMode.CastAndReceive);
spaceCraft.setLocalTranslation(new Vector3f(-140, 50, -23));
spaceCraft.setLocalRotation(new Quaternion(new float[]{0, 0.01f, 0}));
hoverControl = new PhysicsHoverControl(colShape, 500);
spaceCraft.addControl(hoverControl);
rootNode.attachChild(spaceCraft);
getPhysicsSpace().add(hoverControl);
hoverControl.setCollisionGroup(PhysicsCollisionObject.COLLISION_GROUP_02);
ChaseCamera chaseCam = new ChaseCamera(cam, inputManager);
spaceCraft.addControl(chaseCam);
flyCam.setEnabled(false);
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
model.setShadowMode(ShadowMode.CastAndReceive);
rootNode.attachChild(model);
teapot.setLocalTranslation(10, 0, 10);
teapot.setMaterial(mat);
teapot.setShadowMode(ShadowMode.CastAndReceive);
rootNode.attachChild(teapot);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
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);
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
TangentBinormalGenerator.generate(((Geometry)((Node)scene).getChild(0)).getMesh());
scene.setMaterial(mat);
scene.setShadowMode(ShadowMode.CastAndReceive);
scene.setLocalScale(400);
scene.setLocalTranslation(0, -10, -120);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
obj[0].setShadowMode(ShadowMode.CastAndReceive);
obj[1] = new Geometry("cube", new Box(1.0f, 1.0f, 1.0f));
obj[1].setShadowMode(ShadowMode.CastAndReceive);
TangentBinormalGenerator.generate(obj[1]);
TangentBinormalGenerator.generate(obj[0]);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
teaGeom.setShadowMode(ShadowMode.Cast);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
teaGeom.setShadowMode(ShadowMode.Cast);
makeToonish(teaGeom);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
golem.scale(0.5f);
golem.setLocalTranslation(200.0f, -6f, 200f);
golem.setShadowMode(ShadowMode.CastAndReceive);
characters.attachChild(golem);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
teapot.setShadowMode(ShadowMode.CastAndReceive);
teapot.setLocalScale(10.0f);
rootNode.attachChild(teapot);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
teapot.setShadowMode(ShadowMode.CastAndReceive);
teapot.setLocalScale(10.0f);
rootNode.attachChild(teapot);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
scene.setShadowMode(RenderQueue.ShadowMode.CastAndReceive);
rootNode.attachChild(scene);
rootNode.getChild("Cube").setShadowMode(RenderQueue.ShadowMode.Receive);
lightNode = (Node) rootNode.getChild("Lamp");
Geometry lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
teapot.setShadowMode(ShadowMode.CastAndReceive);
teapot.setLocalScale(10.0f);
rootNode.attachChild(teapot);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
teapot.setShadowMode(ShadowMode.CastAndReceive);
teapot.setLocalScale(10.0f);
rootNode.attachChild(teapot);
内容来源于网络,如有侵权,请联系作者删除!