dzzd
Interface IMesh3D

All Superinterfaces:
IProgress, 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.
 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.
 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.
 IRenderMode getRenderMode()
          Gets the RenderMode interface for this Mesh3D.
 boolean getSolid()
          Gets the solid flag.
 void removeDuplicateVertice()
          Remove duplicated vertice.
 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 setSolid(boolean flag)
          Sets the solid flag.
 
Methods inherited from interface dzzd.IScene3DObject
addChild, getAxis3D, getCenter, getFirstChild, getInstanceCopy, getNextChild, getParent, getPivot, getPosition, getRotation, getScene3DObjectAnimator, getSphereBox, moveAsSolidSphere, pauseScene3DObjectAnimator, playScene3DObjectAnimator, removeChild, resumeScene3DObjectAnimator, setParent, setScene3DObjectAnimator, setSphereBox, startScene3DObjectAnimator, startScene3DObjectAnimator, startScene3DObjectAnimator, stopScene3DObjectAnimator, zoom
 
Methods inherited from interface dzzd.ISceneObject
getId, getName, getScene3D, setId, setName
 
Methods inherited from interface dzzd.IProgress
getCurrentState, getNextState, getProgress, isStateReached, setProgress
 

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

getSolid

public boolean getSolid()
Gets the solid flag.
solid flag is used by physic engine to determine if a Mesh3D should be tested while performing collisions.

Returns:
true if this Mesh3D should be considered as solid

setSolid

public void setSolid(boolean flag)
Sets the solid flag.
solid flag is used by physic engine to determine if a Mesh3D should be tested while performing collisions.

Parameters:
flag - set true if this Mesh3D should be considered as solid

flipNormals

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


getRenderMode

public IRenderMode getRenderMode()
Gets the RenderMode interface for this Mesh3D.
RenderMode is used to enable/disable rendering features : lighting,texture,mipmapping.

Returns:
RenderMode interface to control this Mesh3D rendering.

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


removeDuplicateVertice

public void removeDuplicateVertice()
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();


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