- All Superinterfaces:
- iBase, iPointer
- All Known Implementing Classes:
- public interface iThingState
- extends iBase
This is the state interface to access the internals of a thing mesh object.
- Java wrapper - Quentin Anciaux, c++ version -
public void clearReplacedMaterials()
- Clear all replaced materials (i.e. reset to default materials from
public iPolygonHandle createPolygonHandle(int polygon_idx)
- 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!
public iThingFactoryState getFactory()
- Get the factory.
public int getMixMode()
- Get mix mode.
public int getMovingOption()
- Get the moving option.
public iMaterialWrapper getPolygonMaterial(int polygon_idx)
- Get the material for the specified polygon. Parameters: polygon_idx is a
polygon index. CS_POLYINDEX_LAST is NOT supported here!
public csPlane3 getPolygonWorldPlane(int polygon_idx)
- Get world space plane of the specified polygon. Parameters: polygon_idx is
a polygon index. CS_POLYINDEX_LAST is NOT supported here!
public csVector3 getVertexW(int idx)
- Get the given vertex coordinates in world space.
public csVector3 getVerticesW()
- Get the vertex coordinates in world space.
public void prepare()
- 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.
public void replaceMaterial(iMaterialWrapper oldmat,
- 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!
public void setMixMode(int mode)
- Set mix mode.
public void setMovingOption(int opt)
- 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.
public void setPolygonMaterial(csPolygonRange range,
- 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!
public void unprepare()
- Reset the prepare flag so that this Thing can be re-prepared. Among other
things this will allow cached lightmaps to be recalculated.