crystalspace.jbind.impl.mesh.thing
Class csThingState

java.lang.Object
  extended bycrystalspace.jbind.impl.csNativeObject
      extended bycrystalspace.jbind.impl.csutil.scf.csBase
          extended bycrystalspace.jbind.impl.mesh.thing.csThingState
All Implemented Interfaces:
iBase, iPointer, iThingState

public class csThingState
extends csBase
implements iThingState

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
csThingState(iPointer nPointer)
           
 
Method Summary
 void clearReplacedMaterials()
          Clear all replaced materials (i.e. reset to default materials from factory).
 iPolygonHandle createPolygonHandle(int polygon_idx)
          Create a polygon handle that can be used to refer to some polygon.
 iThingFactoryState getFactory()
          Get the factory.
static java.lang.Class getInterfaceClass()
           
static java.lang.String getInterfaceName()
           
static int getInterfaceVersion()
           
 int getMixMode()
          Get mix mode.
 int getMovingOption()
          Get the moving option.
 java.lang.String getName()
          Return the name of the interface
 iMaterialWrapper getPolygonMaterial(int polygon_idx)
          Get the material for the specified polygon.
 csPlane3 getPolygonWorldPlane(int polygon_idx)
          Get world space plane of the specified polygon.
 int getVersion()
          Return the version of the interface
 csVector3 getVertexW(int idx)
          Get the given vertex coordinates in world space.
 csVector3[] getVerticesW()
          Get the vertex coordinates in world space.
static void initSCF()
           
protected  boolean isNativePointerValidSafe()
           
 void prepare()
          Prepare the thing to be ready for use.
 void replaceMaterial(iMaterialWrapper oldmat, iMaterialWrapper newmat)
          Scan all polygons and replace the given material with a new material.
 void setMixMode(int mode)
          Set mix mode.
 void setMovingOption(int opt)
          Control how this thing will be moved.
 void setPolygonMaterial(csPolygonRange range, iMaterialWrapper material)
          Set the material of all polygons in the given range.
 void unprepare()
          Reset the prepare flag so that this Thing can be re-prepared.
 
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

csThingState

