/** * <code>updateWorldBound</code> updates the bounding volume that contains this geometry. The * location of the geometry is based on the location of all this node's parents. * * @see com.jme.scene.Spatial#updateWorldBound() */ public void updateWorldBound() { if (target.getModelBound() != null) { worldBound = target .getModelBound() .transform( parentGeom.getWorldRotation(), parentGeom.getWorldTranslation(), parentGeom.getWorldScale(), worldBound); } }
/** * <code>setTarget</code> sets the shared data mesh. * * @param target the TriMesh to share the data. */ public void setTarget(TriangleBatch target) { this.target = target; for (int i = 0; i < RenderState.RS_MAX_STATE; i++) { RenderState renderState = this.target.getRenderState(i); if (renderState != null) { setRenderState(renderState); } } setCullMode(target.getLocalCullMode()); setLightCombineMode(target.getLocalLightCombineMode()); setRenderQueueMode(target.getLocalRenderQueueMode()); setTextureCombineMode(target.getLocalTextureCombineMode()); setZOrder(target.getZOrder()); }
public SharedBatch(TriangleBatch target) { this(); if ((target.getType() & SceneElement.SHAREDBATCH) != 0) { setTarget(((SharedBatch) target).getTarget()); } else { setTarget(target); } }
@Override public ColorRGBA getDefaultColor() { if (defaultColor == null) { return target.getDefaultColor(); } else { return defaultColor; } }
public void read(JMEImporter e) throws IOException { InputCapsule capsule = e.getCapsule(this); target = (TriangleBatch) capsule.readSavable("target", null); if (target != null && target.parentGeom == null) { if (motherMesh == null) { motherMesh = new TriMesh("mother"); motherMesh.clearBatches(); } motherMesh.addBatch(target); } super.read(e); }
/** * draw renders the target mesh, at the translation, rotation and scale of this shared mesh. * * @see com.jme.scene.Spatial#draw(com.jme.renderer.Renderer) */ public void draw(Renderer r) { // if this batch is not enabled, don't bother processing it. if (!isEnabled()) { return; } if (!r.isProcessingQueue()) { if (r.checkAndAdd(this)) return; } target.parentGeom.getWorldTranslation().set(parentGeom.getWorldTranslation()); target.parentGeom.getWorldRotation().set(parentGeom.getWorldRotation()); target.parentGeom.getWorldScale().set(parentGeom.getWorldScale()); target.setDefaultColor(getDefaultColor()); System.arraycopy(this.states, 0, target.states, 0, states.length); r.draw(target); }
public void write(JMEExporter e) throws IOException { OutputCapsule capsule = e.getCapsule(this); capsule.write(target, "target", null); super.write(e); }
/** returns the model bound of the target object. */ public BoundingVolume getModelBound() { return target.getModelBound(); }
/** * <code>updateBound</code> recalculates the bounding object assigned to the geometry. This resets * it parameters to adjust for any changes to the vertex information. */ public void updateModelBound() { if (target.getModelBound() != null) { target.updateModelBound(); updateWorldBound(); } }
/** * <code>setModelBound</code> sets the bounding object for this geometry. * * @param modelBound the bounding object for this geometry. */ public void setModelBound(BoundingVolume modelBound) { target.setModelBound(modelBound); }
/** * <code>getColorBuffer</code> retrieves the float buffer that contains the target geometry's * color information. * * @return the buffer that contains the target geometry's color information. */ public FloatBuffer getColorBuffer() { return target.getColorBuffer(); }
/** <code>getVBOInfo</code> returns the target mesh's vbo info. */ public VBOInfo getVBOInfo() { return target.getVBOInfo(); }
/** * <code>getTextureAsFloatBuffer</code> retrieves the texture buffer of a given texture unit. * * @param textureUnit the texture unit to check. * @return the texture coordinates at the given texture unit. */ public FloatBuffer getTextureBuffer(int textureUnit) { return target.getTextureBuffer(textureUnit); }
/** * <code>getTextureBuffers</code> retrieves the target geometry's texture information contained * within a float buffer array. * * @return the float buffers that contain the target geometry's texture information. */ public ArrayList<FloatBuffer> getTextureBuffers() { return target.getTextureBuffers(); }
public void getTriangle(int index, int[] storage) { target.getTriangle(index, storage); }
/** * Returns the number of triangles the target TriMesh contains. * * @return The current number of triangles. */ public int getTriangleCount() { return target.getTriangleCount(); }
public int getVertexCount() { return target.getVertexCount(); }
/** * <code>getIndexAsBuffer</code> retrieves the target's indices array as an <code>IntBuffer</code> * . * * @return the indices array as an <code>IntBuffer</code>. */ public IntBuffer getIndexBuffer() { return target.getIndexBuffer(); }
@Override public FloatBuffer getBinormalBuffer() { return target.getBinormalBuffer(); }
@Override public void lockMeshes(Renderer r) { target.lockMeshes(r); }
/** * <code>getVertexBuffer</code> returns the float buffer that contains the target geometry's * vertex information. * * @return the float buffer that contains the target geometry's vertex information. */ public FloatBuffer getVertexBuffer() { return target.getVertexBuffer(); }
@Override public FloatBuffer getTangentBuffer() { return target.getTangentBuffer(); }
/** * <code>getNormalBuffer</code> retrieves the target geometry's normal information as a float * buffer. * * @return the float buffer containing the target geometry information. */ public FloatBuffer getNormalBuffer() { return target.getNormalBuffer(); }