Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

iThingState Struct Reference

This is the state interface to access the internals of a thing mesh object and factory (both). More...

#include <thing.h>

Inheritance diagram for iThingState:

iBase List of all members.

Public Methods

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

virtual iObjectQueryObject ()=0
 Get the object for this thing.

virtual void CompressVertices ()=0
 Compress the vertex table so that all nearly identical vertices are compressed. More...

virtual int GetPolygonCount ()=0
 Query number of polygons in this thing.

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

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

virtual iPolygon3DCreatePolygon (const char *iName=NULL)=0
 Create a new polygon and return a pointer to it.

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

virtual void RemovePolygon (int idx)=0
 Delete a polygon given an index.

virtual void RemovePolygons ()=0
 Delete all polygons.

virtual int GetPortalCount () const=0
 Query number of portals in this thing.

virtual iPortalGetPortal (int idx) const=0
 Get a portal.

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

virtual int GetVertexCount () const=0
 Query number of vertices in set.

virtual const csVector3GetVertex (int idx) const=0
 Get the given vertex coordinates in object space.

virtual const csVector3GetVertices () const=0
 Get the vertiex coordinates in object space.

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

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

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

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

virtual int CreateVertex (const csVector3 &vt)=0
 Create a vertex given his object-space coords and return his index.

virtual void SetVertex (int idx, const csVector3 &vt)=0
 Set the object space vertices for a given vertex.

virtual void DeleteVertex (int idx)=0
 Delete a vertex. More...

virtual void DeleteVertices (int from, int to)=0
 Delete a range of vertices (inclusive). More...

virtual void CheckFrustum (iFrustumView *fview, iMovable *movable)=0
 Check frustum visibility on this thing. More...

virtual csFlagsGetFlags ()=0
 Set thing flags (see CS_THING_... values above).

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

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

virtual const csVector3GetCurvesCenter () const=0
 Get the center of the curves.

virtual void SetCurvesCenter (const csVector3 &cen)=0
 Set the center of the curves.

virtual float GetCurvesScale () const=0
 Get the scale of the curves.

virtual void SetCurvesScale (float scale)=0
 Set the scale of the curves.

virtual void AddCurveVertex (const csVector3 &v, const csVector2 &uv)=0
 Add a curve vertex.

virtual int GetCurveCount () const=0
 Get the number of curves.

virtual iCurveGetCurve (int idx) const=0
 Get the curve.

virtual int GetCurveVertexCount () const=0
 Get the number of curve vertices.

virtual csVector3GetCurveVertex (int i) const=0
 Get the specified curve vertex.

virtual csVector3GetCurveVertices () const=0
 Get the curve vertices.

virtual csVector2GetCurveTexel (int i) const=0
 Get the specified curve texture coordinate (texel).

virtual void SetCurveVertex (int idx, const csVector3 &vt)=0
 Set a curve vertex.

virtual void SetCurveTexel (int idx, const csVector2 &vt)=0
 Set a curve texel.

virtual void ClearCurveVertices ()=0
 Clear all curve vertices (and texels too).

virtual iCurveCreateCurve (iCurveTemplate *tmpl)=0
 Create a new curve for this thing from the given template.

virtual int FindCurveIndex (iCurve *curve) const=0
 Find the index for a curve. Returns -1 if curve cannot be found.

virtual void RemoveCurve (int idx)=0
 Delete a curve given an index.

virtual void RemoveCurves ()=0
 Delete all curves.

virtual void MergeTemplate (iThingState *tpl, iMaterialWrapper *default_material=NULL, csVector3 *shift=NULL, csMatrix3 *transform=NULL)=0
 Add polygons and vertices from the specified thing (seen as template).

virtual void ReplaceMaterials (iMaterialList *matList, const char *prefix)=0
 Replace the materials in this thing with new materials that are prefixed by some name. More...

virtual bool HasFog () const=0
 Has this thing fog?

virtual csFogGetFog () const=0
 Return the fog structure (even if fog is disabled).


Detailed Description

This is the state interface to access the internals of a thing mesh object and factory (both).


Member Function Documentation

void iThingState::CheckFrustum ( iFrustumView * fview,
iMovable * movable ) [pure virtual]
 

Check frustum visibility on this thing.

First initialize the 2D culler cube. @@ Does this belong here?

void iThingState::CompressVertices ( ) [pure virtual]
 

Compress the vertex table so that all nearly identical vertices are compressed.

The polygons in the set are automatically adapted. This function can be called at any time in the creation of the object and it can be called multiple time but it normally only makes sense to call this function after you have finished adding all polygons and all vertices.

Note that calling this function will make the camera vertex array invalid.

void iThingState::DeleteVertex ( int idx ) [pure virtual]
 

Delete a vertex.

Warning this will invalidate all polygons that use vertices after this vertex because their vertex indices will no longer be ok.

void iThingState::DeleteVertices ( int from,
int to ) [pure virtual]
 

Delete a range of vertices (inclusive).

Warning this will invalidate all polygons that use vertices after these vertices because their vertex indices will no longer be ok. This function does bounds-checking so an easy way to delete all vertices is DeleteVertices(0,1000000000).

void * iThingState::GetPrivateObject ( ) [pure virtual]
 

@ UGLY.

@

void iThingState::ReplaceMaterials ( iMaterialList * materials,
const char * prefix ) [pure virtual]
 

Replace the materials in this thing with new materials that are prefixed by some name.

For example, if a polygon in this thing uses a material 'blabla' and the prefix is 'pref' then the new material that will be used is called 'pref_blabla'. If that material cannot be found then the original material will be used.

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.
  • CS_THING_MOVE_OFTEN: this option is set for a thing that moves very often (i.e. almost every frame). Setting this option means that the object->world and camera transformations will be combined at render time. It has the same memory efficiency as MOVE_NEVER but the transforms need to be combined every frame (if the object is visible). Use this option for geometry that moves a lot. Also very useful for objects that often move and have lots of vertices since in that case combining the transforms ones is a lot more efficient than doing two transforms on every vertex.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000