net.dzzd.access
Interface IMesh3D

All Superinterfaces:
IMonitoredSceneObject, IRender3DMode, IScene2DObject, IScene3DObject, ISceneObject

public interface IMesh3D
extends IScene3DObject

Used for accessing to a Mesh3D.

Since:
1.0
Version:
1.0, 01/01/04
Author:
Bruno Augier
See Also:
IFace3D, IVertex3D, IMesh3DGenerator

Method Summary
 void build()
          Build this Mesh3D.
 void buildFaceId()
          Build id for all Face3D of this Mesh3D.
 void buildFacesNormals()
          Build Vertex3D and Face3D normals for this Mesh3D.
 void buildMesh3DOctree()
          Build an internal Mesh3DOctree.
 void buildSphereBoxAndCenter()
          Build this Mesh3D spherebox.
 void buildVertexId()
          Build id for all Vertex3D of this Mesh3D.
 void flipNormals()
          Flip all Face3D normal by reversing vertices order.
 boolean getCastShadow()
          Gets castShadowFlag flag
if set to true and renderer is able to render shadow this object will be used as a Shadow caster
 IFace3D getFace3D(int num)
          Gets a Face3D of this Mesh3D.
 IFace3D[] getFaces3D()
          Gets Face3D array used by this mesh.
 IMesh3DCollisionGenerator getMesh3DCollisionGenerator()
          Gets IMesh3DCollisionGenerator for this Mesh3D.
 IMesh3DOctree getMesh3DOctree()
          Gets Mesh3DOctree of this Mesh3D
 IMesh3DViewGenerator getMesh3DViewGenerator()
          Gets IMesh3DViewGenerator for this Mesh3D.
 int getNbFace3D()
          Gets number of Face3D used by this Mesh3D.
 int getNbVertex3D()
          Gets number of Vertex3D used by this Mesh3D.
 boolean getRecvShadow()
          Gets recvShadowFlag flag
if this flag is set to true and renderer is able to render shadow this object will be used as a Shadow recevier
 IVertex3D[] getVertex3D()
          Gets Vertex3D array used by this mesh.
 void removeDuplicateVertices()
          Remove duplicated vertice.
 void setCastShadow(boolean castShadowFlag)
          Sets castShadowFlag flag
if set to true and renderer is able to render shadow this object will be used as a Shadow caster
 void setMaterial(IMaterial material)
          Sets this Mesh3D material.
 void setMesh3DCollisionGenerator(IMesh3DCollisionGenerator collisionGenerator)
          Sets IMesh3DCollisionGenerator for this Mesh3D.
 void setMesh3DViewGenerator(IMesh3DViewGenerator viewGenerator)
          Sets IMesh3DViewGenerator for this Mesh3D.
 void setRecvShadow(boolean recvShadowFlag)
          Sets recvShadowFlag flag
if this flag is set to true and renderer is able to render shadow this object will be used as a Shadow recevier
 
Methods inherited from interface net.dzzd.access.IScene3DObject
addChild, getAxis3D, getCenter, getClone, getFirstChild, getNextChild, getParent, getPivot, getPosition, getRotation, getScene3D, getScene3DObjectAnimator, getSphereBox, getZoom, isActive, isSolid, isVisible, loopAtScene3DObjectAnimator, pauseScene3DObjectAnimator, playScene3DObjectAnimator, removeChild, resumeScene3DObjectAnimator, setActive, setAxis3DToWorld, setParent, setPoint3DToWorld, setScene3DObjectAnimator, setSolid, setSphereBox, setVisible, startScene3DObjectAnimator, startScene3DObjectAnimator, startScene3DObjectAnimator, stopScene3DObjectAnimator, zoom
 
Methods inherited from interface net.dzzd.access.ISceneObject
clearProperties, copy, getBuild, getId, getName, getProperty, getScene, setBuild, setId, setName, setProperty
 
Methods inherited from interface net.dzzd.access.IMonitoredSceneObject
copy
 
Methods inherited from interface net.dzzd.access.IRender3DMode
disableRender3DMode, enableRender3DMode, getRender3DMode, getRender3DModeFlags, setRender3DModeFlags
 

Method Detail

getNbFace3D

public int getNbFace3D()
Gets number of Face3D used by this Mesh3D.
for a generated Mesh3D this also include faces used by LOD.

Returns:
all Face3D used by this Mesh3D

getNbVertex3D

public int getNbVertex3D()
Gets number of Vertex3D used by this Mesh3D.
for a generated Mesh3D this also include vertices used by LOD.

Returns:
all Vertex3D used by this Mesh3D

getFace3D

