#include <portal.h>
Inheritance diagram for csPortal:
Public Methods | |
csPortal () | |
Create a portal. | |
virtual | ~csPortal () |
Destructor. | |
iReferencedObject* | GetReferencedObject () const |
For iReference. | |
void | SetReferencedObject (iReferencedObject *b) |
For iReference. | |
iSector* | GetSector () const |
Return the sector that this portal points too. | |
void | SetSector (iSector *s) |
Set the sector that this portal points too. More... | |
csFlags& | GetFlags () |
Set portal flags (see CS_PORTAL_XXX values). | |
void | SetPortalCallback (iPortalCallback *cb) |
Set the portal callback. | |
iPortalCallback* | GetPortalCallback () const |
Get the portal callback. | |
void | SetMissingSectorCallback (iPortalCallback *cb) |
Set the missing sector callback. | |
iPortalCallback* | GetMissingSectorCallback () const |
Get the missing sector callback. | |
void | SetFilter (iTextureHandle *ft) |
Set the filter texture. | |
iTextureHandle* | GetTextureFilter () const |
Get the filter texture. | |
void | SetFilter (float r, float g, float b) |
Set a color filter (instead of the texture). | |
void | GetColorFilter (float &r, float &g, float &b) const |
Get the current color filter. | |
const csReversibleTransform& | GetWarp () const |
Get the warping transformation in object space. | |
void | SetWarp (const csTransform &t) |
Set the warping transformation for this portal in object space and world space. | |
void | SetWarp (const csMatrix3 &m_w, const csVector3 &v_w_before, const csVector3 &v_w_after) |
void | SetMirror (iPolygon3D *iPoly) |
Set warping transformation to mirror. | |
void | ObjectToWorld (const csReversibleTransform &t) |
Transform the warp matrix from object space to world space. | |
void | HardTransform (const csReversibleTransform &t) |
Hard transform the warp matrix. | |
csVector3 | Warp (const csVector3 &pos) const |
Warp a position in world space. | |
void | WarpSpace (csReversibleTransform &t, bool &mirror) const |
Warp space using the given world->camera transformation. More... | |
bool | Draw (csPolygon2D *new_clipper, csPolygon3D *portal_polygon, iRenderView *rview) |
Draw the sector that is visible through this portal. More... | |
csPolygon3D* | HitBeam (const csVector3 &start, const csVector3 &end, csVector3 &isect) |
Follow a beam through this portal and return the polygon that it hits with. More... | |
csMeshWrapper* | HitBeam (const csVector3 &start, const csVector3 &end, csVector3 &isect, csPolygon3D **polygonPtr) |
Follow a beam through this portal and return the object that it hits with. More... | |
bool | CompleteSector (iBase *context) |
Check if the destination sector is NULL and if so call the callback. More... | |
void | CheckFrustum (iFrustumView *lview, int alpha) |
Check frustum visibility of all polygons reachable through this portal. More... | |
SCF_DECLARE_IBASE_EXT (csObject) | |
Public Attributes | |
csFlags | flags |
Set of flags. | |
csPortal::Portal | scfiPortal |
Protected Attributes | |
csReversibleTransform | warp_obj |
Warp transform in object space. | |
csReversibleTransform | warp_wor |
Warp transform in world space. | |
iPortalCallback* | sector_cb |
Callback when a sector is missing. | |
iPortalCallback* | portal_cb |
Callback for traversing to a portal. | |
iTextureHandle* | filter_texture |
A portal will change the intensity/color of the light that passes through it depending on the texture. | |
float | filter_r |
If filter_texture is NULL then this filter is used instead. | |
float | filter_g |
If filter_texture is NULL then this filter is used instead. | |
float | filter_b |
If filter_texture is NULL then this filter is used instead. |
It belongs to some polygon which is then considered a portal to another sector.
|
Check frustum visibility of all polygons reachable through this portal. Alpha is the alpha value you'd like to use to pass through this portal (0 is no completely transparent, 100 is complete opaque). |
|
Check if the destination sector is NULL and if so call the callback. This function returns false if the portal should not be traversed. |
|
Draw the sector that is visible through this portal. This function can be overriden by a subclass of Portal to support portals to other types of engines. This function also takes care of space warping.
'new_clipper' is the new 2D polygon to which all things drawn should be clipped.
Return true if succesful, false otherwise. Failure to draw through a portal does not need to be harmful. It can just mean that some maximum number is reached (like the maximum number of times a certain sector can be drawn through a mirror). |
|
Follow a beam through this portal and return the object that it hits with. This function properly acounts for space warping portals and also checks for infinite recursion (does not allow traversing the same sector more than five times). Optionally returns the polygon in 'polygonPtr'. |
|
Follow a beam through this portal and return the polygon that it hits with. This function properly acounts for space warping portals and also checks for infinite recursion (does not allow traversing the same sector more than five times). Returns the intersection point with the polygon in 'isect'. |
|
Set the sector that this portal points too. To avoid circular references, the sector is not IncRef'ed! |
|
Warp space using the given world->camera transformation. This function modifies the given camera transformation to reflect the warping change.
't' is the transformation from world to camera space. |