public csThingState(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()

getFactory

public iThingFactoryState getFactory()
Description copied from interface: iThingState
Get the factory.

Specified by:
getFactory in interface iThingState
Returns:

getInterfaceVersion

public static int getInterfaceVersion()

getInterfaceName

public static java.lang.String getInterfaceName()

getInterfaceClass

public static java.lang.Class getInterfaceClass()

isNativePointerValidSafe

protected boolean isNativePointerValidSafe()

clearReplacedMaterials

public void clearReplacedMaterials()
Description copied from interface: iThingState
Clear all replaced materials (i.e. reset to default materials from factory).

Specified by:
clearReplacedMaterials in interface iThingState
See Also:
iThingState.clearReplacedMaterials()

createPolygonHandle

public iPolygonHandle createPolygonHandle(int polygon_idx)
Description copied from interface: iThingState
Create a polygon handle that can be used to refer to some polygon. This can be useful in situations where an SCF handle is required to be able to reference a polygon. The thing will not keep a reference to this handle so you are fully responsible for it after calling this function. Parameters: polygon_idx is a polygon index. CS_POLYINDEX_LAST is NOT supported here!

Specified by:
createPolygonHandle in interface iThingState
Parameters:
polygon_idx -
Returns:
See Also:
iThingState.createPolygonHandle(int)

getMixMode

public int getMixMode()
Description copied from interface: iThingState
Get mix mode.

Specified by:
getMixMode in interface iThingState
Returns:
See Also:
iThingState.getMixMode()

getMovingOption

public int getMovingOption()
Description copied from interface: iThingState
Get the moving option.

Specified by:
getMovingOption in interface iThingState
Returns:
See Also:
iThingState.getMovingOption()

getPolygonMaterial

public iMaterialWrapper getPolygonMaterial(int polygon_idx)
Description copied from interface: iThingState
Get the material for the specified polygon. Parameters: polygon_idx is a polygon index. CS_POLYINDEX_LAST is NOT supported here!

Specified by:
getPolygonMaterial in interface iThingState
Parameters:
polygon_idx -
Returns:
See Also:
iThingState.getPolygonMaterial(int)

getPolygonWorldPlane

public csPlane3 getPolygonWorldPlane(int polygon_idx)
Description copied from interface: iThingState
Get world space plane of the specified polygon. Parameters: polygon_idx is a polygon index. CS_POLYINDEX_LAST is NOT supported here!

Specified by:
getPolygonWorldPlane in interface iThingState
Parameters:
polygon_idx -
Returns:
See Also:
iThingState.getPolygonWorldPlane(int)

getVertexW

public csVector3 getVertexW(int idx)
Description copied from interface: iThingState
Get the given vertex coordinates in world space.

Specified by:
getVertexW in interface iThingState
Parameters:
idx -
Returns:
See Also:
iThingState.getVertexW(int)

getVerticesW

public csVector3[] getVerticesW()
Description copied from interface: iThingState
Get the vertex coordinates in world space.

Specified by:
getVerticesW in interface iThingState
Returns:
See Also:
iThingState.getVerticesW()

prepare

public void prepare()
Description copied from interface: iThingState
Prepare the thing to be ready for use. Normally this doesn't have to be called as the engine will call this function automatically as soon as the object is rendered. However, to avoid the (sometimes long) setup time for an object while walking around an application can choose to call this function manually in order to increase load time but decrease the time need to setup things later.

Specified by:
prepare in interface iThingState
See Also:
iThingState.prepare()

replaceMaterial

public void replaceMaterial(iMaterialWrapper oldmat,
                            iMaterialWrapper newmat)
Description copied from interface: iThingState
Scan all polygons and replace the given material with a new material. Note that the new material MUST have the same size as the old material! If 'newmat' == 0 then the default from the factory will be used again. Note that 'oldmat' will always be compared from the factory and not from the current material the polygon has!

Specified by:
replaceMaterial in interface iThingState
Parameters:
oldmat -
newmat -
See Also:
iThingState.replaceMaterial(crystalspace.jbind.interfaces.iengine.material.iMaterialWrapper, crystalspace.jbind.interfaces.iengine.material.iMaterialWrapper)

setMixMode

public void setMixMode(int mode)
Description copied from interface: iThingState
Set mix mode.

Specified by:
setMixMode in interface iThingState
Parameters:
mode -
See Also:
iThingState.setMixMode(int)

setMovingOption

public void setMovingOption(int opt)
Description copied from interface: iThingState
Control how this thing will be moved. There are currently two options. CS_THING_MOVE_NEVER: this option is set for a thing that cannot move at all. In this case the movable will be ignored and only hard transforms can be used to move a thing with this flag. This setting is both efficient for memory (object space coordinates are equal to world space coordinates so only one array is kept) and render speed (only the camera transform is needed). This option is very useful for static geometry like walls. This option is default. CS_THING_MOVE_OCCASIONAL: this option is set for a thing that is movable but doesn't move all the time usually. Setting this option means that the world space vertices will be cached (taking up more memory that way) but the coordinates will be recalculated only at rendertime (and cached at that time). This option has the same speed efficiency as MOVE_NEVER when the object doesn't move but more memory is used as all the vertices are duplicated. Use this option for geometry that is not too big (in number of vertices) and only moves occasionally like doors of elevators. Note: it is no longer needed to manually set this option. By default things will use CS_THING_MOVE_NEVER and they will automatically switch to the slightly less efficient CS_THING_MOVE_OCCASIONAL if needed.

Specified by:
setMovingOption in interface iThingState
Parameters:
opt -
See Also:
iThingState.setMovingOption(int)

setPolygonMaterial

public void setPolygonMaterial(csPolygonRange range,
                               iMaterialWrapper material)
Description copied from interface: iThingState
Set the material of all polygons in the given range. Set the material of all polygons in the given range. This material must have the same size as the material given in the factory! If 0 then the factory material will be used. Parameters: range is one of the CS_POLYRANGE defines to specify a polygon range. Note that it is not allowed to use CS_POLYRANGE_LAST here!

Specified by:
setPolygonMaterial in interface iThingState
Parameters:
range -
material -
See Also:
crystalspace.jbind.interfaces.imesh.thing.iThingState#setPolygonMaterial(crystalspace.jbind.impl.engine.mesh.thing.csPolygonRange, crystalspace.jbind.interfaces.iengine.material.iMaterialWrapper)

unprepare

public void unprepare()
Description copied from interface: iThingState
Reset the prepare flag so that this Thing can be re-prepared. Among other things this will allow cached lightmaps to be recalculated.

Specified by:
unprepare in interface iThingState
See Also:
iThingState.unprepare()