CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

iThingState Struct Reference

This is the state interface to access the internals of a thing mesh object. More...

#include <thing.h>

Inheritance diagram for iThingState:

iBase List of all members.

Public Methods

virtual void * GetPrivateObject ()=0
 @ UGLY. More...

virtual iThingFactoryStateGetFactory ()=0
 Get the factory. More...

virtual iPolygon3DGetPolygon (int idx)=0
 Get a polygon from set by his index. More...

virtual iPolygon3DGetPolygon (const char *name)=0
 Get a polygon from set by name. More...

virtual int FindPolygonIndex (iPolygon3D *polygon) const=0
 Find the index for a polygon. Returns -1 if polygon cannot be found. More...

virtual iPolygon3DGetPortalPolygon (int idx) const=0
 Get the polygon for the given portal (with index). More...

virtual const csVector3GetVertexW (int idx) const=0
 Get the given vertex coordinates in world space. More...

virtual const csVector3GetVerticesW () const=0
 Get the vertex coordinates in world space. More...

virtual const csVector3GetVertexC (int idx) const=0
 Get the given vertex coordinates in camera space. More...

virtual const csVector3GetVerticesC () const=0
 Get the vertex coordinates in camera space. More...

virtual int GetMovingOption () const=0
 Get the moving option. More...

virtual void SetMovingOption (int opt)=0
 Control how this thing will be moved. More...

virtual iPolygon3DIntersectSegment (const csVector3 &start, const csVector3 &end, csVector3 &isect, float *pr=NULL, bool only_portals=false)=0
 Intersect a segment with this thing and return the first polygon that is hit. More...

virtual void Prepare ()=0
 Prepare the thing to be ready for use. More...

virtual void ReplaceMaterial (iMaterialWrapper *oldmat, iMaterialWrapper *newmat)=0
 Scan all polygons and replace the given material with a new material. More...

virtual void ClearReplacedMaterials ()=0
 Clear all replaced materials (i.e. More...


Detailed Description

This is the state interface to access the internals of a thing mesh object.

Definition at line 175 of file thing.h.


Member Function Documentation

virtual void iThingState::ClearReplacedMaterials   [pure virtual]
 

Clear all replaced materials (i.e.

reset to default materials from factory).

virtual int iThingState::FindPolygonIndex iPolygon3D   polygon const [pure virtual]
 

Find the index for a polygon. Returns -1 if polygon cannot be found.

virtual iThingFactoryState* iThingState::GetFactory   [pure virtual]
 

Get the factory.

virtual int iThingState::GetMovingOption   const [pure virtual]
 

Get the moving option.

virtual iPolygon3D* iThingState::GetPolygon const char *    name [pure virtual]
 

Get a polygon from set by name.

virtual iPolygon3D* iThingState::GetPolygon int    idx [pure virtual]
 

Get a polygon from set by his index.

virtual iPolygon3D* iThingState::GetPortalPolygon int    idx const [pure virtual]
 

Get the polygon for the given portal (with index).

virtual void* iThingState::GetPrivateObject   [pure virtual]
 

@ UGLY.

@

virtual const csVector3& iThingState::GetVertexC int    idx const [pure virtual]
 

Get the given vertex coordinates in camera space.

virtual const csVector3& iThingState::GetVertexW int    idx const [pure virtual]
 

Get the given vertex coordinates in world space.

virtual const csVector3* iThingState::GetVerticesC   const [pure virtual]
 

Get the vertex coordinates in camera space.

virtual const csVector3* iThingState::GetVerticesW   const [pure virtual]
 

Get the vertex coordinates in world space.

virtual iPolygon3D* iThingState::IntersectSegment const csVector3   start,
const csVector3   end,
csVector3   isect,
float *    pr = NULL,
bool    only_portals = false
[pure virtual]
 

Intersect a segment with this thing and return the first polygon that is hit.

If only_portals == true then only portals will be checked.

virtual void iThingState::Prepare   [pure virtual]
 

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.

virtual void iThingState::ReplaceMaterial iMaterialWrapper   oldmat,
iMaterialWrapper   newmat
[pure virtual]
 

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' == NULL 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!

virtual void iThingState::SetMovingOption int    opt [pure virtual]
 

Control how this thing will be moved.

There are currently three 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.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14