crystalspace.jbind.impl.engine.mesh
Class csMeshWrapper

java.lang.Object
  extended bycrystalspace.jbind.impl.csNativeObject
      extended bycrystalspace.jbind.impl.csutil.scf.csBase
          extended bycrystalspace.jbind.impl.engine.mesh.csMeshWrapper
All Implemented Interfaces:
iBase, iMeshWrapper, iPointer

public class csMeshWrapper
extends csBase
implements iMeshWrapper

Author:
qan To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments

Field Summary
 
Fields inherited from class crystalspace.jbind.impl.csNativeObject
ImplFactory, nPointer
 
Constructor Summary
csMeshWrapper(iPointer nPointer)
           
 
Method Summary
 void addMeshToStaticLOD(int lod, iMeshWrapper mesh)
          Set a given child mesh at a specific lod level.
 void castHardwareShadow(boolean castShadow)
          Enable/disable hardware based shadows alltogheter.
 iLODControl createStaticLOD()
          Create a LOD control for this mesh wrapper.
 void deferUpdateLighting(int flags, int num_lights)
          Update lighting as soon as the object becomes visible.
 void destroyStaticLOD()
          Destroy the LOD control for this mesh.
 void draw(iRenderView rview)
          Draw this mesh.
 void drawLight(iRenderView rview, iLight light)
          Draws the diffuse light mesh object.
 void drawShadow(iRenderView rview, iLight light)
          Draws the shadow buffer pass.
 iMeshList getChildren()
          Get all the children of this mesh object.
 boolean getDrawAfterShadow()
          Get if the meshobject is rendered after all fancy HW-shadow-stuff.
 iMeshDrawCallback getDrawCallback(int idx)
          Get the specified draw callback.
 int getDrawCallbackCount()
          Get the number of draw callbacks.
 iMeshFactoryWrapper getFactory()
          Get the parent factory.
 csFlags getFlags()
          Get flags for this meshwrapper.
static java.lang.Class getInterfaceClass()
           
static java.lang.String getInterfaceName()
           
static int getInterfaceVersion()
           
 iLightingInfo getLightingInfo()
          Get the optional lighting information that is implemented by this mesh object.
 iMeshObject getMeshObject()
          Get the iMeshObject.
 iMovable getMovable()
          Get the movable instance for this object.
 java.lang.String getName()
          Return the name of the interface
 iMeshWrapper getParentContainer()
          Get the parent of this mesh.
 iPortalContainer getPortalContainer()
          If this mesh is a portal container you can use GetPortalContainer() to get the portal container interface.
 void getRadius(csVector3 rad, csVector3 cent)
          Get the radius of this mesh and all its children.
 csRenderMesh[] getRenderMeshes(int n)
          Returns the render mesh.
 long getRenderPriority()
          Get the render priority.
 float getScreenBoundingBox(iCamera camera, csBox2 sbox, csBox3 cbox)
          Get a very inaccurate bounding box of the object in screen space.
 iShadowReceiver getShadowReceiver()
          Get the optional shadow receiver that is implemented by this mesh object.
 iLODControl getStaticLOD()
          Get the LOD control for this mesh.
 void getTransformedBoundingBox(csReversibleTransform trans, csBox3 cbox)
          Get the bounding box of this object after applying a transformation to it.
 int getVersion()
          Return the version of the interface
 int getVisibilityNumber()
          Optimization to avoid having to do SCF_QUERY_INTERFACE for iVisibilityObject.
 void getWorldBoundingBox(csBox3 cbox)
          Get the bounding box of this object in world space.
 int getZBufMode()
          Get the Z-buf drawing mode.
 void hardTransform(csReversibleTransform t)
          Do a hard transform of this object.
 boolean hitBeam(csVector3 start, csVector3 end, csVector3 isect, float pr)
          Check if this object is hit by this world space vector.
 boolean hitBeamBBox(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)
          Check if this object is hit by this object space vector.
 boolean hitBeamObject(csVector3 start, csVector3 end, csVector3 isect, float pr, int polygon_idx)
          Check if this object is hit by this object space vector.
 boolean hitBeamOutline(csVector3 start, csVector3 end, csVector3 isect, float pr)
          Check if this object is hit by this object space vector.
