本文整理了Java中com.jme3.scene.Geometry.setLocalRotation()
方法的一些代码示例,展示了Geometry.setLocalRotation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geometry.setLocalRotation()
方法的具体详情如下:
包路径:com.jme3.scene.Geometry
类名称:Geometry
方法名:setLocalRotation
暂无
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
@Override
public void simpleUpdate(float tpf){
Quaternion q = new Quaternion();
angle += tpf;
angle %= FastMath.TWO_PI;
q.fromAngles(angle, 0, angle);
offBox.setLocalRotation(q);
offBox.updateLogicalState(tpf);
offBox.updateGeometricState();
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
@Override
public void simpleUpdate(float tpf){
Quaternion q = new Quaternion();
angle += tpf;
angle %= FastMath.TWO_PI;
q.fromAngles(angle, 0, angle);
offBox.setLocalRotation(q);
offBox.updateLogicalState(tpf);
offBox.updateGeometricState();
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
private void attachRandomGeometry(Node node, Material mat) {
Box box = new Box(0.25f, 0.25f, 0.25f);
Torus torus = new Torus(16, 16, 0.2f, 0.8f);
Geometry[] boxes = new Geometry[]{
new Geometry("box1", box),
new Geometry("box2", box),
new Geometry("box3", box),
new Geometry("torus1", torus),
new Geometry("torus2", torus),
new Geometry("torus3", torus)
};
for (int i = 0; i < boxes.length; i++) {
Geometry geometry = boxes[i];
geometry.setLocalTranslation((float) Math.random() * 10 -10, (float) Math.random() * 10 -10, (float) Math.random() * 10 -10);
geometry.setLocalRotation(new Quaternion().fromAngles((float) Math.random() * FastMath.PI, (float) Math.random() * FastMath.PI, (float) Math.random() * FastMath.PI));
geometry.setLocalScale((float) Math.random() * 10 -10, (float) Math.random() * 10 -10, (float) Math.random() * 10 -10);
geometry.setMaterial(mat);
node.attachChild(geometry);
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
@Override
public void simpleUpdate(float tpf){
Quaternion q = new Quaternion();
if (offView.isEnabled()) {
angle += tpf;
angle %= FastMath.TWO_PI;
q.fromAngles(angle, 0, angle);
offBox.setLocalRotation(q);
offBox.updateLogicalState(tpf);
offBox.updateGeometricState();
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* Creates a quad with the water material applied to it.
* @param width
* @param height
* @return
*/
public Geometry createWaterGeometry(float width, float height) {
Quad quad = new Quad(width, height);
Geometry geom = new Geometry("WaterGeometry", quad);
geom.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
geom.setMaterial(material);
return geom;
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
geometry.setLocalRotation(tempRot);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
geometry.setLocalRotation(tempRot);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
@Override
public void simpleUpdate(float tpf) {
if (!done) {
done = true;
batch.attachChild(cube2);
batch.batch();
}
updateBoindPoints(points);
frustum.update(points);
time += tpf;
dl.setDirection(cam.getDirection());
cube2.setLocalTranslation(FastMath.sin(-time) * 3, FastMath.cos(time) * 3, 0);
cube2.setLocalRotation(new Quaternion().fromAngleAxis(time, Vector3f.UNIT_Z));
cube2.setLocalScale(Math.max(FastMath.sin(time), 0.5f));
// batch.setLocalRotation(new Quaternion().fromAngleAxis(time, Vector3f.UNIT_Z));
}
//
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
public void setupFloor() {
mat = assetManager.loadMaterial("Textures/Terrain/BrickWall/BrickWall.j3m");
Node floorGeom = new Node("floorGeom");
Quad q = new Quad(100, 100);
q.scaleTextureCoordinates(new Vector2f(10, 10));
Geometry g = new Geometry("geom", q);
g.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
floorGeom.attachChild(g);
TangentBinormalGenerator.generate(floorGeom);
floorGeom.setLocalTranslation(-50, 22, 60);
//floorGeom.setLocalScale(100);
floorGeom.setMaterial(mat);
rootNode.attachChild(floorGeom);
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
public void setupFloor() {
mat = assetManager.loadMaterial("Textures/Terrain/BrickWall/BrickWallPBR.j3m");
//mat = assetManager.loadMaterial("Textures/Terrain/BrickWall/BrickWallPBR2.j3m");
Node floorGeom = new Node("floorGeom");
Quad q = new Quad(100, 100);
q.scaleTextureCoordinates(new Vector2f(10, 10));
Geometry g = new Geometry("geom", q);
g.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
floorGeom.attachChild(g);
TangentBinormalGenerator.generate(floorGeom);
floorGeom.setLocalTranslation(-50, 22, 60);
//floorGeom.setLocalScale(100);
floorGeom.setMaterial(mat);
rootNode.attachChild(floorGeom);
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
mark.setLocalRotation(q);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
mat_ground.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
Geometry ground = new Geometry("ground", new Quad(50, 50));
ground.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
ground.setLocalTranslation(-25, -1, 25);
ground.setMaterial(mat_ground);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
mat_ground.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
Geometry ground = new Geometry("ground", new Quad(50, 50));
ground.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
ground.setLocalTranslation(-25, -1, 25);
ground.setMaterial(mat_ground);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
Geometry ground = new Geometry("ground", new Quad(50, 50));
ground.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
ground.setLocalTranslation(-25, -1, 25);
ground.setMaterial(mat);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
water.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
water.setMaterial(waterProcessor.getMaterial());
water.setLocalTranslation(-200, -20, 250);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
groundBoxWhite.setLocalRotation(new Quaternion(f));
groundBoxWhite.move(7.5f, -.75f, 7.5f);
final Material groundMaterial = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
代码示例来源:origin: org.cogchar/org.cogchar.lib.render.goody
public void setDirection_onRendThrd(Quaternion dirQuat) {
myDirection = dirQuat;
if (myGeom != null) {
myGeom.setLocalRotation(myDirection);
}
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
pickUp.setShadowMode(ShadowMode.CastAndReceive);
pickUp.setMaterial(materialYellow);
pickUp.setLocalRotation(rotation.fromAngles(
FastMath.rand.nextFloat() * FastMath.TWO_PI,
FastMath.rand.nextFloat() * FastMath.TWO_PI,
代码示例来源:origin: us.ihmc/ihmc-perception
@Override
public void simpleUpdate(float tpf){
Quaternion q = new Quaternion();
angle += tpf;
angle %= FastMath.TWO_PI;
q.fromAngles(angle, 0, angle);
offBox.setLocalRotation(q);
offBox.updateLogicalState(tpf);
offBox.updateGeometricState();
}
代码示例来源:origin: us.ihmc/IHMCPerception
@Override
public void simpleUpdate(float tpf){
Quaternion q = new Quaternion();
angle += tpf;
angle %= FastMath.TWO_PI;
q.fromAngles(angle, 0, angle);
offBox.setLocalRotation(q);
offBox.updateLogicalState(tpf);
offBox.updateGeometricState();
}
内容来源于网络,如有侵权,请联系作者删除!