In file include/csengine/thing.h:

## class csThing : public csPolygonSet

> A Thing is a polygonset just like a csSector

## Inheritance:

### Public Methods

  void | CacheLightMaps () Cache the lightmaps for all polygons in this thing
  void | CalculateLighting (csLightView& lview) Update all lighting on this thing for the given light
  bool | CheckFlags (ULong to_check) Check if all the given flags are set.
  void | CreateLightMaps (IGraphics3D* g3d) Create all mipmaps for all textures for all polygons of this thing
  | csThing () Create an empty thing
  void | Draw (csRenderView& rview, bool use_z_buf = true) Draw this thing given a view and transformation
  void | DrawCurves (csRenderView& rview, bool use_z_buf = true) Draw all curves in this thing given a view and transformation
  void | DrawFoggy (csRenderView& rview) Draw this thing as a fog volume (only when fog is enabled for this thing)
  int | GetCenter () If this thing is convex you can use getCenter to get the index of the vertex holding the center of this thing
  ULong | GetFlags () Get flags.
  void | InitLightMaps (bool do_cache = true) Init the lightmaps for all polygons in this thing
  csPolygon3D* | IntersectSphere (csVector3& center, float radius, float* pr = NULL) Intersects world-space sphere with polygons of this set
  void | Merge (csThing* other) Merge the given Thing into this one
  void | MergeTemplate (csThingTemplate* tpl, csTextureHandle* default_texture = NULL, float default_texlen = 1, CLights* default_lightx = NULL, csVector3* shift = NULL, csMatrix3* transform = NULL) Add polygons and vertices from the specified template
  void | Move (csVector3& v) Relative move
  void | Move (float dx, float dy, float dz) Relative move
  void | SetConvex (bool c) Set convexity flag of this thing
  void | SetFlags (ULong mask, ULong value) Set all flags with the given mask.
  void | SetMove (csSector* home, float x, float y, float z) Set the transformation vector and sector to move thing to some position
  void | SetMove (csSector* home, csVector3& v) Set the transformation vector and sector to move thing to some position
  void | SetTransform (const csReversibleTransform& t) Set the world to object tranformation
  void | SetTransform (const csMatrix3& matrix) Set the transformation matrix to rotate the thing in some orientation
  void | Transform (csMatrix3& matrix) Relative transform
  void | Transform () Really do the transformation
  virtual | ~csThing () Destructor.

### Private Fields

  int | center_idx If convex, this holds the index to the center vertex.
  ULong | flags Set of flags
  csSector* | home Where is this thing located?
  csReversibleTransform | obj World to object transformation.
  csSector* | other OBSOLETE.

### Inherited from csPolygonSet:

### Public Fields

static long current_light_frame_number
csVector2* curve_texels
csVector3* curve_vertices
csVector3 curves_center
float curves_scale
int draw_busy
int max_curve_vertices
int num_curve_vertices

### Public Methods

void AddCurve(csCurve* curve)
void AddCurveVertex(csVector3& v, csVector2& t)
void AddPolygon(csPolygonInt* spoly)
int AddVertex(float x, float y, float z)
int AddVertex(const csVector3& v)
int AddVertexSmart(float x, float y, float z)
int AddVertexSmart(const csVector3& v)
void CamUpdate()
void CreateBoundingBox()
csVector2& CurveTexel(int i)
csVector3& CurveVertex(int i)
csPolygonSetBBox* GetBoundingBox()
void GetCameraMinMaxZ(float& minz, float& mazx)
csCurve* GetCurve(char* name)
csCurve* GetCurve(int idx)
csFog& GetFog()
csPolygonSet* GetNext()
int GetNumCurves()
int GetNumCurveVertices()
int GetNumPolygons()
int GetNumVertices()
csPolygon3D* GetPolygon(char* name)
csPolygonInt* GetPolygon(int idx)
csSector* GetSector()
csFrustrumList* GetShadows(csVector3& origin)
bool HasFog()
csVector2* IntersectCameraZPlane(float z, csVector2* clipper, int num_clip, int& num_pts)
virtual csPolygon3D* IntersectSegment(const csVector3& start, const csVector3& end, csVector3& isect, float* pr = NULL)
bool IsBSP()
csPolygon3D* NewPolygon(csTextureHandle* texture)
virtual void Prepare()
void SetNext(csPolygonSet* next)
void SetSector(csSector* sector)
void UpdateTransformation(const csCamera& c)
void UpdateTransformation(const csVector3& trans)
void UseBSP()
csVector3& Vcam(int idx)
csVector3& Vobj(int idx)
csVector3& Vwor(int idx)

### Protected Fields