public IFace3D getFace3D(int num)
Gets a Face3D of this Mesh3D.
for a generated Mesh3D this also include faces used by LOD.

Parameters:
num - face id to return
Returns:
Face3D having the given

getFaces3D

public IFace3D[] getFaces3D()
Gets Face3D array used by this mesh.
for a generated Mesh3D this array also include faces used by LOD.

Returns:
number of Face3D used by this Mesh3D

getVertex3D

public IVertex3D[] getVertex3D()
Gets Vertex3D array used by this mesh.
for a generated Mesh3D this array also include vertices used by LOD.

Returns:
number of Vertex3D used by this Mesh3D

flipNormals

public void flipNormals()
Flip all Face3D normal by reversing vertices order.


getMesh3DViewGenerator

public IMesh3DViewGenerator getMesh3DViewGenerator()
Gets IMesh3DViewGenerator for this Mesh3D.
IMesh3DViewGenerator are able to construct a (LOD) Face3DList for a given view point.

Returns:
current Mesh3DViewGenerator or null if none.

setMesh3DViewGenerator

public void setMesh3DViewGenerator(IMesh3DViewGenerator viewGenerator)
Sets IMesh3DViewGenerator for this Mesh3D.
IMesh3DViewGenerator are able to construct a (LOD) Face3DList for a given view point.

Parameters:
viewGenerator - new Mesh3DViewGenerator or null to remove.

getMesh3DCollisionGenerator

public IMesh3DCollisionGenerator getMesh3DCollisionGenerator()
Gets IMesh3DCollisionGenerator for this Mesh3D.
IMesh3DCollisionGenerator are able to construct a (LOD) Face3DList for collision tests.

Returns:
current Mesh3DCollisionGenerator or null if none.

setMesh3DCollisionGenerator

public void setMesh3DCollisionGenerator(IMesh3DCollisionGenerator collisionGenerator)
Sets IMesh3DCollisionGenerator for this Mesh3D.
IMesh3DCollisionGenerator are able to construct a (LOD) Face3DList for collision tests.

Parameters:
collisionGenerator - new Mesh3DCollisionGenerator or null to remove.

buildMesh3DOctree

public void buildMesh3DOctree()
Build an internal Mesh3DOctree.
Mesh3DOctree are useful on complex Mesh3D to improve rendering and collision detections performance.


buildFacesNormals

public void buildFacesNormals()
Build Vertex3D and Face3D normals for this Mesh3D. vertex normal are computed using face plane normal and smoothingGroups. this method will also remove invalid vertex (unused) and invalid face (not drawable). you may have call removeDuplicatedVertex once to avoid smoothing groups error before returning this method will call buildVertexId if some vertices have been removed before returning this method will call buildFacesId if some faces have been removed


removeDuplicateVertices

public void removeDuplicateVertices()
Remove duplicated vertice.
vertice with exacly the same position are removed.


buildFaceId

public void buildFaceId()
Build id for all Face3D of this Mesh3D.


buildVertexId

public void buildVertexId()
Build id for all Vertex3D of this Mesh3D.


build

public void build()
Build this Mesh3D.
Call all build function in the following oreder:

this.buildVertexId();
this.buildFaceId();
this.buildFacesNormals();
this.buildSphereBoxAndCenter();

Specified by:
build in interface ISceneObject

buildSphereBoxAndCenter

public void buildSphereBoxAndCenter()
Build this Mesh3D spherebox.
compute and update internal sphere box radius and Mesh3D center.


setMaterial

public void setMaterial(IMaterial material)
Sets this Mesh3D material.

Parameters:
material - new material or null to remove

setCastShadow

public void setCastShadow(boolean castShadowFlag)
Sets castShadowFlag flag
if set to true and renderer is able to render shadow this object will be used as a Shadow caster

Parameters:
castShadowFlag - true if this Mesh3D may cast shadow

getCastShadow

public boolean getCastShadow()
Gets castShadowFlag flag
if set to true and renderer is able to render shadow this object will be used as a Shadow caster

Returns:
true if this Mesh3D may cast shadow

setRecvShadow

public void setRecvShadow(boolean recvShadowFlag)
Sets recvShadowFlag flag
if this flag is set to true and renderer is able to render shadow this object will be used as a Shadow recevier


getRecvShadow

public boolean getRecvShadow()
Gets recvShadowFlag flag
if this flag is set to true and renderer is able to render shadow this object will be used as a Shadow recevier

Returns:
true if this Mesh3D may received shadow

getMesh3DOctree

public IMesh3DOctree getMesh3DOctree()
Gets Mesh3DOctree of this Mesh3D

Returns:
Mesh3DOctree for this Mesh3D or null if none