com.jme3.scene.Geometry.center()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(154)

本文整理了Java中com.jme3.scene.Geometry.center()方法的一些代码示例,展示了Geometry.center()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geometry.center()方法的具体详情如下:
包路径:com.jme3.scene.Geometry
类名称:Geometry
方法名:center

Geometry.center介绍

暂无

代码示例

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

public void putGrid(Vector3f pos, ColorRGBA color){
  putShape(new Grid(6, 6, 0.2f), color, 1).center().move(pos);
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

public void setupFloor() {
  Quad q = new Quad(20, 20);
  q.scaleTextureCoordinates(Vector2f.UNIT_XY.mult(10));
  Geometry geom = new Geometry("floor", q);
  Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  mat.setColor("Color", ColorRGBA.White);       
  geom.setMaterial(mat);
  geom.rotate(-FastMath.HALF_PI, 0, 0);
  geom.center();
  geom.move(0, -0.3f, 0);
  geom.setShadowMode(RenderQueue.ShadowMode.Receive);
  rootNode.attachChild(geom);
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

public void setupFloor() {
  Quad q = new Quad(20, 20);
  q.scaleTextureCoordinates(Vector2f.UNIT_XY.mult(10));
  Geometry geom = new Geometry("floor", q);
  Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
  mat.setColor("Diffuse", ColorRGBA.White);
  mat.setColor("Specular", ColorRGBA.White);
  mat.setColor("Ambient", ColorRGBA.Black);
  mat.setBoolean("UseMaterialColors", true);
  mat.setFloat("Shininess", 0);
  geom.setMaterial(mat);
  geom.rotate(-FastMath.HALF_PI, 0, 0);
  geom.center();
  geom.setShadowMode(RenderQueue.ShadowMode.Receive);
  rootNode.attachChild(geom);
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

wheel_fr.center();
box = (BoundingBox) wheel_fr.getModelBound();
wheelRadius = box.getYExtent();
wheel_fl.center();
box = (BoundingBox) wheel_fl.getModelBound();
player.addWheel(wheel_fl.getParent(), box.getCenter().add(0, -front_wheel_h, 0),
wheel_br.center();
box = (BoundingBox) wheel_br.getModelBound();
player.addWheel(wheel_br.getParent(), box.getCenter().add(0, -back_wheel_h, 0),
wheel_bl.center();
box = (BoundingBox) wheel_bl.getModelBound();
player.addWheel(wheel_bl.getParent(), box.getCenter().add(0, -back_wheel_h, 0),

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

@Override
public void simpleInitApp() {
  // create a simple plane/quad
  Quad quadMesh = new Quad(1, 1);
  quadMesh.updateGeometry(1, 1, true);
  Geometry quad = new Geometry("Textured Quad", quadMesh);
  assetManager.registerLocator("https://raw.githubusercontent.com/jMonkeyEngine/BookSamples/master/assets/Textures/",
              UrlLocator.class);
  TextureKey key = new TextureKey("mucha-window.png", false);
  key.setGenerateMips(true);
  Texture tex = assetManager.loadTexture(key);
  Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  mat.setTexture("ColorMap", tex);
  quad.setMaterial(mat);
  float aspect = tex.getImage().getWidth() / (float) tex.getImage().getHeight();
  quad.setLocalScale(new Vector3f(aspect * 1.5f, 1.5f, 1));
  quad.center();
  rootNode.attachChild(quad);
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

@Override
  public void simpleInitApp() {
    flyCam.setMoveSpeed(10);

    Torus torus = new Torus(10, 6, 1, 3);
    Geometry g = new Geometry("Torus Geom", torus);
    g.rotate(-FastMath.HALF_PI, 0, 0);
    g.center();

    g.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
//        rootNode.attachChild(g);

    ufoNode = new AudioNode(assetManager, "Sound/Effects/Beep.ogg", AudioData.DataType.Buffer);
    ufoNode.setLooping(true);
    ufoNode.setPitch(0.5f);
    ufoNode.setRefDistance(1);
    ufoNode.setMaxDistance(100000000);
    ufoNode.setVelocityFromTranslation(true);
    ufoNode.play();

    Geometry ball = new Geometry("Beeper", new Sphere(10, 10, 0.1f));
    ball.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
    ufoNode.attachChild(ball);

    rootNode.attachChild(ufoNode);
  }

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

g.center();

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

g.center();

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

geom.center();
geom.setShadowMode(ShadowMode.Receive);
TangentBinormalGenerator.generate(geom);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

geom.center();
geom.setShadowMode(ShadowMode.Receive);
rootNode.attachChild(geom);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

geom.center();
geom.setShadowMode(ShadowMode.CastAndReceive);
rootNode.attachChild(geom);

代码示例来源:origin: net.sf.phat/phat-core

private static void attachGrid(Vector3f pos, float size, ColorRGBA color,
      AssetManager assetManager, Node rootNode) {
    Geometry g = new Geometry("wireframe grid", new Grid((int) size, (int) size, 1f));
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mat.getAdditionalRenderState().setWireframe(true);
    mat.setColor("Color", color);
    g.setMaterial(mat);
    g.center().move(pos);
    rootNode.attachChild(g);
  }
}

代码示例来源:origin: tonihele/OpenKeeper

public static void attachWireFrameDebugGrid(AssetManager assetManager, Node n, Vector3f pos,
      Integer size, ColorRGBA color) {
    Geometry g = new Geometry("wireFrameDebugGrid", new Grid(size, size, 1.0f));  //1WU
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mat.getAdditionalRenderState().setWireframe(true);
    mat.setColor("Color", color);
    g.setMaterial(mat);
    g.center().move(pos);
    n.attachChild(g);
  }
}

代码示例来源:origin: net.sf.phat/phat-devices

@Override
public void createOtherObjects() {
  Node screenNode = new Node();
  Quad quadMesh = new Quad(1, 1);
  quadMesh.updateGeometry(1, 1, true);
  screen = new Geometry("Textured Quad", quadMesh);
  screenNode.attachChild(screen);
  //assetManager.registerLocator("https://jmonkeyengine.googlecode.com/svn/BookSamples/assets/Textures/", UrlLocator.class);
  TextureKey key = new TextureKey("Textures/PHAT-QR.png", false);
  key.setGenerateMips(true);
  Texture tex = assetManager.loadTexture(key);
  Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  mat.setTexture("ColorMap", tex);
  screen.setMaterial(mat);
  screen.setLocalScale(new Vector3f(qrSize, qrSize, 1));
  screen.center();
  screen.move(qrInitialPos);
  //screenNode.setLocalTranslation(0f,1f,1f);
  screenNode.lookAt(new Vector3f(0f, 0f, 1f), Vector3f.UNIT_Y);
  rootNode.attachChild(screenNode);
}

代码示例来源:origin: net.sf.phat/phat-server

screenQR.center();
screenQR.move(qrInitialPos);

相关文章