csPolygonSetBBox* bbox
csBspTree* bsp
csVector3* cam_verts
csTransformedSet cam_verts_set
csCurve** curves
long light_frame_number
int max_curves
int max_polygon
csPolygonSet* next
int num_curves
int num_polygon
csVector3* obj_verts
csPolygonInt** polygons
csSector* sector
csVector3* wor_verts

### Protected Methods

void DrawOnePolygon(csPolygon3D* p, csPolygon2D* poly, csRenderView* d, bool use_z_buf)
void DrawPolygonArray(csPolygonInt** polygon, int num, csRenderView* rview, bool use_z_buf)
void* TestQueuePolygonArray(csPolygonInt** polygon, int num, csRenderView* d, csPolygon2DQueue* poly_queue)

### Private Fields

csFog fog

### Inherited from csObject:

### Public Methods

CS_ID GetID()
csObject* GetObj(const csIdType& objtype)
virtual csObject* GetObjectParent()
void ObjAdd(csObject* obj)
csObjIterator ObjGet(const csIdType& objtype)
void ObjRelease(csObject* obj)
void ObjRemove(csObject* obj)

### Private Fields

CS_ID csid_value
csObjTree* objtree

### Private Methods

virtual void SetObjectParent(csObject* parent)

### Inherited from csPolygonParentInt:

## Documentation

> A Thing is a polygonset just like a csSector. It can be used to augment the sectors with features that are difficult to describe using portals and sectors.

> Things can also be used for volumetric fog. In that case the Thing must be convex.

`csSector* home`
  Where is this thing located?

`csSector* other`
  OBSOLETE.

`csReversibleTransform obj`
  World to object transformation.

`ULong flags`
  Set of flags

`int center_idx`
  If convex, this holds the index to the center vertex.

`csThing()`
  Create an empty thing

`virtual ~csThing()`
  Destructor.

`void SetFlags(ULong mask, ULong value)`
  Set all flags with the given mask.

`ULong GetFlags()`
  Get flags.

`bool CheckFlags(ULong to_check)`
  Check if all the given flags are set.

`void SetConvex(bool c)`
  Set convexity flag of this thing. You should call this instead of SetFlags (CS_ENTITY_CONVEX, CS_ENTITY_CONVEX) because this function does some extra calculations.

`int GetCenter()`
  If this thing is convex you can use getCenter to get the index of the vertex holding the center of this thing. This center is calculated by 'setConvex(true)'.

`void Merge(csThing* other)`
  Merge the given Thing into this one. The other polygons are removed from the other thing so that it is ready to be removed. Warning! All Things are merged in world space coordinates and not in object space as one could expect!

`void SetMove(csSector* home, csVector3& v)`
  Set the transformation vector and sector to move thing to some position

`void SetMove(csSector* home, float x, float y, float z)`
  Set the transformation vector and sector to move thing to some position

`void SetTransform(const csMatrix3& matrix)`
  Set the transformation matrix to rotate the thing in some orientation

`void SetTransform(const csReversibleTransform& t)`
  Set the world to object tranformation

`void Move(float dx, float dy, float dz)`
  Relative move

`void Move(csVector3& v)`
  Relative move

`void Transform(csMatrix3& matrix)`
  Relative transform

`void Transform()`
  Really do the transformation. This should be called after calling any of the set_move, set_transform, move or transform functions. Ideally it should only be called when the thing is visible.

`void CreateLightMaps(IGraphics3D* g3d)`
  Create all mipmaps for all textures for all polygons of this thing

`void Draw(csRenderView& rview, bool use_z_buf = true)`
  Draw this thing given a view and transformation

`void DrawCurves(csRenderView& rview, bool use_z_buf = true)`
  Draw all curves in this thing given a view and transformation

`void DrawFoggy(csRenderView& rview)`
  Draw this thing as a fog volume (only when fog is enabled for this thing)

`void InitLightMaps(bool do_cache = true)`
  Init the lightmaps for all polygons in this thing

`void CalculateLighting(csLightView& lview)`
  Update all lighting on this thing for the given light

`void CacheLightMaps()`
  Cache the lightmaps for all polygons in this thing

`csPolygon3D* IntersectSphere(csVector3& center, float radius, float* pr = NULL)`
  Intersects world-space sphere with polygons of this set. Return polygon it hits with (or NULL) and the intersection point in world coordinates. It will also return the polygon with the closest hit (the most nearby polygon). If 'pr' != NULL it will also return the distance where the intersection happened.

`void MergeTemplate(csThingTemplate* tpl, csTextureHandle* default_texture = NULL, float default_texlen = 1, CLights* default_lightx = NULL, csVector3* shift = NULL, csMatrix3* transform = NULL)`
  Add polygons and vertices from the specified template

This class has no child classes.

alphabetic index hierarchy of classes

this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de