crystalspace.jbind.interfaces.imesh.object
Interface iMeshObject
- All Superinterfaces:
- iBase, iPointer
- All Known Implementing Classes:
- csMeshObject
- public interface iMeshObject
- extends iBase
This is a general mesh object that the engine can interact with. The mesh
object only manages its shape, texture etc. but *not* its position, sector
or similar information. For this reason, a mesh object can only be used in
the engine if a hook object is created for it in the engine that does the
required management. The hook object is called mesh wrapper.
- Author:
- Java wrapper - Quentin Anciaux, c++ version -
http://crystal.sourceforge.net/docs/online/devapi/structiMeshObject.php
Method Summary |
boolean |
draw(iRenderView rview,
iMovable movable,
int zbufMode)
Draw this mesh object. |
boolean |
drawTest(iRenderView rview,
iMovable movable)
First part of Draw. |
boolean |
getColor(csColor color)
Get the base color of the mesh. |
iMeshObjectFactory |
getFactory()
Get the reference to the factory that created this mesh object.
|
iBase |
getLogicalParent()
Get the logical parent for this mesh object. |
iMaterialWrapper |
getMaterialWrapper()
Get the material of the mesh. |
iObjectModel |
getObjectModel()
Get the generic interface describing the geometry of this mesh. |
csRenderMesh |
getRenderMeshes(int num)
For NR: @@ document me!!! |
iMeshObjectDrawCallback |
getVisibleCallback()
Get the current visible callback. |
void |
hardTransform(csReversibleTransform t)
Do a hard transform of this object. |
boolean |
hitBeamObject(csVector3 start,
csVector3 end,
csVector3 isect,
float pr)
Check if this mesh is hit by this object space vector. |
boolean |
hitBeamObject(csVector3 start,
csVector3 end,
csVector3 isect,
float pr,
int polygon_idx)
Check if this mesh is hit by this object space vector. |
boolean |
hitBeamOutline(csVector3 start,
csVector3 end,
csVector3 isect,
float pr)
Check if this mesh is hit by this object space vector. |
void |
invalidateMaterialHandles()
Material changed. |
void |
nextFrame(int current_time,
csVector3 pos)
Control animation of this object. |
void |
positionChild(iMeshObject child,
int current_time)
The engine asks this mesh object to place one of his hierarchical
children. |
boolean |
setColor(csColor color)
Set the base color of the mesh. |
void |
setLogicalParent(iBase logparent)
Set a reference to some logical parent in the context that holds the mesh
objects. |
boolean |
setMaterialWrapper(iMaterialWrapper material)
Set the material of the mesh. |
void |
setVisibleCallback(iMeshObjectDrawCallback cb)
Register a callback to the mesh object which will be called from within
Draw(); if the mesh object thinks that the object is really visible.
|
boolean |
supportsHardTransform()
Return true if HardTransform is supported for this mesh object type.
|
void |
updateLighting(iLight[] lights,
iMovable movable)
Update lighting for the object on the given position. |
draw
public boolean draw(iRenderView rview,
iMovable movable,
int zbufMode)
- Draw this mesh object. Returns false if not visible. If this function
returns true it does not mean that the object is invisible. It just means
that this MeshObject thinks that the object was probably visible.
DrawTest(); will be called before this function (possibly with an
UpdateLighting(); in between. Implemented in csPortalContainer,
csMeshObject, csShadow, csSpider, csBallMeshObject, csBCTerrObject,
csEmitMeshObject, csGenmeshMeshObject, csHazeMeshObject,
csLightningMeshObject, csNullmeshMeshObject, csParticleSystem,
csNewParticleSystem, csParticlesObject, csSprite2DMeshObject,
csSprite3DMeshObject, csSpriteCal3DMeshObject, csStarsMeshObject,
csChunkLodTerrainObject, and csBigTerrainObject.
- Parameters:
rview
- movable
- zbufMode
-
- Returns:
drawTest
public boolean drawTest(iRenderView rview,
iMovable movable)
- First part of Draw. The engine will call this DrawTest(); before calling
Draw(); so DrawTest(); can (if needed); remember computationally expensive
data. If DrawTest(); returns false the engine will not call Draw();.
Possibly UpdateLighting(); will be called in between DrawTest(); and
Draw();. Implemented in csPortalContainer, csMeshObject, csShadow,
csSpider, csBallMeshObject, csBCTerrObject, csGenmeshMeshObject,
csHazeMeshObject, csLightningMeshObject, csNullmeshMeshObject,
csParticleSystem, csNewParticleSystem, csParticlesObject,
csSprite2DMeshObject, csSprite3DMeshObject, csSpriteCal3DMeshObject,
csStarsMeshObject, csChunkLodTerrainObject, and csBigTerrainObject.
- Parameters:
rview
- movable
-
- Returns:
getColor
public boolean getColor(csColor color)
- Get the base color of the mesh. Will return false if not supported.
Implemented in csMeshObject, csShadow, csSpider, csBallMeshObject,
csBCTerrObject, csGenmeshMeshObject, csHazeMeshObject,
csLightningMeshObject, csNullmeshMeshObject, csParticleSystem,
csNewParticleSystem, csParticlesObject, csSprite2DMeshObject,
csSprite3DMeshObject, csSpriteCal3DMeshObject, csStarsMeshObject,
csChunkLodTerrainObject, and csBigTerrainObject.
- Parameters:
color
-
- Returns:
getFactory
public iMeshObjectFactory getFactory()
- Get the reference to the factory that created this mesh object.
Implemented in csPortalContainer, csMeshObject, csShadow, csSpider,
csBallMeshObject, csBCTerrObject, csGenmeshMeshObject, csHazeMeshObject,
csLightningMeshObject, csNullmeshMeshObject, csParticleSystem,
csNewParticleSystem, csParticlesObject, csSprite2DMeshObject,
csSprite3DMeshObject, csSpriteCal3DMeshObject, csStarsMeshObject,
csChunkLodTerrainObject, and csBigTerrainObject.
- Returns:
getLogicalParent
public iBase getLogicalParent()
- Get the logical parent for this mesh object. See SetLogicalParent(); for
more information. Implemented in csMeshObject, csShadow, csSpider,
csBallMeshObject, csBCTerrObject, csGenmeshMeshObject, csHazeMeshObject,
csLightningMeshObject, csNullmeshMeshObject, csParticleSystem,
csParticlesObject, csSprite2DMeshObject, csSprite3DMeshObject,
csSpriteCal3DMeshObject, csStarsMeshObject, csChunkLodTerrainObject, and
csBigTerrainObject.
- Returns:
getMaterialWrapper
public iMaterialWrapper getMaterialWrapper()
- Get the material of the mesh. If not supported this will return 0
Implemented in csMeshObject, csShadow, csSpider, csBallMeshObject,
csBCTerrObject, csGenmeshMeshObject, csHazeMeshObject,
csLightningMeshObject, csNullmeshMeshObject, csParticleSystem,
csNewParticleSystem, csParticlesObject, csSprite2DMeshObject,
csSprite3DMeshObject, csSpriteCal3DMeshObject, csStarsMeshObject,
csChunkLodTerrainObject, and csBigTerrainObject.
- Returns:
getObjectModel
public iObjectModel getObjectModel()
- Get the generic interface describing the geometry of this mesh. If the
factory supports this you should preferably use the object model from the
factory instead. Implemented in csMeshObject, csShadow, csSpider,
csBallMeshObject, csBCTerrObject, csGenmeshMeshObject, csHazeMeshObject,
csLightningMeshObject, csNullmeshMeshObject, csParticleSystem,
csParticlesObject, csSprite2DMeshObject, csSprite3DMeshObject,
csSpriteCal3DMeshObject, csStarsMeshObject, csChunkLodTerrainObject, and
csBigTerrainObject.
- Returns:
getRenderMeshes
public csRenderMesh getRenderMeshes(int num)
- For NR: @@ document me!!! Implemented in csPortalContainer, csMeshObject,
csShadow, csSpider, csBallMeshObject, csBCTerrObject, csGenmeshMeshObject,
csHazeMeshObject, csLightningMeshObject, csNullmeshMeshObject,
csParticleSystem, csNewParticleSystem, csParticlesObject,
csSprite2DMeshObject, csSprite3DMeshObject, csSpriteCal3DMeshObject,
csStarsMeshObject, csChunkLodTerrainObject, and csBigTerrainObject.
- Parameters:
num
-
- Returns:
getVisibleCallback
public iMeshObjectDrawCallback getVisibleCallback()
- Get the current visible callback. Implemented in csMeshObject, csShadow,
csSpider, csBallMeshObject, csBCTerrObject, csGenmeshMeshObject,
csHazeMeshObject, csLightningMeshObject, csNullmeshMeshObject,
csParticleSystem, csParticlesObject, csSprite2DMeshObject,
csSprite3DMeshObject, csSpriteCal3DMeshObject, csStarsMeshObject,
csChunkLodTerrainObject, and csBigTerrainObject.
- Returns:
hardTransform
public void hardTransform(csReversibleTransform t)
- Do a hard transform of this object. This transformation and the original
coordinates are not remembered but the object space coordinates are
directly computed (world space coordinates are set to the object space
coordinates by this routine);. Note that some implementations of mesh
objects will not change the orientation of the object but only the
position. Implemented in csPortalContainer, csMeshObject, csShadow,
csSpider, csBallMeshObject, csBCTerrObject, csEmitMeshObject,
csExploMeshObject, csFireMeshObject, csFountainMeshObject,
csGenmeshMeshObject, csHazeMeshObject, csLightningMeshObject,
csNullmeshMeshObject, csParticlesObject, csSnowMeshObject,
csSpiralMeshObject, csSprite2DMeshObject, csSprite3DMeshObject,
csSpriteCal3DMeshObject, csStarsMeshObject, csChunkLodTerrainObject, and
csBigTerrainObject.
- Parameters:
t
-
hitBeamObject
public boolean hitBeamObject(csVector3 start,
csVector3 end,
csVector3 isect,
float pr)
- Check if this mesh is hit by this object space vector. Return the
collision point in object space coordinates. This is the most detailed
version (and also the slowest);. The returned hit will be guaranteed to be
the point closest to the 'start' of the beam. If the object supports this
then an index of the hit polygon will be returned (or -1 if not supported
or no hit);. Implemented in csPortalContainer, csMeshObject, csShadow,
csSpider, csBallMeshObject, csBCTerrObject, csGenmeshMeshObject,
csHazeMeshObject, csLightningMeshObject, csNullmeshMeshObject,
csParticleSystem, csParticlesObject, csSprite2DMeshObject,
csSprite3DMeshObject, csSpriteCal3DMeshObject, csStarsMeshObject,
csChunkLodTerrainObject, and csBigTerrainObject.
- Parameters:
start
- end
- isect
- pr
-
- Returns:
hitBeamObject
public boolean hitBeamObject(csVector3 start,
csVector3 end,
csVector3 isect,
float pr,
int polygon_idx)
- Check if this mesh is hit by this object space vector. Return the
collision point in object space coordinates. This is the most detailed
version (and also the slowest);. The returned hit will be guaranteed to be
the point closest to the 'start' of the beam. If the object supports this
then an index of the hit polygon will be returned (or -1 if not supported
or no hit);. Implemented in csPortalContainer, csMeshObject, csShadow,
csSpider, csBallMeshObject, csBCTerrObject, csGenmeshMeshObject,
csHazeMeshObject, csLightningMeshObject, csNullmeshMeshObject,
csParticleSystem, csParticlesObject, csSprite2DMeshObject,
csSprite3DMeshObject, csSpriteCal3DMeshObject, csStarsMeshObject,
csChunkLodTerrainObject, and csBigTerrainObject.
- Parameters:
start
- end
- isect
- pr
- polygon_idx
-
- Returns:
hitBeamOutline
public boolean hitBeamOutline(csVector3 start,
csVector3 end,
csVector3 isect,
float pr)
- Check if this mesh is hit by this object space vector. This will do a test
based on the outline of the object. This means that it is more accurate
than HitBeamBBox();. Note that this routine will typically be faster than
HitBeamObject();. The hit may be on the front or the back of the object,
but will indicate that it iterrupts the beam. Implemented in
csPortalContainer, csMeshObject, csShadow, csSpider, csBallMeshObject,
csBCTerrObject, csGenmeshMeshObject, csHazeMeshObject,
csLightningMeshObject, csNullmeshMeshObject, csParticleSystem,
csParticlesObject, csSprite2DMeshObject, csSprite3DMeshObject,
csSpriteCal3DMeshObject, csStarsMeshObject, csChunkLodTerrainObject, and
csBigTerrainObject.
- Parameters:
start
- end
- isect
- pr
-
- Returns:
invalidateMaterialHandles
public void invalidateMaterialHandles()
- Material changed. This is an 'event' that the engine (or another party
managing materials); will send out as soon as the material handles are
changed in some way which requires the mesh object to fetch it again (i.e.
to call materialwrapper->GetMaterialHandle();); again. Implemented in
csMeshObject, csShadow, csSpider, csBallMeshObject, csBCTerrObject,
csGenmeshMeshObject, csHazeMeshObject, csLightningMeshObject,
csNullmeshMeshObject, csParticleSystem, csParticlesObject,
csSprite2DMeshObject, csSprite3DMeshObject, csSpriteCal3DMeshObject,
csStarsMeshObject, csChunkLodTerrainObject, and csBigTerrainObject.
nextFrame
public void nextFrame(int current_time,
csVector3 pos)
- Control animation of this object. Implemented in csMeshObject, csShadow,
csSpider, csBallMeshObject, csBCTerrObject, csGenmeshMeshObject,
csHazeMeshObject, csLightningMeshObject, csNullmeshMeshObject,
csParticleSystem, csNewParticleSystem, csParticlesObject,
csSprite2DMeshObject, csSprite3DMeshObject, csSpriteCal3DMeshObject,
csStarsMeshObject, csChunkLodTerrainObject, and csBigTerrainObject.
- Parameters:
current_time
- pos
-
positionChild
public void positionChild(iMeshObject child,
int current_time)
- The engine asks this mesh object to place one of his hierarchical
children. It must be placed where it should be at the given time. This
object might or might not have been drawn, so you can't use it's current
state. Implemented in csMeshObject, csShadow, csSpider, csBallMeshObject,
csBCTerrObject, csGenmeshMeshObject, csHazeMeshObject,
csLightningMeshObject, csNullmeshMeshObject, csParticleSystem,
csParticlesObject, csSprite2DMeshObject, csSprite3DMeshObject,
csSpriteCal3DMeshObject, csStarsMeshObject, csChunkLodTerrainObject, and
csBigTerrainObject.
- Parameters:
child
- current_time
-
setColor
public boolean setColor(csColor color)
- Set the base color of the mesh. This color will be added to whatever color
is set for lighting. Not all meshes need to support this. This function
will return true if it worked. Implemented in csMeshObject, csShadow,
csSpider, csBallMeshObject, csBCTerrObject, csGenmeshMeshObject,
csHazeMeshObject, csLightningMeshObject, csNullmeshMeshObject,
csParticleSystem, csNewParticleSystem, csParticlesObject,
csSprite2DMeshObject, csSprite3DMeshObject, csSpriteCal3DMeshObject,
csStarsMeshObject, csChunkLodTerrainObject, and csBigTerrainObject.
- Parameters:
color
-
- Returns:
setLogicalParent
public void setLogicalParent(iBase logparent)
- Set a reference to some logical parent in the context that holds the mesh
objects. When a mesh object is used in the context of the 3D engine then
this will be an iMeshWrapper. In case it is used in the context of the
isometric engine this will be an iIsoMeshSprite. Note that this function
should NOT increase the ref-count of the given logical parent because this
would cause a circular reference (since the logical parent already holds a
reference to this mesh object);. Implemented in csMeshObject, csShadow,
csSpider, csBallMeshObject, csBCTerrObject, csGenmeshMeshObject,
csHazeMeshObject, csLightningMeshObject, csNullmeshMeshObject,
csParticleSystem, csParticlesObject, csSprite2DMeshObject,
csSprite3DMeshObject, csSpriteCal3DMeshObject, csStarsMeshObject,
csChunkLodTerrainObject, and csBigTerrainObject.
- Parameters:
logparent
-
setMaterialWrapper
public boolean setMaterialWrapper(iMaterialWrapper material)
- Set the material of the mesh. This only works for single-material meshes.
If not supported this function will return false. Implemented in
csMeshObject, csShadow, csSpider, csBallMeshObject, csBCTerrObject,
csGenmeshMeshObject, csHazeMeshObject, csLightningMeshObject,
csNullmeshMeshObject, csParticleSystem, csNewParticleSystem,
csParticlesObject, csSprite2DMeshObject, csSprite3DMeshObject,
csSpriteCal3DMeshObject, csStarsMeshObject, csChunkLodTerrainObject, and
csBigTerrainObject.
- Parameters:
material
-
- Returns:
setVisibleCallback
public void setVisibleCallback(iMeshObjectDrawCallback cb)
- Register a callback to the mesh object which will be called from within
Draw(); if the mesh object thinks that the object is really visible.
Depending on the type of mesh object this can be very accurate or not
accurate at all. But in all cases it will certainly be called if the
object is visible. Implemented in csMeshObject, csShadow, csSpider,
csBallMeshObject, csBCTerrObject, csGenmeshMeshObject, csHazeMeshObject,
csLightningMeshObject, csNullmeshMeshObject, csParticleSystem,
csParticlesObject, csSprite2DMeshObject, csSprite3DMeshObject,
csSpriteCal3DMeshObject, csStarsMeshObject, csChunkLodTerrainObject, and
csBigTerrainObject.
- Parameters:
cb
-
supportsHardTransform
public boolean supportsHardTransform()
- Return true if HardTransform is supported for this mesh object type.
Implemented in csPortalContainer, csMeshObject, csShadow, csSpider,
csBallMeshObject, csBCTerrObject, csEmitMeshObject, csExploMeshObject,
csFireMeshObject, csFountainMeshObject, csGenmeshMeshObject,
csHazeMeshObject, csLightningMeshObject, csNullmeshMeshObject,
csParticlesObject, csSnowMeshObject, csSpiralMeshObject,
csSprite2DMeshObject, csSprite3DMeshObject, csSpriteCal3DMeshObject,
csStarsMeshObject, csChunkLodTerrainObject, and csBigTerrainObject.
- Returns:
updateLighting
public void updateLighting(iLight[] lights,
iMovable movable)
- Update lighting for the object on the given position. Implemented in
csMeshObject, csShadow, csSpider, csBallMeshObject, csBCTerrObject,
csGenmeshMeshObject, csHazeMeshObject, csLightningMeshObject,
csNullmeshMeshObject, csParticleSystem, csNewParticleSystem,
csParticlesObject, csSprite2DMeshObject, csSprite3DMeshObject,
csSpriteCal3DMeshObject, csStarsMeshObject, csChunkLodTerrainObject, and
csBigTerrainObject.
- Parameters:
lights
- movable
-