SceneObject Class Reference#include <sceneObject.h>
Inheritance diagram for SceneObject:
[legend]List of all members.
Detailed Description
A 3D object.
Introduction
SceneObject exists as a foundation for 3D objects in Torque. It provides the basic functionality for:
- A scene graph (in the Zones and Portals sections), allowing efficient and robust rendering of the game scene.
- Various helper functions, including functions to get bounding information and momentum/velocity.
- Collision detection, as well as ray casting.
- Lighting. SceneObjects can register lights both at lightmap generation time, and dynamic lights at runtime (for special effects, such as from flame or a projectile, or from an explosion).
- Manipulating scene objects, for instance varying scale.
An Example
Melv May has written a most marvelous example object deriving from SceneObject. Unfortunately this page is too small to contain it.
- See also:
- http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3217 for a copy of Melv's example.
|
Portals |
virtual void | getWSPortalPlane (const U32 portalIndex, PlaneF *plane) |
| Returns the plane of the portal in world space.
|
virtual void | transformModelview (const U32 portalIndex, const MatrixF &oldMV, MatrixF *newMV) |
| This is used by a portal controling object to transform the base-modelview used by the scenegraph for rendering to the modelview it needs to render correctly.
|
virtual void | transformPosition (const U32 portalIndex, Point3F &point) |
| Used to tranform the position of a point based on a portal.
|
virtual bool | computeNewFrustum (const U32 portalIndex, const F64 *oldFrustum, const F64 nearPlane, const F64 farPlane, const RectI &oldViewport, F64 *newFrustum, RectI &newViewport, const bool flippedMatrix) |
| Returns a new view frustum for the portal.
|
virtual void | openPortal (const U32 portalIndex, SceneState *pCurrState, SceneState *pParentState) |
| Called before things are to be rendered from the portals point of view, to set up everything the portal needs to render correctly.
|
virtual void | closePortal (const U32 portalIndex, SceneState *pCurrState, SceneState *pParentState) |
| Called after rendering of a portal is complete, this resets the states the previous call to openPortal() changed.
|
Lighting |
void | setLightingPlugin (SceneObjectLightingPlugin *plugin) |
SceneObjectLightingPlugin * | getLightingPlugin () |
bool | overrideOptions |
bool | receiveLMLighting |
bool | receiveSunLight |
bool | useAdaptiveSelfIllumination |
bool | useCustomAmbientLighting |
bool | customAmbientForSelfIllumination |
ColorF | customAmbientLighting |
StringTableEntry | lightGroupName |
SceneObjectLightingPlugin * | mLightPlugin |
Persist and console |
void | inspectPostApply () |
| Called after any property of the object is changed in the world editor.
|
| DECLARE_CONOBJECT (SceneObject) |
static void | initPersistFields () |
| Register dynamic fields in a subclass of ConsoleObject.
|
Transform and Collision Members |
void | resetWorldBox () |
| Regenerates the world-space bounding box and bounding sphere.
|
void | resetRenderWorldBox () |
| Regenerates the render-world-space bounding box and sphere.
|
Container * | mContainer |
MatrixF | mObjToWorld |
| Transform from object space to world space.
|
MatrixF | mWorldToObj |
| Transform from world space to object space (inverse).
|
Point3F | mObjScale |
| Object scale.
|
Box3F | mObjBox |
| Bounding box in object space.
|
Box3F | mWorldBox |
| Bounding box in world space.
|
SphereF | mWorldSphere |
| Bounding sphere in world space.
|
MatrixF | mRenderObjToWorld |
| Render matrix to transform object space to world space.
|
MatrixF | mRenderWorldToObj |
| Render matrix to transform world space to object space.
|
Box3F | mRenderWorldBox |
| Render bounding box in world space.
|
SphereF | mRenderWorldSphere |
| Render bounxing sphere in world space.
|
SceneObjectRef * | mZoneRefHead |
SceneObjectRef * | mBinRefHead |
U32 | mBinMinX |
U32 | mBinMaxX |
U32 | mBinMinY |
U32 | mBinMaxY |
Container Interface |
When objects are searched, we go through all the zones and ask them for all of their objects. Because an object can exist in multiple zones, the container sequence key is set to the id of the current search. Then, while searching, we check to see if an object's sequence key is the same as the current search key. If it is, it will NOT be added to the list of returns since it has already been processed.
|
U32 | getContainerSeqKey () const |
| Returns the container sequence key.
|
void | setContainerSeqKey (const U32 key) |
| Sets the container sequence key.
|
U32 | mContainerSeqKey |
| Container sequence key.
|
Rendering Members |
SceneGraph * | mSceneManager |
| SceneGraph that controls this object.
|
U32 | mZoneRangeStart |
| Start of range of zones this object controls, 0xFFFFFFFF == no zones.
|
U32 | mNumCurrZones |
| Number of zones this object exists in.
|
TraversalState | mTraversalState |
| State of this object in the SceneGraph traversal - DON'T MESS WITH THIS.
|
SceneState * | mLastState |
| Last SceneState that was used to render this object.
|
U32 | mLastStateKey |
| Last state key that was used to render this object.
|
Public Types |
| MaxObjectZones = 128 |
| Pending = 0 |
| Working = 1 |
| Done = 2 |
| ScaleMask = BIT(0) |
| NextFreeMask = BIT(1) |
enum | { MaxObjectZones = 128
} |
enum | TraversalState {
Pending = 0,
Working = 1,
Done = 2
} |
enum | SceneObjectMasks {
ScaleMask = BIT(0),
NextFreeMask = BIT(1)
} |
Public Member Functions |
| SceneObject () |
virtual | ~SceneObject () |
const char * | scriptThis () |
| Returns a value representing this object which can be passed to script functions.
|
virtual bool | prepRenderImage (SceneState *state, const U32 stateKey, const U32 startZone, const bool modifyBaseZoneState=false) |
| Called when the SceneGraph is ready for the registration of RenderImages.
|
void | addToScene () |
| Adds object to the client or server container depending on the object.
|
void | removeFromScene () |
| Removes the object from the client/server container.
|
virtual void | updateReflection () |
| This is a callback for objects that have reflections and are added to the "reflectiveSet" SimSet.
|
Container * | getContainer () |
| Returns a pointer to the container that contains this object.
|
const bool | isGlobalBounds () const |
void | setGlobalBounds () |
| If global bounds are set to be true, then the object is assumed to have an infinitely large bounding box for collision and rendering purposes.
|
|
The Render Transform is the interpolated transform with respect to the frame rate. The Render Transform will differ from the object transform because the simulation is updated in fixed intervals, which controls the object transform. The framerate is, most likely, higher than this rate, so that is why the render transform is interpolated and will differ slightly from the object transform.
|
virtual void | disableCollision () |
| Disables collisions for this object including raycasts.
|
virtual void | enableCollision () |
| Enables collisions for this object.
|
bool | isCollisionEnabled () const |
| Returns true if collisions are enabled.
|
virtual bool | isDisplacable () const |
| Returns true if this object allows itself to be displaced.
|
virtual Point3F | getMomentum () const |
| Returns the momentum of this object.
|
virtual void | setMomentum (const Point3F &momentum) |
| Sets the momentum of this object.
|
virtual F32 | getMass () const |
| Returns the mass of this object.
|
virtual bool | displaceObject (const Point3F &displaceVector) |
| Displaces this object by a vector.
|
virtual const MatrixF & | getTransform () const |
| Returns the transform which can be used to convert object space to world space.
|
const MatrixF & | getWorldTransform () const |
| Returns the transform which can be used to convert world space into object space.
|
const VectorF & | getScale () const |
| Returns the scale of the object.
|
const Box3F & | getObjBox () const |
| Returns the bounding box for this object in local coordinates.
|
const Box3F & | getWorldBox () const |
| Returns the bounding box for this object in world coordinates.
|
const SphereF & | getWorldSphere () const |
| Returns the bounding sphere for this object in world coordinates.
|
Point3F | getBoxCenter () const |
| Returns the center of the bounding box in world coordinates.
|
virtual void | setTransform (const MatrixF &mat) |
| Sets the Object -> World transform.
|
virtual void | setScale (const VectorF &scale) |
| Sets the scale for the object.
|
virtual void | setRenderTransform (const MatrixF &mat) |
| This sets the render transform for this object.
|
const MatrixF & | getRenderTransform () const |
| Returns the render transform.
|
const MatrixF & | getRenderWorldTransform () const |
| Returns the render transform to convert world to local coordinates.
|
const Box3F & | getRenderWorldBox () const |
| Returns the render world box.
|
virtual void | buildConvex (const Box3F &box, Convex *convex) |
| Builds a convex hull for this object.
|
virtual bool | buildPolyList (AbstractPolyList *polyList, const Box3F &box, const SphereF &sphere) |
| Builds a list of polygons which intersect a bounding volume.
|
virtual BSPNode * | buildCollisionBSP (BSPTree *tree, const Box3F &box, const SphereF &sphere) |
| Builds a collision tree of all the polygons which collide with a bounding volume.
|
virtual bool | castRay (const Point3F &start, const Point3F &end, RayInfo *info) |
| Casts a ray and obtain collision information, returns true if RayInfo is modified.
|
virtual bool | collideBox (const Point3F &start, const Point3F &end, RayInfo *info) |
virtual Point3F | getPosition () const |
| Returns the position of the object.
|
Point3F | getRenderPosition () const |
| Returns the render-position of the object.
|
void | setPosition (const Point3F &pos) |
| Sets the position of the object.
|
virtual Point3F | getVelocity () const |
| Gets the velocity of the object.
|
virtual void | setVelocity (const Point3F &v) |
| Sets the velocity of the object.
|
|
A zone is a portalized section of an InteriorInstance, and an InteriorInstance can manage more than one zone. There is always at least one zone in the world, zone 0, which represens the whole world. Any other zone will be in an InteriorInstance. Torque keeps track of the zones containing an object as it moves throughout the world. An object can exists in multiple zones at once. |
bool | isManagingZones () const |
| Returns true if this object is managing zones.
|
U32 | getZoneRangeStart () const |
| Gets the index of the first zone this object manages in the collection of zones.
|
U32 | getNumCurrZones () const |
| Gets the number of zones containing this object.
|
U32 | getCurrZone (const U32 index) const |
| Returns the nth zone containing this object.
|
virtual bool | getOverlappingZones (SceneObject *obj, U32 *zones, U32 *numZones) |
| If an object exists in multiple zones, this method will give you the number and indices of these zones (storing them in the provided variables).
|
virtual U32 | getPointZone (const Point3F &p) |
| Returns the zone containing p.
|
virtual bool | scopeObject (const Point3F &rootPosition, const F32 rootDistance, bool *zoneScopeState) |
| This is called on a zone managing object to scope all the zones managed.
|
Static Public Attributes |
static Signal< void(SceneObject *)> | smSceneObjectAdd |
| Triggered when a scene object onAdd is called. Allows other systems to plug into SceneObject.
|
Protected Member Functions |
bool | onAdd () |
| Called when the object is added to the sim.
|
void | onRemove () |
| Called when the object is removed from the sim.
|
virtual bool | onSceneAdd (SceneGraph *graph) |
| Called when this is added to the SceneGraph.
|
virtual void | onSceneRemove () |
| Called when this is removed from the SceneGraph.
|
virtual void | onScaleChanged () |
| Called when the size of the object changes.
|
void | setLastState (SceneState *state, U32 key) |
| Sets the mLastState and mLastStateKey.
|
bool | isLastState (SceneState *state, U32 key) const |
| Returns true if the provided SceneState and key are set as this object's last state and key.
|
|
The SceneGraph traversal is recursive and the traversal state of an object can be one of three things:
- Pending - The object has not yet been examined for zone traversal.
- Working - The object is currently having its zones traversed.
- Done - The object has had all of its zones traversed or doesn't manage zones.
- Note:
- These states were formerly referred to as TraverseColor, with White, Black, and Gray; this was changed in Torque 1.2 by Pat "KillerBunny" Wilson. This code is only used internal to this class
|
void | setTraversalState (TraversalState s) |
| This sets the traversal state of the object.
|
TraversalState | getTraversalState () const |
| Returns the traversal state of this object.
|
Protected Attributes |
S32 | mCollisionCount |
bool | mGlobalBounds |
Private Types |
typedef NetObject | Parent |
Private Member Functions |
| SceneObject (const SceneObject &) |
Friends |
class | Container |
class | SceneGraph |
class | SceneState |
Member Typedef Documentation
Reimplemented from NetObject.
Reimplemented in AtlasInstance, InteriorInstance, InteriorSubObject, MirrorSubObject, PathedInterior, sgLightObject, sgMissionLightingFilter, VolumeLight, DecalManager, SceneRoot, Marker, AIPlayer, Camera, Debris, Explosion, fxFoliageReplicator, fxLight, fxShapeReplicatedStatic, fxShapeReplicator, fxSunLight, GroundCover, Lightning, ParticleEmitter, ParticleEmitterNode, Precipitation, Splash, GameBase, Item, MissionMarker, SpawnSphere, CameraBookmark, PathCamera, PhysicalZone, Player, Projectile, RigidShape, T3DSceneComponent, SFXEmitter, ShapeBase, StaticShape, Trigger, TSStatic, FlyingVehicle, HoverVehicle, Vehicle, VehicleBlocker, WheeledVehicle, Sky, TerrainBlock, and WaterBlock.
Member Enumeration Documentation
Constructor & Destructor Documentation
SceneObject::SceneObject |
( |
const SceneObject & |
|
) |
[private] |
SceneObject::SceneObject |
( |
|
) |
|
virtual SceneObject::~SceneObject |
( |
|
) |
[virtual] |
Member Function Documentation
const char* SceneObject::scriptThis |
( |
|
) |
|
Returns a value representing this object which can be passed to script functions.
virtual void SceneObject::disableCollision |
( |
|
) |
[virtual] |
Disables collisions for this object including raycasts.
Reimplemented in RigidShape, and Vehicle.
virtual void SceneObject::enableCollision |
( |
|
) |
[virtual] |
bool SceneObject::isCollisionEnabled |
( |
|
) |
const [inline] |
Returns true if collisions are enabled.
virtual bool SceneObject::isDisplacable |
( |
|
) |
const [virtual] |
Returns true if this object allows itself to be displaced.
- See also:
- displaceObject
Reimplemented in Player.
virtual Point3F SceneObject::getMomentum |
( |
|
) |
const [virtual] |
Returns the momentum of this object.
Reimplemented in Player.
virtual void SceneObject::setMomentum |
( |
const Point3F & |
momentum |
) |
[virtual] |
Sets the momentum of this object.
- Parameters:
-
Reimplemented in Player.
virtual F32 SceneObject::getMass |
( |
|
) |
const [virtual] |
Returns the mass of this object.
Reimplemented in Player.
virtual bool SceneObject::displaceObject |
( |
const Point3F & |
displaceVector |
) |
[virtual] |
Displaces this object by a vector.
- Parameters:
-
| displaceVector | Displacement vector |
Reimplemented in Player.
virtual const MatrixF& SceneObject::getTransform |
( |
|
) |
const [inline, virtual] |
Returns the transform which can be used to convert object space to world space.
const MatrixF& SceneObject::getWorldTransform |
( |
|
) |
const [inline] |
Returns the transform which can be used to convert world space into object space.
const VectorF& SceneObject::getScale |
( |
|
) |
const [inline] |
const Box3F& SceneObject::getObjBox |
( |
|
) |
const [inline] |
Returns the bounding box for this object in local coordinates.
const Box3F& SceneObject::getWorldBox |
( |
|
) |
const [inline] |
Returns the bounding box for this object in world coordinates.
const SphereF& SceneObject::getWorldSphere |
( |
|
) |
const [inline] |
Returns the bounding sphere for this object in world coordinates.
Point3F SceneObject::getBoxCenter |
( |
|
) |
const [inline] |
Returns the center of the bounding box in world coordinates.
virtual void SceneObject::setTransform |
( |
const MatrixF & |
mat |
) |
[virtual] |
Sets the Object -> World transform.
- Parameters:
-
Reimplemented in InteriorInstance, sgLightObject, Camera, fxShapeReplicatedStatic, Precipitation, Item, MissionMarker, PhysicalZone, Player, RigidShape, T3DSceneComponent, SFXEmitter, StaticShape, Trigger, TSStatic, Vehicle, and TerrainBlock.
virtual void SceneObject::setScale |
( |
const VectorF & |
scale |
) |
[virtual] |
virtual void SceneObject::setRenderTransform |
( |
const MatrixF & |
mat |
) |
[virtual] |
This sets the render transform for this object.
- Parameters:
-
Reimplemented in Camera.
const MatrixF& SceneObject::getRenderTransform |
( |
|
) |
const [inline] |
Returns the render transform.
const MatrixF& SceneObject::getRenderWorldTransform |
( |
|
) |
const [inline] |
Returns the render transform to convert world to local coordinates.
const Box3F& SceneObject::getRenderWorldBox |
( |
|
) |
const [inline] |
Returns the render world box.
virtual void SceneObject::buildConvex |
( |
const Box3F & |
box, |
|
|
Convex * |
convex | |
|
) |
| | [virtual] |
Builds a convex hull for this object.
Think of a convex hull as a low-res mesh which covers, as tightly as possible, the object mesh, and is used as a collision mesh. - Parameters:
-
| box | |
| convex | Convex mesh generated (out) |
Reimplemented in AtlasInstance, InteriorInstance, Item, PhysicalZone, Player, ShapeBase, Trigger, TSStatic, VehicleBlocker, and TerrainBlock.
Builds a list of polygons which intersect a bounding volume.
This will use either the sphere or the box, not both, the SceneObject implimentation ignores sphere.
- See also:
- AbstractPolyList
- Parameters:
-
| polyList | Poly list build (out) |
| box | Box bounding volume |
| sphere | Sphere bounding volume |
Reimplemented in AtlasInstance, InteriorInstance, PathedInterior, Item, Player, ShapeBase, TSStatic, WheeledVehicle, and TerrainBlock.
Builds a collision tree of all the polygons which collide with a bounding volume.
- Note:
- Not implemented in SceneObject.
- See also:
- TerrainBlock::buildCollisionBSP
- Parameters:
-
| tree | BSP tree built (out) |
| box | Box bounding volume |
| sphere | Sphere bounding volume |
virtual Point3F SceneObject::getPosition |
( |
|
) |
const [virtual] |
Point3F SceneObject::getRenderPosition |
( |
|
) |
const |
virtual Point3F SceneObject::getVelocity |
( |
|
) |
const [virtual] |
virtual void SceneObject::setVelocity |
( |
const Point3F & |
v |
) |
[virtual] |
bool SceneObject::isManagingZones |
( |
|
) |
const [inline] |
Returns true if this object is managing zones.
This is only true in the case of InteriorInstances which have zones in them.
U32 SceneObject::getZoneRangeStart |
( |
|
) |
const [inline] |
Gets the index of the first zone this object manages in the collection of zones.
U32 SceneObject::getNumCurrZones |
( |
|
) |
const [inline] |
Gets the number of zones containing this object.
U32 SceneObject::getCurrZone |
( |
const U32 |
index |
) |
const [inline] |
Returns the nth zone containing this object.
virtual bool SceneObject::getOverlappingZones |
( |
SceneObject * |
obj, |
|
|
U32 * |
zones, |
|
|
U32 * |
numZones | |
|
) |
| | [virtual] |
If an object exists in multiple zones, this method will give you the number and indices of these zones (storing them in the provided variables).
- Parameters:
-
| obj | Object in question. |
| zones | Indices of zones containing the object. (out) |
| numZones | Number of elements in the returned array. (out) |
Reimplemented in InteriorInstance, and SceneRoot.
virtual U32 SceneObject::getPointZone |
( |
const Point3F & |
p |
) |
[virtual] |
virtual bool SceneObject::scopeObject |
( |
const Point3F & |
rootPosition, |
|
|
const F32 |
rootDistance, |
|
|
bool * |
zoneScopeState | |
|
) |
| | [virtual] |
This is called on a zone managing object to scope all the zones managed.
- Parameters:
-
| rootPosition | Camera position |
| rootDistance | Camera visible distance |
| zoneScopeState | Array of booleans which line up with the collection of zones, marked true if that zone is scoped (out) |
Reimplemented in InteriorInstance, and SceneRoot.
virtual bool SceneObject::prepRenderImage |
( |
SceneState * |
state, |
|
|
const U32 |
stateKey, |
|
|
const U32 |
startZone, |
|
|
const bool |
modifyBaseZoneState = false | |
|
) |
| | [virtual] |
Called when the SceneGraph is ready for the registration of RenderImages.
- See also:
- SceneState
- Parameters:
-
| state | SceneState |
| stateKey | State key of the current SceneState |
| startZone | Base zone index |
| modifyBaseZoneState | If true, the object needs to modify the zone state. |
Reimplemented in AtlasInstance, InteriorInstance, PathedInterior, VolumeLight, DecalManager, SceneRoot, Marker, Debris, Explosion, fxFoliageReplicator, fxLight, fxShapeReplicator, fxSunLight, GroundCover, Lightning, ParticleEmitter, Precipitation, Splash, Item, Player, Projectile, SFXEmitter, ShapeBase, TSStatic, Sky, TerrainBlock, and WaterBlock.
void SceneObject::addToScene |
( |
|
) |
|
Adds object to the client or server container depending on the object.
void SceneObject::removeFromScene |
( |
|
) |
|
Removes the object from the client/server container.
virtual void SceneObject::updateReflection |
( |
|
) |
[inline, virtual] |
bool SceneObject::onAdd |
( |
|
) |
[protected, virtual] |
Called when the object is added to the sim.
Reimplemented from NetObject.
Reimplemented in AtlasInstance, InteriorInstance, PathedInterior, sgLightObject, sgMissionLightingFilter, VolumeLight, Marker, Camera, Debris, Explosion, fxFoliageReplicator, fxLight, fxShapeReplicator, fxSunLight, GroundCover, Lightning, ParticleEmitter, ParticleEmitterNode, Precipitation, Splash, GameBase, Item, MissionMarker, SpawnSphere, CameraBookmark, PathCamera, PhysicalZone, Player, Projectile, RigidShape, SFXEmitter, ShapeBase, StaticShape, Trigger, TSStatic, FlyingVehicle, HoverVehicle, Vehicle, VehicleBlocker, WheeledVehicle, Sky, TerrainBlock, and WaterBlock.
void SceneObject::onRemove |
( |
|
) |
[protected, virtual] |
Called when the object is removed from the sim.
Reimplemented from NetObject.
Reimplemented in AtlasInstance, InteriorInstance, PathedInterior, sgMissionLightingFilter, VolumeLight, Marker, Camera, Debris, Explosion, fxFoliageReplicator, fxLight, fxShapeReplicator, fxSunLight, GroundCover, Lightning, ParticleEmitter, ParticleEmitterNode, Precipitation, Splash, GameBase, Item, MissionMarker, PathCamera, PhysicalZone, Player, Projectile, RigidShape, SFXEmitter, ShapeBase, StaticShape, Trigger, TSStatic, FlyingVehicle, HoverVehicle, Vehicle, VehicleBlocker, WheeledVehicle, Sky, TerrainBlock, and WaterBlock.
virtual bool SceneObject::onSceneAdd |
( |
SceneGraph * |
graph |
) |
[protected, virtual] |
virtual void SceneObject::onSceneRemove |
( |
|
) |
[protected, virtual] |
virtual void SceneObject::onScaleChanged |
( |
|
) |
[protected, virtual] |
Called when the size of the object changes.
Reimplemented in Player.
virtual void SceneObject::transformModelview |
( |
const U32 |
portalIndex, |
|
|
const MatrixF & |
oldMV, |
|
|
MatrixF * |
newMV | |
|
) |
| | [protected, virtual] |
This is used by a portal controling object to transform the base-modelview used by the scenegraph for rendering to the modelview it needs to render correctly.
- See also:
- MirrorSubObject
- Parameters:
-
| portalIndex | Index of portal in the list of portals controlled by the object. |
| oldMV | Current modelview matrix used by the SceneGraph (in) |
| newMV | New modelview to be used by the SceneGraph (out) |
Reimplemented in MirrorSubObject.
virtual void SceneObject::transformPosition |
( |
const U32 |
portalIndex, |
|
|
Point3F & |
point | |
|
) |
| | [protected, virtual] |
Used to tranform the position of a point based on a portal.
- Parameters:
-
| portalIndex | Index of a portal to transform by. |
| point | Point to transform. |
Reimplemented in MirrorSubObject.
virtual bool SceneObject::computeNewFrustum |
( |
const U32 |
portalIndex, |
|
|
const F64 * |
oldFrustum, |
|
|
const F64 |
nearPlane, |
|
|
const F64 |
farPlane, |
|
|
const RectI & |
oldViewport, |
|
|
F64 * |
newFrustum, |
|
|
RectI & |
newViewport, |
|
|
const bool |
flippedMatrix | |
|
) |
| | [protected, virtual] |
Returns a new view frustum for the portal.
- Parameters:
-
| portalIndex | Which portal in the list of portals the object controls |
| oldFrustum | Current frustum. |
| nearPlane | Near clipping plane. |
| farPlane | Far clipping plane. |
| oldViewport | Current viewport. |
| newFrustum | New view frustum to use. (out) |
| newViewport | New viewport to use. (out) |
| flippedMatrix | Should the object should use a flipped matrix to calculate viewport and frustum? |
Reimplemented in MirrorSubObject.
virtual void SceneObject::openPortal |
( |
const U32 |
portalIndex, |
|
|
SceneState * |
pCurrState, |
|
|
SceneState * |
pParentState | |
|
) |
| | [protected, virtual] |
Called before things are to be rendered from the portals point of view, to set up everything the portal needs to render correctly.
- Parameters:
-
| portalIndex | Index of portal to use. |
| pCurrState | Current SceneState |
| pParentState | SceneState used before this portal was activated |
Reimplemented in MirrorSubObject.
virtual void SceneObject::closePortal |
( |
const U32 |
portalIndex, |
|
|
SceneState * |
pCurrState, |
|
|
SceneState * |
pParentState | |
|
) |
| | [protected, virtual] |
Called after rendering of a portal is complete, this resets the states the previous call to openPortal() changed.
- Parameters:
-
| portalIndex | Index of portal to use. |
| pCurrState | Current SceneState |
| pParentState | SceneState used before this portal was activated |
Reimplemented in MirrorSubObject.
virtual void SceneObject::getWSPortalPlane |
( |
const U32 |
portalIndex, |
|
|
PlaneF * |
plane | |
|
) |
| | [virtual] |
Returns the plane of the portal in world space.
- Parameters:
-
| portalIndex | Index of portal to use. |
| plane | Plane of the portal in world space (out) |
Reimplemented in MirrorSubObject.
Sets the mLastState and mLastStateKey.
- Parameters:
-
| state | SceneState to set as the last state |
| key | Key to set as the last state key |
bool SceneObject::isLastState |
( |
SceneState * |
state, |
|
|
U32 |
key | |
|
) |
| | const [inline, protected] |
Returns true if the provided SceneState and key are set as this object's last state and key.
- Parameters:
-
| state | SceneState in question |
| key | State key in question |
This sets the traversal state of the object.
- Note:
- This is used internally; you should not normally need to call it.
- Parameters:
-
| s | Traversal state to assign |
Returns the traversal state of this object.
void SceneObject::resetWorldBox |
( |
|
) |
[protected] |
Regenerates the world-space bounding box and bounding sphere.
void SceneObject::resetRenderWorldBox |
( |
|
) |
[protected] |
Regenerates the render-world-space bounding box and sphere.
U32 SceneObject::getContainerSeqKey |
( |
|
) |
const [inline, protected] |
Returns the container sequence key.
void SceneObject::setContainerSeqKey |
( |
const U32 |
key |
) |
[inline, protected] |
Sets the container sequence key.
Container* SceneObject::getContainer |
( |
|
) |
[inline] |
Returns a pointer to the container that contains this object.
const bool SceneObject::isGlobalBounds |
( |
|
) |
const [inline] |
void SceneObject::setGlobalBounds |
( |
|
) |
[inline] |
If global bounds are set to be true, then the object is assumed to have an infinitely large bounding box for collision and rendering purposes.
They can't be toggled currently.
static void SceneObject::initPersistFields |
( |
|
) |
[static] |
Register dynamic fields in a subclass of ConsoleObject.
- See also:
- addField(), addFieldV(), addDeprecatedField(), addGroup(), endGroup()
Reimplemented from NetObject.
Reimplemented in AtlasInstance, InteriorInstance, MirrorSubObject, PathedInterior, sgLightObject, sgMissionLightingFilter, VolumeLight, Marker, Camera, Debris, Explosion, fxFoliageReplicator, fxLight, fxShapeReplicator, fxSunLight, GroundCover, Lightning, ParticleEmitterNode, Precipitation, GameBase, Item, MissionMarker, SpawnSphere, CameraBookmark, PathCamera, PhysicalZone, Projectile, RigidShape, SFXEmitter, StaticShape, Trigger, TSStatic, FlyingVehicle, Vehicle, VehicleBlocker, WheeledVehicle, Sky, TerrainBlock, and WaterBlock.
void SceneObject::inspectPostApply |
( |
|
) |
[virtual] |
Called after any property of the object is changed in the world editor.
- See also:
- inspectPreApply
Reimplemented from SimObject.
Reimplemented in AtlasInstance, InteriorInstance, sgLightObject, sgMissionLightingFilter, VolumeLight, Marker, fxFoliageReplicator, fxLight, fxShapeReplicator, fxSunLight, GroundCover, Precipitation, GameBase, MissionMarker, SpawnSphere, CameraBookmark, TSStatic, Sky, TerrainBlock, and WaterBlock.
Friends And Related Function Documentation
Member Data Documentation
Transform from object space to world space.
Transform from world space to object space (inverse).
Bounding box in object space.
Bounding box in world space.
Bounding sphere in world space.
Render matrix to transform object space to world space.
Render matrix to transform world space to object space.
Render bounding box in world space.
Render bounxing sphere in world space.
Start of range of zones this object controls, 0xFFFFFFFF == no zones.
Number of zones this object exists in.
State of this object in the SceneGraph traversal - DON'T MESS WITH THIS.
Last SceneState that was used to render this object.
Last state key that was used to render this object.
Triggered when a scene object onAdd is called. Allows other systems to plug into SceneObject.
|