本文整理了Java中com.jme3.scene.Geometry.setUserData()
方法的一些代码示例,展示了Geometry.setUserData()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geometry.setUserData()
方法的具体详情如下:
包路径:com.jme3.scene.Geometry
类名称:Geometry
方法名:setUserData
暂无
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
public void clearMaterials() {
for(Geometry g : geometries) {
if(g.getUserData("FBXMaterial") != null)
g.setUserData("FBXMaterial", null);
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* Batch this batchNode
* every geometry of the sub scene graph of this node will be batched into a single mesh that will be rendered in one call
*/
public void batch() {
doBatch();
//we set the batch geometries to ignore transforms to avoid transforms of parent nodes to be applied twice
for (Batch batch : batches.getArray()) {
batch.geometry.setIgnoreTransform(true);
batch.geometry.setUserData(UserData.JME_PHYSICSIGNORE, true);
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
geom.setMesh(newMesh);
geometries.add(geom);
geom.setUserData("FBXMaterial", materialId);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
updateBoneMesh(bGeomO, start, ends);
bGeom.setUserData("start", getWorldTransform().transformVector(start, start));
for (int i = 0; i < ends.length; i++) {
getWorldTransform().transformVector(ends[i], ends[i]);
bGeom.setUserData("end", ends);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
setColor(bGeom, outlinesAttach == null ? outlineColor : baseColor);
geomToJoint.put(bGeom, joint);
bGeom.setUserData("start", getWorldTransform().transformVector(start, start));
for (int i = 0; i < ends.length; i++) {
getWorldTransform().transformVector(ends[i], ends[i]);
bGeom.setUserData("end", ends);
bGeom.setQueueBucket(RenderQueue.Bucket.Transparent);
attach(wireAttach, deforms, bGeom);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
if (sharedMesh != null) {
getMesh().extractVertexData(sharedMesh);
setUserData(UserData.JME_SHAREDMESH, null);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
geom1.setUserData("shared", sharedUserData);
geom2.setUserData("shared", sharedUserData);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
instance.setUserData("height", height);
instance.setUserData("dir", 1f);
代码示例来源:origin: org.jmonkeyengine/jme3-plugins
public void clearMaterials() {
for(Geometry g : geometries) {
if(g.getUserData("FBXMaterial") != null)
g.setUserData("FBXMaterial", null);
}
}
代码示例来源:origin: net.sf.phat/phat-devices
public static Geometry createDisplayGeometry(String id, float width, float height) {
Geometry screen = new Geometry("Screen", new Quad(width, height));
screen.setUserData("ID", id);
screen.setUserData("ROLE", "Screen");
return screen;
}
代码示例来源:origin: jMonkeyEngine-Contributions/Lemur
public float getLayer(Geometry g) {
Float d = g.getUserData("effectiveLayer");
if (d != null)
return d;
d = calculateEffectiveLayer(g);
g.setUserData("effectiveLayer", d);
return d;
}
代码示例来源:origin: org.jmonkeyengine/jme3-core
/**
* Batch this batchNode
* every geometry of the sub scene graph of this node will be batched into a single mesh that will be rendered in one call
*/
public void batch() {
doBatch();
//we set the batch geometries to ignore transforms to avoid transforms of parent nodes to be applied twice
for (Batch batch : batches.getArray()) {
batch.geometry.setIgnoreTransform(true);
batch.geometry.setUserData(UserData.JME_PHYSICSIGNORE, true);
}
}
代码示例来源:origin: info.projectkyoto/mms-engine
/**
* Batch this batchNode
* every geometry of the sub scene graph of this node will be batched into a single mesh that will be rendered in one call
*/
public void batch() {
doBatch();
//we set the batch geometries to ignore transforms to avoid transforms of parent nodes to be applied twice
for (Batch batch : batches.getArray()) {
batch.geometry.setIgnoreTransform(true);
batch.geometry.setUserData(UserData.JME_PHYSICSIGNORE, true);
}
updateGeometricState();
}
代码示例来源:origin: tonihele/OpenKeeper
geom.setUserData(MATERIAL_ALTERNATIVE_TEXTURES_COUNT, materials.get(materialIndex).size());
代码示例来源:origin: org.jmonkeyengine/jme3-plugins
geom.setMesh(newMesh);
geometries.add(geom);
geom.setUserData("FBXMaterial", materialId);
代码示例来源:origin: net.sf.phat/phat-devices
private void fixScreen(Spatial device) {
List<Spatial> screens = SpatialUtils.getSpatialsByRole(device, "Screen");
if (screens.size() > 0) {
Geometry geo = (Geometry) screens.get(0);
Node p = geo.getParent();
geo.removeFromParent();
geo = new Geometry("Screen", new Quad(1f, 0.6f));
geo.setUserData("ID", "Screen1");
geo.setUserData("ROLE", "Screen");
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setTexture("ColorMap", assetManager.loadTexture("Textures/FrontSmartPhone.jpg"));
geo.setMaterial(mat);
geo.move(-1.4f, 0f, -0.6f);
geo.rotate(-FastMath.HALF_PI, 0f, 0f);
geo.setLocalScale(Vector3f.UNIT_XYZ.divide(p.getWorldScale()));
p.attachChild(geo);
setState(State.Success);
return;
}
}
代码示例来源:origin: net.sf.phat/phat-devices
@Override
public void runCommand(Application app) {
DevicesAppState devicesAppState = app.getStateManager().getState(DevicesAppState.class);
Node device = devicesAppState.getDevice(deviceId);
if (device != null) {
List<Spatial> screens = SpatialUtils.getSpatialsByRole(device, "Screen");
if (screens.size() > 0) {
Geometry geo = (Geometry) screens.get(0);
Node p = geo.getParent();
geo.removeFromParent();
geo = new Geometry("Screen", new Quad(1f, 0.6f));
geo.setUserData("ID", "Screen1");
geo.setUserData("ROLE", "Screen");
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setTexture("ColorMap", assetManager.loadTexture(imagePath));
geo.setMaterial(mat);
geo.move(-1.4f, 0f, -0.6f);
geo.rotate(-FastMath.HALF_PI, 0f, 0f);
geo.setLocalScale(Vector3f.UNIT_XYZ.divide(p.getWorldScale()));
p.attachChild(geo);
setState(State.Success);
return;
}
}
setState(State.Fail);
}
代码示例来源:origin: org.jmonkeyengine/jme3-core
if (sharedMesh != null) {
getMesh().extractVertexData(sharedMesh);
setUserData(UserData.JME_SHAREDMESH, null);
代码示例来源:origin: jMonkeyEngine-Contributions/Lemur
public TextEntryComponent( DocumentModel model, BitmapFont font ) {
this.font = font;
this.bitmapText = new BitmapText(font);
bitmapText.setLineWrapMode(LineWrapMode.Clip);
// Can't really do this since we don't know what
// bucket it will actually end up in Gui or regular.
//bitmapText.setQueueBucket( Bucket.Transparent );
this.model = model;
// Create a versioned reference for watching for updates, external or otherwise
this.modelRef = model.createReference();
this.caratRef = model.createCaratReference();
cursorQuad = new Quad(getCursorWidth(), bitmapText.getLineHeight());
cursor = new Geometry( "cursor", cursorQuad );
GuiMaterial mat = GuiGlobals.getInstance().createMaterial(new ColorRGBA(1,1,1,0.75f), false);
cursor.setMaterial(mat.getMaterial());
cursor.getMaterial().getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
cursor.setUserData("layer", 1);
bitmapText.attachChild(cursor);
if( model.getText() != null ) {
resetText();
}
}
内容来源于网络,如有侵权,请联系作者删除!