Public Methods |
| csThing (iBase *parent) |
| Create an empty thing.
|
virtual | ~csThing () |
| Destructor.
|
int | AddVertex (const csVector3 &v) |
| Just add a new vertex to the thing.
|
int | AddVertex (float x, float y, float z) |
| Just add a new vertex to the thing.
|
int | AddVertexSmart (const csVector3 &v) |
| Add a vertex but first check if there is already a vertex close to the wanted position. More...
|
int | AddVertexSmart (float x, float y, float z) |
| Add a vertex but first check if there is already a vertex close to the wanted position. More...
|
void | CompressVertices () |
| Compress the vertex table so that all nearly identical vertices are compressed. More...
|
void | RemoveUnusedVertices () |
| Optimize the vertex table so that all unused vertices are deleted. More...
|
const csVector3& | Vobj (int idx) const |
| Return the object space vector for the vertex.
|
const csVector3& | Vwor (int idx) const |
| Return the world space vector for the vertex. More...
|
const csVector3& | Vcam (int idx) const |
| Return the camera space vector for the vertex. More...
|
int | GetVertexCount () const |
| Return the number of vertices.
|
void | SetVertex (int idx, const csVector3 &vt) |
| Change a vertex.
|
void | DeleteVertex (int idx) |
| Delete a vertex.
|
void | DeleteVertices (int from, int to) |
| Delete a range of vertices.
|
void | AddPolygon (csPolygonInt *spoly) |
| Add a polygon to this thing.
|
csPolygon3D* | NewPolygon (csMaterialWrapper *material) |
| Create a new polygon in this thing and add it.
|
int | GetPolygonCount () |
| Get the number of polygons in this thing.
|
csPolygonInt* | GetPolygonInt (int idx) |
| Get a csPolygonInt with the index.
|
csPolygon3D* | GetPolygon3D (int idx) |
| Get the specified polygon from this set.
|
csPolygon3D* | GetPolygon3D (const char *name) |
| Get the named polygon from this set.
|
csPolygonArray& | GetPolygonArray () |
| Get the entire array of polygons.
|
unsigned long | GetNewPolygonID () |
| Get a new polygon ID. More...
|
int | FindPolygonIndex (iPolygon3D *polygon) const |
| Find a polygon index.
|
void | RemovePolygon (int idx) |
| Remove a single polygon.
|
void | RemovePolygons () |
| Remove all polygons.
|
void | AddCurve (csCurve *curve) |
| Add a curve to this thing.
|
int | GetCurveCount () const |
| Get the number of curves in this thing.
|
csCurve* | GetCurve (int idx) const |
| Get the specified curve from this set.
|
iCurve* | CreateCurve (iCurveTemplate *tmpl) |
| Create a curve from a template.
|
int | FindCurveIndex (iCurve *curve) const |
| Find a curve index.
|
void | RemoveCurve (int idx) |
| Delete a curve given an index.
|
void | RemoveCurves () |
| Delete all curves.
|
csCurve* | GetCurve (char *name) const |
| Get the named curve from this set.
|
int | GetCurveVertexCount () const |
| Get the number of curve vertices.
|
csVector3& | GetCurveVertex (int i) const |
| Get the specified curve vertex.
|
csVector3* | GetCurveVertices () const |
| Get the curve vertices.
|
csVector2& | GetCurveTexel (int i) const |
| Get the specified curve texture coordinate (texel).
|
void | SetCurveVertex (int idx, const csVector3 &vt) |
| Get the specified curve coordinate.
|
void | SetCurveTexel (int idx, const csVector2 &vt) |
| Set the specified curve texture coordinate (texel).
|
void | ClearCurveVertices () |
| Clear the curve vertices.
|
int | AddCurveVertex (const csVector3 &v, const csVector2 &t) |
| Add a curve vertex and return the index of the vertex.
|
float | GetCurvesScale () const |
| Get the curve scale.
|
void | SetCurvesScale (float f) |
| Set the curve scale.
|
const csVector3& | GetCurvesCenter () const |
| Get the curves center.
|
void | SetCurvesCenter (csVector3 &v) |
| Set the curves center.
|
void | Prepare () |
| Prepare all polygons for use. More...
|
void | Merge (csThing *other) |
| Merge the given Thing into this one. More...
|
void | MergeTemplate (iThingState *tpl, iMaterialWrapper *default_material=NULL, csVector3 *shift=NULL, csMatrix3 *transform=NULL) |
| Add polygons and vertices from the specified thing (seen as template).
|
void | ReplaceMaterials (iMaterialList *matList, const char *prefix) |
| Replace the materials in this thing with new materials that are prefixed by some name. More...
|
void | SetTemplate (csThing *t) |
| Set parent template.
|
csThing* | GetTemplate () const |
| Query parent template.
|
void | CreateBoundingBox () |
| Create an oriented bounding box (currently not oriented yet@@) for this polygon set. More...
|
csThingBBox* | GetBoundingBox () |
| Get the oriented bounding box created by CreateBoundingBox().
|
void | GetTransformedBoundingBox (const csReversibleTransform &trans, csBox3 &cbox) |
| Get bounding box given some transformation.
|
float | GetScreenBoundingBox (float fov, float sx, float sy, const csReversibleTransform &trans, csBox2 &sbox, csBox3 &cbox) |
| Get bounding box in screen space.
|
void | GetBoundingBox (csBox3 &box) |
| Get the bounding box in object space for this polygon set. More...
|
void | GetBoundingBox (iMovable *movable, csBox3 &box) |
| Get the bounding box for this object given some transformation (movable).
|
void | GetRadius (csVector3 &rad, csVector3 ¢) |
| Get the radius in object space for this polygon set.
|
void | AddPortalPolygon (csPolygon3D *poly) |
| Add a polygon to the list of polygons having a portal. More...
|
void | RemovePortalPolygon (csPolygon3D *poly) |
| Remove a polygon from the list of polygons having a portal.
|
csPolygonTree* | GetStaticTree () |
| Get the static polygon tree.
|
void | BuildStaticTree (const char *name, int mode=BSP_MINIMIZE_SPLITS) |
| Call this function to generate a polygon tree for this csThing. More...
|
void | RegisterVisObject (iVisibilityObject *visobj) |
| Register a visibility object with this culler.
|
void | UnregisterVisObject (iVisibilityObject *visobj) |
| Unregister a visibility object with this culler.
|
bool | VisTest (iRenderView *irview) |
| Do the visibility test from a given viewpoint. More...
|
void | RegisterShadowReceiver (iShadowReceiver *receiver) |
| Register a shadow receiver.
|
void | UnregisterShadowReceiver (iShadowReceiver *receiver) |
| Unregister a shadow receiver.
|
void | CastShadows (iFrustumView *fview) |
| Start casting shadows from a given point in space.
|
bool | DrawTest (iRenderView *rview, iMovable *movable) |
| Test if this thing is visible or not.
|
bool | Draw (iRenderView *rview, iMovable *movable, csZBufMode zMode) |
| Draw this thing given a view and transformation.
|
bool | DrawCurves (iRenderView *rview, iMovable *movable, csZBufMode zMode) |
| Draw all curves in this thing given a view and transformation.
|
bool | DrawFoggy (iRenderView *rview, iMovable *movable) |
| Draw this thing as a fog volume (only when fog is enabled for this thing).
|
void | InitializeDefault () |
| Init the lightmaps for all polygons in this thing.
|
bool | ReadFromCache (iCacheManager *cache_mgr, int id) |
| Read the lightmaps from the cache.
|
bool | WriteToCache (iCacheManager *cache_mgr, int id) |
| Cache the lightmaps for all polygons in this thing.
|
void | PrepareLighting () |
| Prepare the lightmaps for all polys so that they are suitable for the 3D rasterizer.
|
void | SetCacheName (const char *n) |
| Set the cache name for this thing.
|
const char* | GetCacheName () |
| Get the cache name.
|
csPolygon3D* | IntersectSphere (csVector3 ¢er, float radius, float *pr=NULL) |
| Intersects object-space sphere with polygons of this set. More...
|
csPolygon3D* | IntersectSegment (const csVector3 &start, const csVector3 &end, csVector3 &isect, float *pr=NULL, bool only_portals=false) |
| Intersect object-space segment with polygons of this set. More...
|
csPolygon3D* | IntersectSegmentFull (const csVector3 &start, const csVector3 &end, csVector3 &isect, float *pr=NULL, csMeshWrapper **p_mesh=NULL) |
| Intersect object-space segment with polygons of this set. More...
|
void | RealCheckFrustum (iFrustumView *lview, iMovable *movable) |
| Check frustum visibility on this thing.
|
void | CheckFrustum (iFrustumView *lview, iMovable *movable) |
| Check frustum visibility on this thing. More...
|
void | AppendShadows (iMovable *movable, iShadowBlockList *shadows, csVector3 &origin) |
| Return a list of shadow frustums which extend from this thing. More...
|
void | UpdateTransformation (const csTransform &c, long cam_cameranr) |
| Transform to the given camera if needed. More...
|
void | WorUpdate () |
| Make sure the world vertices are up-to-date.
|
void | HardTransform (const csReversibleTransform &t) |
| Do a hard transform of the object vertices. More...
|
csVector3* | GetCameraVertices (const csTransform &c, long cam_cameranr) |
| Get the array of camera vertices.
|
void | SetMovingOption (int opt) |
| Control how this thing will be moved.
|
int | GetMovingOption () const |
| Get the moving option.
|
void | SetConvex (bool c) |
| Set convexity flag of this thing. More...
|
int | GetCenter () |
| If this thing is convex you can use getCenter to get the index of the vertex holding the center of this thing. More...
|
bool | HasFog () |
| Return true if this has fog.
|
csFog& | GetFog () |
| Return fog structure.
|
void | SetFog (float density, const csColor &color) |
| Conveniance function to set fog to some setting.
|
void | DisableFog () |
| Disable fog.
|
| SCF_DECLARE_IBASE_EXT (csObject) |
Public Attributes |
csFlags | flags |
| Set of flags.
|
int | draw_busy |
| How many times are we busy drawing this thing (recursive). More...
|
csThing::ThingState | scfiThingState |
csThing::LightingInfo | scfiLightingInfo |
csThing::PolyMesh | scfiPolygonMesh |
csThing::VisCull | scfiVisibilityCuller |
csThing::MeshObject | scfiMeshObject |
csThing::MeshObjectFactory | scfiMeshObjectFactory |
Static Public Attributes |
long | current_light_frame_number |
| Current light frame number. More...
|
Friends |
class | ThingState |
class | LightingInfo |
class | PolyMesh |
class | VisCull |
class | MeshObject |
class | MeshObjectFactory |
A thing can be used for the outside of a sector or else to augment the sector with features that are difficult to describe with convex sectors alone.
Every polygon in the set has a visible and an invisible face; if the vertices of the polygon are ordered clockwise then the polygon is visible. Using this feature it is possible to define two kinds of things: in one kind the polygons are oriented such that they are visible from within the hull. In other words, the polygons form a sort of container or room where the camera can be located. This kind of thing can be used for the outside walls of a sector. In another kind the polygons are oriented such that they are visible from the outside.
Things can also be used for volumetric fog. In that case the Thing must be convex.
If you add a static tree (octree/BSP trees) to a thing it can be used as a visibility culler (i.e. it implements iVisibilityCuller).