static void initSCF()
           
protected  boolean isNativePointerValidSafe()
           
 void placeMesh()
          This routine will find out in which sectors a mesh object is positioned.
 iObject queryObject()
          Get the iObject for this mesh object.
 void removeDrawCallback(iMeshDrawCallback cb)
          Remove a draw callback.
 void removeMeshFromStaticLOD(iMeshWrapper mesh)
          Remove a child mesh from all lod levels.
 void setDrawAfterShadow(boolean drawAfter)
          Sets so that the meshobject is rendered after all fancy HW-shadow-stuff.
 void setDrawCallback(iMeshDrawCallback cb)
          Set a callback which is called just before the object is drawn.
 void setFactory(iMeshFactoryWrapper factory)
          Set the parent factory (this only sets a pointer).
 void setMeshObject(iMeshObject obj)
          Set the iMeshObject.
 void setParentContainer(iMeshWrapper obj)
          Set the parent of this mesh.
 void setRenderPriority(long rp)
          The renderer will render all objects in a sector based on this number.
 void setZBufMode(int mode)
          Set the Z-buf drawing mode to use for this object.
 void updateLighting(iLight[] lights, int num_lights)
          Light object according to the given array of lights (i.e.
 
Methods inherited from class crystalspace.jbind.impl.csutil.scf.csBase
decRef, equals, finalize, getRefCount, incRef, nDelete, queryInterface, queryInterfaceSafe
 
Methods inherited from class crystalspace.jbind.impl.csNativeObject
changePointer, getPointer, getPointer, getPointerArray, hashCode, isMemoryOwner, isNativePointerValid, isNativePointerValidSafe, newNativeObject, setMemoryOwner, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getRefCount, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Constructor Detail

csMeshWrapper

public csMeshWrapper(iPointer nPointer)
Parameters:
nPointer -
Method Detail

getVersion

public int getVersion()
Description copied from interface: iBase
Return the version of the interface

Specified by:
getVersion in interface iBase
Specified by:
getVersion in class csBase

getName

public java.lang.String getName()
Description copied from interface: iBase
Return the name of the interface

Specified by:
getName in interface iBase
Specified by:
getName in class csBase

initSCF

public static void initSCF()

getMeshObject

public iMeshObject getMeshObject()
Description copied from interface: iMeshWrapper
Get the iMeshObject.

Specified by:
getMeshObject in interface iMeshWrapper
Returns:

getInterfaceVersion

public static int getInterfaceVersion()

getInterfaceName

public static java.lang.String getInterfaceName()

getInterfaceClass

public static java.lang.Class getInterfaceClass()

isNativePointerValidSafe

protected boolean isNativePointerValidSafe()

addMeshToStaticLOD

public void addMeshToStaticLOD(int lod,
                               iMeshWrapper mesh)
Description copied from interface: iMeshWrapper
Set a given child mesh at a specific lod level.

Specified by:
addMeshToStaticLOD in interface iMeshWrapper
Parameters:
lod -
mesh -
See Also:
iMeshWrapper.addMeshToStaticLOD(int, crystalspace.jbind.interfaces.iengine.mesh.iMeshWrapper)

castHardwareShadow

public void castHardwareShadow(boolean castShadow)
Description copied from interface: iMeshWrapper
Enable/disable hardware based shadows alltogheter.

Specified by:
castHardwareShadow in interface iMeshWrapper
Parameters:
castShadow -
See Also:
iMeshWrapper.castHardwareShadow(boolean)

createStaticLOD

public iLODControl createStaticLOD()
Description copied from interface: iMeshWrapper
Create a LOD control for this mesh wrapper.

Specified by:
createStaticLOD in interface iMeshWrapper
Returns:
See Also:
iMeshWrapper.createStaticLOD()

deferUpdateLighting

public void deferUpdateLighting(int flags,
                                int num_lights)
Description copied from interface: iMeshWrapper
Update lighting as soon as the object becomes visible.

Specified by:
deferUpdateLighting in interface iMeshWrapper
Parameters:
flags -
num_lights -
See Also:
iMeshWrapper.deferUpdateLighting(int, int)

destroyStaticLOD

public void destroyStaticLOD()
Description copied from interface: iMeshWrapper
Destroy the LOD control for this mesh.

Specified by:
destroyStaticLOD in interface iMeshWrapper
See Also:
iMeshWrapper.destroyStaticLOD()

draw

public void draw(iRenderView rview)
Description copied from interface: iMeshWrapper
Draw this mesh.

Specified by:
draw in interface iMeshWrapper
Parameters:
rview -
See Also:
iMeshWrapper.draw(crystalspace.jbind.interfaces.iengine.rview.iRenderView)

drawLight

public void drawLight(iRenderView rview,
                      iLight light)
Description copied from interface: iMeshWrapper
Draws the diffuse light mesh object.

Specified by:
drawLight in interface iMeshWrapper
Parameters:
rview -
light -
See Also:
iMeshWrapper.drawLight(crystalspace.jbind.interfaces.iengine.rview.iRenderView, crystalspace.jbind.interfaces.iengine.light.iLight)

drawShadow

public void drawShadow(iRenderView rview,
                       iLight light)
Description copied from interface: iMeshWrapper
Draws the shadow buffer pass.

Specified by:
drawShadow in interface iMeshWrapper
Parameters:
rview -
light -
See Also:
iMeshWrapper.drawShadow(crystalspace.jbind.interfaces.iengine.rview.iRenderView, crystalspace.jbind.interfaces.iengine.light.iLight)

getChildren

public iMeshList getChildren()
Description copied from interface: iMeshWrapper
Get all the children of this mesh object.

Specified by:
getChildren in interface iMeshWrapper
Returns:
See Also:
iMeshWrapper.getChildren()

getDrawAfterShadow

public boolean getDrawAfterShadow()
Description copied from interface: iMeshWrapper
Get if the meshobject is rendered after all fancy HW-shadow-stuff.

Specified by:
getDrawAfterShadow in interface iMeshWrapper
Returns:
See Also:
iMeshWrapper.getDrawAfterShadow()

getDrawCallback

public iMeshDrawCallback getDrawCallback(int idx)
Description copied from interface: iMeshWrapper
Get the specified draw callback.

Specified by:
getDrawCallback in interface iMeshWrapper
Parameters:
idx -
Returns:
See Also:
iMeshWrapper.getDrawCallback(int)

getDrawCallbackCount

public int getDrawCallbackCount()
Description copied from interface: iMeshWrapper
Get the number of draw callbacks.

Specified by:
getDrawCallbackCount in interface iMeshWrapper
Returns:
See Also:
iMeshWrapper.getDrawCallbackCount()

getFactory

public iMeshFactoryWrapper getFactory()
Description copied from interface: iMeshWrapper
Get the parent factory.

Specified by:
getFactory in interface iMeshWrapper
Returns:
See Also:
iMeshWrapper.getFactory()

getFlags

public csFlags getFlags()
Description copied from interface: iMeshWrapper
Get flags for this meshwrapper.

Specified by:
getFlags in interface iMeshWrapper
Returns:
See Also:
iMeshWrapper.getFlags()

getLightingInfo

public iLightingInfo getLightingInfo()
Description copied from interface: iMeshWrapper
Get the optional lighting information that is implemented by this mesh object.

Specified by:
getLightingInfo in interface iMeshWrapper
Returns:
See Also:
iMeshWrapper.getLightingInfo()

getMovable

public iMovable getMovable()
Description copied from interface: iMeshWrapper
Get the movable instance for this object.

Specified by:
getMovable in interface iMeshWrapper
Returns:
See Also:
iMeshWrapper.getMovable()

getParentContainer

public iMeshWrapper getParentContainer()
Description copied from interface: iMeshWrapper
Get the parent of this mesh.

Specified by:
getParentContainer in interface iMeshWrapper
Returns:
See Also:
iMeshWrapper.getParentContainer()

getPortalContainer

public iPortalContainer getPortalContainer()
Description copied from interface: iMeshWrapper
If this mesh is a portal container you can use GetPortalContainer() to get the portal container interface.

Specified by:
getPortalContainer in interface iMeshWrapper
Returns:
See Also:
iMeshWrapper.getPortalContainer()

getRadius

public void getRadius(csVector3 rad,
                      csVector3 cent)
Description copied from interface: iMeshWrapper
Get the radius of this mesh and all its children.

Specified by:
getRadius in interface iMeshWrapper
Parameters:
rad -
cent -
See Also:
iMeshWrapper.getRadius(crystalspace.jbind.impl.csgeom.vector3.csVector3, crystalspace.jbind.impl.csgeom.vector3.csVector3)

getRenderMeshes

public csRenderMesh[] getRenderMeshes(int n)
Description copied from interface: iMeshWrapper
Returns the render mesh.

Specified by:
getRenderMeshes in interface iMeshWrapper
Parameters:
n -
Returns:
See Also:
iMeshWrapper.getRenderMeshes(int)

getRenderPriority

public long getRenderPriority()
Description copied from interface: iMeshWrapper
Get the render priority.

Specified by:
getRenderPriority in interface iMeshWrapper
Returns:
See Also:
iMeshWrapper.getRenderPriority()

getScreenBoundingBox

public float getScreenBoundingBox(iCamera camera,
                                  csBox2 sbox,
                                  csBox3 cbox)
Description copied from interface: iMeshWrapper
Get a very inaccurate bounding box of the object in screen space.

Specified by:
getScreenBoundingBox in interface iMeshWrapper
Parameters:
camera -
sbox -
cbox -
Returns:
See Also:
iMeshWrapper.getScreenBoundingBox(crystalspace.jbind.interfaces.iengine.camera.iCamera, crystalspace.jbind.impl.csgeom.box.csBox2, crystalspace.jbind.impl.csgeom.box.csBox3)

getShadowReceiver

public iShadowReceiver getShadowReceiver()
Description copied from interface: iMeshWrapper
Get the optional shadow receiver that is implemented by this mesh object.

Specified by:
getShadowReceiver in interface iMeshWrapper
Returns:
See Also:
iMeshWrapper.getShadowReceiver()

getStaticLOD

public iLODControl getStaticLOD()
Description copied from interface: iMeshWrapper
Get the LOD control for this mesh.

Specified by:
getStaticLOD in interface iMeshWrapper
Returns:
See Also:
iMeshWrapper.getStaticLOD()

getTransformedBoundingBox

public void getTransformedBoundingBox(csReversibleTransform trans,
                                      csBox3 cbox)
Description copied from interface: iMeshWrapper
Get the bounding box of this object after applying a transformation to it.

Specified by:
getTransformedBoundingBox in interface iMeshWrapper
Parameters:
trans -
cbox -
See Also:
iMeshWrapper.getTransformedBoundingBox(crystalspace.jbind.impl.csgeom.transfrm.csReversibleTransform, crystalspace.jbind.impl.csgeom.box.csBox3)

getVisibilityNumber

public int getVisibilityNumber()
Description copied from interface: iMeshWrapper
Optimization to avoid having to do SCF_QUERY_INTERFACE for iVisibilityObject.

Specified by:
getVisibilityNumber in interface iMeshWrapper
Returns:
See Also:
iMeshWrapper.getVisibilityNumber()

getWorldBoundingBox

public void getWorldBoundingBox(csBox3 cbox)
Description copied from interface: iMeshWrapper
Get the bounding box of this object in world space.

Specified by:
getWorldBoundingBox in interface iMeshWrapper
Parameters:
cbox -
See Also:
iMeshWrapper.getWorldBoundingBox(crystalspace.jbind.impl.csgeom.box.csBox3)

getZBufMode

public int getZBufMode()
Description copied from interface: iMeshWrapper
Get the Z-buf drawing mode.

Specified by:
getZBufMode in interface iMeshWrapper
Returns:
See Also:
iMeshWrapper.getZBufMode()

hardTransform

public void hardTransform(csReversibleTransform t)
Description copied from interface: iMeshWrapper
Do a hard transform of this object.

Specified by:
hardTransform in interface iMeshWrapper
Parameters:
t -
See Also:
iMeshWrapper.hardTransform(crystalspace.jbind.impl.csgeom.transfrm.csReversibleTransform)

hitBeam

public boolean hitBeam(csVector3 start,
                       csVector3 end,
                       csVector3 isect,
                       float pr)
Description copied from interface: iMeshWrapper
Check if this object is hit by this world space vector.

Specified by:
hitBeam in interface iMeshWrapper
Parameters:
start -
end -
isect -
pr -
Returns:
See Also:
iMeshWrapper.hitBeam(crystalspace.jbind.impl.csgeom.vector3.csVector3, crystalspace.jbind.impl.csgeom.vector3.csVector3, crystalspace.jbind.impl.csgeom.vector3.csVector3, float)

hitBeamBBox

public boolean hitBeamBBox(csVector3 start,
                           csVector3 end,
                           csVector3 isect,
                           float pr)
Description copied from interface: iMeshWrapper
Check if this mesh is hit by this object space vector.

Specified by:
hitBeamBBox in interface iMeshWrapper
Parameters:
start -
end -
isect -
pr -
Returns:
See Also:
iMeshWrapper.hitBeamBBox(crystalspace.jbind.impl.csgeom.vector3.csVector3, crystalspace.jbind.impl.csgeom.vector3.csVector3, crystalspace.jbind.impl.csgeom.vector3.csVector3, float)

hitBeamObject

public boolean hitBeamObject(csVector3 start,
                             csVector3 end,
                             csVector3 isect,
                             float pr,
                             int polygon_idx)
Description copied from interface: iMeshWrapper
Check if this object is hit by this object space vector.

Specified by:
hitBeamObject in interface iMeshWrapper
Parameters:
start -
end -
isect -
pr -
polygon_idx -
Returns:
See Also:
iMeshWrapper.hitBeamObject(crystalspace.jbind.impl.csgeom.vector3.csVector3, crystalspace.jbind.impl.csgeom.vector3.csVector3, crystalspace.jbind.impl.csgeom.vector3.csVector3, float, int)

hitBeamObject

public boolean hitBeamObject(csVector3 start,
                             csVector3 end,
                             csVector3 isect,
                             float pr)
Description copied from interface: iMeshWrapper
Check if this object is hit by this object space vector.

Specified by:
hitBeamObject in interface iMeshWrapper
Parameters:
start -
end -
isect -
pr -
Returns:
See Also:
iMeshWrapper.hitBeamObject(crystalspace.jbind.impl.csgeom.vector3.csVector3, crystalspace.jbind.impl.csgeom.vector3.csVector3, crystalspace.jbind.impl.csgeom.vector3.csVector3, float)

hitBeamOutline

public boolean hitBeamOutline(csVector3 start,
                              csVector3 end,
                              csVector3 isect,
                              float pr)
Description copied from interface: iMeshWrapper
Check if this object is hit by this object space vector.

Specified by:
hitBeamOutline in interface iMeshWrapper
Parameters:
start -
end -
isect -
pr -
Returns:
See Also:
iMeshWrapper.hitBeamOutline(crystalspace.jbind.impl.csgeom.vector3.csVector3, crystalspace.jbind.impl.csgeom.vector3.csVector3, crystalspace.jbind.impl.csgeom.vector3.csVector3, float)

placeMesh

public void placeMesh()
Description copied from interface: iMeshWrapper
This routine will find out in which sectors a mesh object is positioned.

Specified by:
placeMesh in interface iMeshWrapper
See Also:
iMeshWrapper.placeMesh()

queryObject

public iObject queryObject()
Description copied from interface: iMeshWrapper
Get the iObject for this mesh object.

Specified by:
queryObject in interface iMeshWrapper
Returns:
See Also:
iMeshWrapper.queryObject()

removeDrawCallback

public void removeDrawCallback(iMeshDrawCallback cb)
Description copied from interface: iMeshWrapper
Remove a draw callback.

Specified by:
removeDrawCallback in interface iMeshWrapper
Parameters:
cb -
See Also:
iMeshWrapper.removeDrawCallback(crystalspace.jbind.interfaces.iengine.mesh.iMeshDrawCallback)

removeMeshFromStaticLOD

public void removeMeshFromStaticLOD(iMeshWrapper mesh)
Description copied from interface: iMeshWrapper
Remove a child mesh from all lod levels.

Specified by:
removeMeshFromStaticLOD in interface iMeshWrapper
Parameters:
mesh -
See Also:
iMeshWrapper.removeMeshFromStaticLOD(crystalspace.jbind.interfaces.iengine.mesh.iMeshWrapper)

setDrawAfterShadow

public void setDrawAfterShadow(boolean drawAfter)
Description copied from interface: iMeshWrapper
Sets so that the meshobject is rendered after all fancy HW-shadow-stuff.

Specified by:
setDrawAfterShadow in interface iMeshWrapper
Parameters:
drawAfter -
See Also:
iMeshWrapper.setDrawAfterShadow(boolean)

setDrawCallback

public void setDrawCallback(iMeshDrawCallback cb)
Description copied from interface: iMeshWrapper
Set a callback which is called just before the object is drawn.

Specified by:
setDrawCallback in interface iMeshWrapper
Parameters:
cb -
See Also:
iMeshWrapper.setDrawCallback(crystalspace.jbind.interfaces.iengine.mesh.iMeshDrawCallback)

setFactory

public void setFactory(iMeshFactoryWrapper factory)
Description copied from interface: iMeshWrapper
Set the parent factory (this only sets a pointer).

Specified by:
setFactory in interface iMeshWrapper
Parameters:
factory -
See Also:
iMeshWrapper.setFactory(crystalspace.jbind.interfaces.iengine.mesh.iMeshFactoryWrapper)

setMeshObject

public void setMeshObject(iMeshObject obj)
Description copied from interface: iMeshWrapper
Set the iMeshObject.

Specified by:
setMeshObject in interface iMeshWrapper
Parameters:
obj -
See Also:
iMeshWrapper.setMeshObject(crystalspace.jbind.interfaces.imesh.object.iMeshObject)

setParentContainer

public void setParentContainer(iMeshWrapper obj)
Description copied from interface: iMeshWrapper
Set the parent of this mesh.

Specified by:
setParentContainer in interface iMeshWrapper
Parameters:
obj -
See Also:
iMeshWrapper.setParentContainer(crystalspace.jbind.interfaces.iengine.mesh.iMeshWrapper)

setRenderPriority

public void setRenderPriority(long rp)
Description copied from interface: iMeshWrapper
The renderer will render all objects in a sector based on this number.

Specified by:
setRenderPriority in interface iMeshWrapper
Parameters:
rp -
See Also:
iMeshWrapper.setRenderPriority(long)

setZBufMode

public void setZBufMode(int mode)
Description copied from interface: iMeshWrapper
Set the Z-buf drawing mode to use for this object.

Specified by:
setZBufMode in interface iMeshWrapper
Parameters:
mode -
See Also:
iMeshWrapper.setZBufMode(int)

updateLighting

public void updateLighting(iLight[] lights,
                           int num_lights)
Description copied from interface: iMeshWrapper
Light object according to the given array of lights (i.e.

Specified by:
updateLighting in interface iMeshWrapper
Parameters:
lights -
num_lights -
See Also:
iMeshWrapper.updateLighting(crystalspace.jbind.interfaces.iengine.light.iLight[], int)