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

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

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

Geometry.setMesh介绍

[英]Sets the mesh to use for this geometry when rendering.
[中]设置渲染时用于此几何体的网格。

代码示例

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

private static Geometry createDebugShape(CollisionShape shape) {
    Geometry geom = new Geometry();
    geom.setMesh(DebugShapeFactory.getDebugMesh(shape));
//        geom.setLocalScale(shape.getScale());
    geom.updateModelBound();
    return geom;
  }

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

/**
 * 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);
}

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

/**
 * 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);
}

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

/**
   * 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;
  }

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

for (int samples = 4; samples < 50; samples++) {
  Geometry g = new Geometry();
  g.setMesh(new Sphere(samples, samples, 1.0f));
  root.attachChild(g);
for (int samples = 4; samples < 50; samples++) {
  Geometry g = new Geometry();
  g.setMesh(new Sphere(samples, samples, 1.0f));
  root.attachChild(g);

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

newMesh.updateCounts();
  Geometry geom = new Geometry();
  geom.setMesh(newMesh);
  geometries.add(geom);
  geom.setUserData("FBXMaterial", materialId);
mesh.updateCounts();
Geometry geom = new Geometry();
geom.setMesh(mesh);
geometries.add(geom);

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

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() {

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

/**
 * 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);
}

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

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);
  }
}

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

batch.geometry.setMesh(m);
batch.geometry.getMesh().updateCounts();
batch.geometry.updateModelBound();

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

if (FastMath.nextRandomInt(0, 1) == 1) mesh = mesh2;
else mesh = mesh1;
geom.setMesh(mesh);

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

mesh.updateCounts();
mesh.updateBound();
geom.setMesh(mesh);

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

g.setMesh(s);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", ColorRGBA.Red);
g2.setMesh(s);
mat.setColor("Color", ColorRGBA.Red);
g2.setMaterial(mat);
g3.setMesh(s);
mat.setColor("Color", ColorRGBA.Red);
g3.setMaterial(mat);

代码示例来源:origin: org.jmonkeyengine/jme3-dae

private void nextFrame()
{
 currentIndex++;
 if (currentIndex >= currentSequence.length)
 {
   currentIndex = 0;
   if (sequenceEndTask != null)
   {
    sequenceEndTask.run();
   }
 }
 geometry.setMesh(currentSequence[currentIndex]);
}

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

geom.setMesh(new Box(5, 1, 1));
checkFilteredLights(1);

代码示例来源:origin: org.jmonkeyengine/jme3-bullet

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);
}

代码示例来源:origin: info.projectkyoto/mms-engine

private static Geometry createDebugShape(CollisionShape shape) {
    Geometry geom = new Geometry();
    geom.setMesh(DebugShapeFactory.getDebugMesh(shape));
//        geom.setLocalScale(shape.getScale());
    geom.updateModelBound();
    return geom;
  }

代码示例来源:origin: org.jmonkeyengine/jme3-jbullet

private static Geometry createDebugShape(CollisionShape shape) {
    Geometry geom = new Geometry();
    geom.setMesh(DebugShapeFactory.getDebugMesh(shape));
//        geom.setLocalScale(shape.getScale());
    geom.updateModelBound();
    return geom;
  }

代码示例来源:origin: org.jmonkeyengine/jme3-bullet

private static Geometry createDebugShape(CollisionShape shape) {
    Geometry geom = new Geometry();
    geom.setMesh(DebugShapeFactory.getDebugMesh(shape));
//        geom.setLocalScale(shape.getScale());
    geom.updateModelBound();
    return geom;
  }

代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-terrain

/**
 * 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);
}

相关文章