Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::Frustum Class Reference

A frustum represents a pyramid, capped at the near and far end which is used to represent either a visible area or a projection area. More...

#include <OgreFrustum.h>

Inheritance diagram for Ogre::Frustum:

Inheritance graph
[legend]
Collaboration diagram for Ogre::Frustum:

Collaboration graph
[legend]
List of all members.

Public Methods

 Frustum ()
virtual ~Frustum ()
void setFOVy (Real fovy)
 Sets the Y-dimension Field Of View (FOV) of the frustum.

Real getFOVy (void) const
 Retrieves the frustums Y-dimension Field Of View (FOV).

void setNearClipDistance (Real nearDist)
 Sets the position of the near clipping plane.

Real getNearClipDistance (void) const
 Sets the position of the near clipping plane.

void setFarClipDistance (Real farDist)
 Sets the distance to the far clipping plane.

Real getFarClipDistance (void) const
 Retrieves the distance from the frustum to the far clipping plane.

void setAspectRatio (Real ratio)
 Sets the aspect ratio for the frustum viewport.

Real getAspectRatio (void) const
 Retreives the current aspect ratio.

const Matrix4getProjectionMatrix (void) const
 Gets the projection matrix for this frustum.

const Matrix4getStandardProjectionMatrix (void) const
 Gets the 'standard' projection matrix for this frustum, ie the projection matrix which conforms to standard right-handed rules.

const Matrix4getViewMatrix (void) const
 Gets the view matrix for this frustum.

const PlanegetFrustumPlane (FrustumPlane plane)
 Retrieves a specified plane of the frustum.

bool isVisible (const AxisAlignedBox &bound, FrustumPlane *culledBy=0)
 Tests whether the given container is visible in the Frustum.

bool isVisible (const Sphere &bound, FrustumPlane *culledBy=0)
 Tests whether the given container is visible in the Frustum.

bool isVisible (const Vector3 &vert, FrustumPlane *culledBy=0)
 Tests whether the given vertex is visible in the Frustum.

const AxisAlignedBoxgetBoundingBox (void) const
 Overridden from MovableObject.

Real getBoundingRadius (void) const
 Overridden from MovableObject.

void _updateRenderQueue (RenderQueue *queue)
 Overridden from MovableObject.

const StringgetMovableType (void) const
 Overridden from MovableObject.

const StringgetName (void) const
 Overridden from MovableObject.

void _notifyCurrentCamera (Camera *cam)
 Overridden from MovableObject.

MaterialgetMaterial (void) const
 Overridden from Renderable.

void getRenderOperation (RenderOperation &op)
 Overridden from Renderable.

void getWorldTransforms (Matrix4 *xform) const
 Overridden from Renderable.

const QuaterniongetWorldOrientation (void) const
 Overridden from Renderable.

const Vector3getWorldPosition (void) const
 Overridden from Renderable.

Real getSquaredViewDepth (const Camera *cam) const
 Overridden from Renderable.

const LightListgetLights (void) const
 Overridden from Renderable.

virtual NodegetParentNode (void) const
 Returns the node to which this object is attached.

virtual void _notifyAttached (Node *parent, bool isTagPoint=false)
 Internal method called to notify the object that it has been attached to a node.

virtual bool isAttached (void) const
 Returns true if this object is attached to a SceneNode or TagPoint.

virtual const AxisAlignedBoxgetWorldBoundingBox (bool derive=false) const
 Retrieves the axis-aligned bounding box for this object in world coordinates.

virtual const SpheregetWorldBoundingSphere (bool derive=false) const
 Retrieves the worldspace bounding sphere for this object.

virtual void setVisible (bool visible)
 Tells this object whether to be visible or not, if it has a renderable component.

virtual bool isVisible (void) const
 Returns whether or not this object is supposed to be visible or not.

virtual void setUserObject (UserDefinedObject *obj)
 Call this to associate your own custom user object instance with this MovableObject.

virtual UserDefinedObjectgetUserObject (void)
 Retrieves a pointer to a custom application object associated with this movable by an earlier call to setUserObject.

virtual void setRenderQueueGroup (RenderQueueGroupID queueID)
 Sets the render queue group this entity will be rendered through.

virtual RenderQueueGroupID getRenderQueueGroup (void) const
 Gets the queue group for this entity, see setRenderQueueGroup for full details.

virtual Matrix4 _getParentNodeFullTransform (void) const
 return the full transformation of the parent sceneNode or the attachingPoint node

virtual void setQueryFlags (unsigned long flags)
 Sets the query flags for this object.

virtual void addQueryFlags (unsigned long flags)
 As setQueryFlags, except the flags passed as parameters are appended to the existing flags on this object.

virtual void removeQueryFlags (unsigned long flags)
 As setQueryFlags, except the flags passed as parameters are removed from the existing flags on this object.

virtual unsigned long getQueryFlags (void) const
 Returns the query flags relevant for this object.

virtual TechniquegetTechnique (void) const
 Retrieves a pointer to the Material Technique this renderable object uses.

virtual unsigned short getNumWorldTransforms (void) const
 Returns the number of world transform matrices this renderable requires.

virtual bool useIdentityProjection (void) const
 Returns whether or not to use an 'identity' projection.

virtual bool useIdentityView (void) const
 Returns whether or not to use an 'identity' projection.

virtual SceneDetailLevel getRenderDetail () const
 Returns the preferred rasterisation mode of this renderable.

virtual bool getNormaliseNormals (void) const
 Returns whether or not this Renderable wishes the hardware to normalise normals.


Protected Methods

void updateFrustum (void) const
void updateView (void) const
bool isViewOutOfDate (void) const
bool isFrustumOutOfDate (void) const

Protected Attributes

Real mFOVy
 y-direction field-of-view (default 45)

Real mFarDist
 Far clip distance - default 10000.

Real mNearDist
 Near clip distance - default 100.

Real mAspect
 x/y viewport ratio - default 1.3333

Plane mFrustumPlanes [6]
 The 6 main clipping planes.

Quaternion mLastParentOrientation
 Stored versions of parent orientation / position.

Vector3 mLastParentPosition
Matrix4 mProjMatrix
 Pre-calced projection matrix.

Matrix4 mStandardProjMatrix
 Pre-calced standard projection matrix.

Matrix4 mViewMatrix
 Pre-calced view matrix.

bool mRecalcFrustum
 Something's changed in the frustrum shape?

bool mRecalcView
 Something re the view pos has changed.

Real mCoeffL [2]
 Temp coefficient values calculated from a frustum change, used when establishing the frustum planes when the view changes.

Real mCoeffR [2]
 Temp coefficient values calculated from a frustum change, used when establishing the frustum planes when the view changes.

Real mCoeffB [2]
 Temp coefficient values calculated from a frustum change, used when establishing the frustum planes when the view changes.

Real mCoeffT [2]
 Temp coefficient values calculated from a frustum change, used when establishing the frustum planes when the view changes.

AxisAlignedBox mBoundingBox
VertexData mVertexData
MaterialmMaterial
NodemParentNode
 node to which this object is attached

bool mParentIsTagPoint
bool mVisible
 Is this object visible?

UserDefinedObjectmUserObject
 User defined object which is linked to this object.

RenderQueueGroupID mRenderQueueID
 The render queue to use when rendering this object.

unsigned long mQueryFlags
 Flags determining whether this object is included / excluded from scene queries.

AxisAlignedBox mWorldAABB
 Cached world AABB of this object.

Sphere mWorldBoundingSphere

Static Protected Attributes

String msMovableType = "Frustum"
 Shared class-level name for Movable type.


Detailed Description

A frustum represents a pyramid, capped at the near and far end which is used to represent either a visible area or a projection area.

Can be used for a number of applications.

Definition at line 52 of file OgreFrustum.h.


Constructor & Destructor Documentation

Ogre::Frustum::Frustum  
 

Definition at line 44 of file OgreFrustum.cpp.

References Ogre::VertexDeclaration::addElement(), mAspect, mFarDist, mFOVy, mMaterial, mNearDist, Ogre::MovableObject::mParentNode, mProjMatrix, mRecalcFrustum, mRecalcView, mVertexData, mViewMatrix, Ogre::MovableObject::mVisible, Ogre::Real, Ogre::VertexBufferBinding::setBinding(), updateView(), Ogre::VertexData::vertexBufferBinding, Ogre::VertexData::vertexCount, Ogre::VertexData::vertexDeclaration, Ogre::VertexData::vertexStart, Ogre::VES_POSITION, and Ogre::VET_FLOAT3.

Ogre::Frustum::~Frustum   [virtual]
 

Definition at line 80 of file OgreFrustum.cpp.


Member Function Documentation

Matrix4 Ogre::MovableObject::_getParentNodeFullTransform void    const [virtual, inherited]
 

return the full transformation of the parent sceneNode or the attachingPoint node

Definition at line 92 of file OgreMovableObject.cpp.

References Ogre::Node::_getFullTransform(), and Ogre::MovableObject::mParentNode.

Referenced by Ogre::Entity::cacheBoneMatrices(), Ogre::TagPoint::getParentEntityTransform(), Ogre::MovableObject::getWorldBoundingBox(), Ogre::SubEntity::getWorldTransforms(), and Ogre::BillboardSet::getWorldTransforms().

void Ogre::MovableObject::_notifyAttached Node   parent,
bool    isTagPoint = false
[virtual, inherited]
 

Internal method called to notify the object that it has been attached to a node.

Definition at line 54 of file OgreMovableObject.cpp.

References Ogre::MovableObject::mParentIsTagPoint, and Ogre::MovableObject::mParentNode.

Referenced by Ogre::SceneNode::attachObject(), Ogre::Entity::attachObjectImpl(), Ogre::SceneNode::detachAllObjects(), Ogre::SceneNode::detachObject(), and Ogre::SceneNode::~SceneNode().

void Ogre::Frustum::_notifyCurrentCamera Camera   cam [virtual]
 

Overridden from MovableObject.

Implements Ogre::MovableObject.

Definition at line 590 of file OgreFrustum.cpp.

void Ogre::Frustum::_updateRenderQueue RenderQueue   queue [virtual]
 

Overridden from MovableObject.

Implements Ogre::MovableObject.

Definition at line 515 of file OgreFrustum.cpp.

References Ogre::RenderQueue::addRenderable().

virtual void Ogre::MovableObject::addQueryFlags unsigned long    flags [virtual, inherited]
 

As setQueryFlags, except the flags passed as parameters are appended to the existing flags on this object.

Definition at line 168 of file OgreMovableObject.h.

Real Ogre::Frustum::getAspectRatio void    const
 

Retreives the current aspect ratio.

Definition at line 497 of file OgreFrustum.cpp.

References mAspect, and Ogre::Real.

const AxisAlignedBox & Ogre::Frustum::getBoundingBox void    const [virtual]
 

Overridden from MovableObject.

Implements Ogre::MovableObject.

Definition at line 510 of file OgreFrustum.cpp.

References mBoundingBox.

Real Ogre::Frustum::getBoundingRadius void    const [virtual]
 

Overridden from MovableObject.

Implements Ogre::MovableObject.

Definition at line 526 of file OgreFrustum.cpp.

References mFarDist, and Ogre::Real.

Real Ogre::Frustum::getFarClipDistance void    const
 

Retrieves the distance from the frustum to the far clipping plane.

Definition at line 107 of file OgreFrustum.cpp.

References mFarDist, and Ogre::Real.

Real Ogre::Frustum::getFOVy void    const
 

Retrieves the frustums Y-dimension Field Of View (FOV).

Definition at line 93 of file OgreFrustum.cpp.

References mFOVy, and Ogre::Real.

const Plane & Ogre::Frustum::getFrustumPlane FrustumPlane    plane
 

Retrieves a specified plane of the frustum.

Remarks:
Gets a reference to one of the planes which make up the frustum frustum, e.g. for clipping purposes.

Definition at line 154 of file OgreFrustum.cpp.

References Ogre::FrustumPlane, mFrustumPlanes, and updateView().

const LightList & Ogre::Frustum::getLights void    const [virtual]
 

Overridden from Renderable.

Implements Ogre::Renderable.

Definition at line 577 of file OgreFrustum.cpp.

References Ogre::LightList.

Material * Ogre::Frustum::getMaterial void    const [virtual]
 

Overridden from Renderable.

Implements Ogre::Renderable.

Definition at line 531 of file OgreFrustum.cpp.

References mMaterial.

const String & Ogre::Frustum::getMovableType void    const [virtual]
 

Overridden from MovableObject.

Implements Ogre::MovableObject.

Definition at line 521 of file OgreFrustum.cpp.

References msMovableType.

const String & Ogre::Frustum::getName void    const [virtual]
 

Overridden from MovableObject.

Implements Ogre::MovableObject.

Definition at line 584 of file OgreFrustum.cpp.

References msMovableType.

Real Ogre::Frustum::getNearClipDistance void    const
 

Sets the position of the near clipping plane.

Definition at line 123 of file OgreFrustum.cpp.

References mNearDist, and Ogre::Real.

virtual bool Ogre::Renderable::getNormaliseNormals void    const [virtual, inherited]
 

Returns whether or not this Renderable wishes the hardware to normalise normals.

Reimplemented in Ogre::SubEntity.

Definition at line 132 of file OgreRenderable.h.

Referenced by Ogre::SceneManager::renderSingleObject().

virtual unsigned short Ogre::Renderable::getNumWorldTransforms void    const [virtual, inherited]
 

Returns the number of world transform matrices this renderable requires.

Remarks:
When a renderable uses vertex blending, it uses multiple world matrices instead of a single one. Each vertex sent to the pipeline can reference one or more matrices in this list with given weights. If a renderable does not use vertex blending this method returns 1, which is the default for simplicity.

Reimplemented in Ogre::SubEntity, and Ogre::BorderRenderable.

Definition at line 98 of file OgreRenderable.h.

Referenced by Ogre::SceneManager::renderSingleObject().

Node * Ogre::MovableObject::getParentNode void    const [virtual, inherited]
 

Returns the node to which this object is attached.

Remarks:
An object is not visible in the scene unless attached to a SceneNode.

Attaching an object is done via the SceneNode::attachObject method.

Definition at line 60 of file OgreMovableObject.cpp.

References Ogre::MovableObject::mParentNode.

Referenced by Ogre::TagPoint::_updateFromParent(), Ogre::BspIntersectionSceneQuery::execute(), Ogre::TagPoint::getLights(), Ogre::SubEntity::getLights(), Ogre::SubEntity::getSquaredViewDepth(), Ogre::TagPoint::needUpdate(), and Ogre::BspSceneManager::processVisibleLeaf().

const Matrix4 & Ogre::Frustum::getProjectionMatrix void    const
 

Gets the projection matrix for this frustum.

Mainly for use by OGRE internally.

Remarks:
This method retrieves the rendering-API dependent version of the projection matrix. If you want a 'typical' projection matrix then use getStandardProjectionMatrix.

Definition at line 129 of file OgreFrustum.cpp.

References mProjMatrix, and updateFrustum().

virtual unsigned long Ogre::MovableObject::getQueryFlags void    const [virtual, inherited]
 

Returns the query flags relevant for this object.

Definition at line 175 of file OgreMovableObject.h.

Referenced by Ogre::BspIntersectionSceneQuery::execute().

virtual SceneDetailLevel Ogre::Renderable::getRenderDetail   const [virtual, inherited]
 

Returns the preferred rasterisation mode of this renderable.

Reimplemented in Ogre::SubEntity.

Definition at line 129 of file OgreRenderable.h.

References Ogre::SceneDetailLevel, and Ogre::SDL_SOLID.

Referenced by Ogre::SceneManager::renderSingleObject().

void Ogre::Frustum::getRenderOperation RenderOperation   op [virtual]
 

Overridden from Renderable.

Implements Ogre::Renderable.

Definition at line 536 of file OgreFrustum.cpp.

References mVertexData, Ogre::RenderOperation::operationType, updateFrustum(), updateView(), Ogre::RenderOperation::useIndexes, and Ogre::RenderOperation::vertexData.

RenderQueueGroupID Ogre::MovableObject::getRenderQueueGroup void    const [virtual, inherited]
 

Gets the queue group for this entity, see setRenderQueueGroup for full details.

Definition at line 87 of file OgreMovableObject.cpp.

References Ogre::MovableObject::mRenderQueueID, and Ogre::RenderQueueGroupID.

Real Ogre::Frustum::getSquaredViewDepth const Camera   cam const [virtual]
 

Overridden from Renderable.

Implements Ogre::Renderable.

Definition at line 567 of file OgreFrustum.cpp.

References Ogre::Node::_getDerivedPosition(), Ogre::Camera::getDerivedPosition(), Ogre::MovableObject::mParentNode, and Ogre::Real.

const Matrix4 & Ogre::Frustum::getStandardProjectionMatrix void    const
 

Gets the 'standard' projection matrix for this frustum, ie the projection matrix which conforms to standard right-handed rules.

Remarks:
This differs from the rendering-API dependent getProjectionMatrix in that it always returns a right-handed projection matrix result no matter what rendering API is being used - this is required for vertex and fragment programs for example. However, the resulting depth range may still vary between render systems since D3D uses [0,1] and GL uses [-1,1], and the range must be kept the same between programmable and fixed-function pipelines.

Definition at line 137 of file OgreFrustum.cpp.

References mStandardProjMatrix, and updateFrustum().

virtual Technique* Ogre::Renderable::getTechnique void    const [virtual, inherited]
 

Retrieves a pointer to the Material Technique this renderable object uses.

Remarks:
This is to allow Renderables to use a chosen Technique if they wish, otherwise they will use the best Technique available for the Material they are using.

Reimplemented in Ogre::SubEntity.

Definition at line 63 of file OgreRenderable.h.

References Ogre::Material::getBestTechnique().

Referenced by Ogre::RenderPriorityGroup::addRenderable().

virtual UserDefinedObject* Ogre::MovableObject::getUserObject void    [virtual, inherited]
 

Retrieves a pointer to a custom application object associated with this movable by an earlier call to setUserObject.

Definition at line 136 of file OgreMovableObject.h.

const Matrix4 & Ogre::Frustum::getViewMatrix void    const
 

Gets the view matrix for this frustum.

Mainly for use by OGRE internally.

Definition at line 145 of file OgreFrustum.cpp.

References mViewMatrix, and updateView().

const AxisAlignedBox & Ogre::MovableObject::getWorldBoundingBox bool    derive = false const [virtual, inherited]
 

Retrieves the axis-aligned bounding box for this object in world coordinates.

Definition at line 104 of file OgreMovableObject.cpp.

References Ogre::MovableObject::_getParentNodeFullTransform(), Ogre::MovableObject::getBoundingBox(), Ogre::MovableObject::mWorldAABB, and Ogre::AxisAlignedBox::transform().

Referenced by Ogre::BspIntersectionSceneQuery::execute(), and Ogre::BspSceneManager::processVisibleLeaf().

const Sphere & Ogre::MovableObject::getWorldBoundingSphere bool    derive = false const [virtual, inherited]
 

Retrieves the worldspace bounding sphere for this object.

Definition at line 116 of file OgreMovableObject.cpp.

References Ogre::Node::_getDerivedPosition(), Ogre::MovableObject::getBoundingRadius(), Ogre::MovableObject::mParentNode, Ogre::MovableObject::mWorldBoundingSphere, Ogre::Sphere::setCenter(), and Ogre::Sphere::setRadius().

const Quaternion & Ogre::Frustum::getWorldOrientation void    const [virtual]
 

Overridden from Renderable.

Implements Ogre::Renderable.

Definition at line 551 of file OgreFrustum.cpp.

References Ogre::Node::_getDerivedOrientation(), and Ogre::MovableObject::mParentNode.

const Vector3 & Ogre::Frustum::getWorldPosition void    const [virtual]
 

Overridden from Renderable.

Implements Ogre::Renderable.

Definition at line 559 of file OgreFrustum.cpp.

References Ogre::Node::_getDerivedPosition(), and Ogre::MovableObject::mParentNode.

void Ogre::Frustum::getWorldTransforms Matrix4   xform const [virtual]
 

Overridden from Renderable.

Implements Ogre::Renderable.

Definition at line 545 of file OgreFrustum.cpp.

References Ogre::Node::getWorldTransforms(), and Ogre::MovableObject::mParentNode.

bool Ogre::MovableObject::isAttached void    const [virtual, inherited]
 

Returns true if this object is attached to a SceneNode or TagPoint.

Definition at line 65 of file OgreMovableObject.cpp.

References Ogre::MovableObject::mParentNode.

Referenced by Ogre::Entity::attachObjectToBone().

bool Ogre::Frustum::isFrustumOutOfDate void    const [protected]
 

Definition at line 399 of file OgreFrustum.cpp.

References mRecalcFrustum.

bool Ogre::Frustum::isViewOutOfDate void    const [protected]
 

Definition at line 377 of file OgreFrustum.cpp.

References Ogre::Node::_getDerivedOrientation(), Ogre::Node::_getDerivedPosition(), mLastParentOrientation, mLastParentPosition, Ogre::MovableObject::mParentNode, and mRecalcView.

Referenced by updateView().

bool Ogre::MovableObject::isVisible void    const [virtual, inherited]
 

Returns whether or not this object is supposed to be visible or not.

Definition at line 76 of file OgreMovableObject.cpp.

References Ogre::MovableObject::mVisible.

Referenced by Ogre::OctreeNode::_addToRenderQueue(), Ogre::SceneManager::_populateLightList(), and Ogre::BspSceneManager::processVisibleLeaf().

bool Ogre::Frustum::isVisible const Vector3   vert,
FrustumPlane   culledBy = 0
 

Tests whether the given vertex is visible in the Frustum.

Parameters:
vert  Vertex to be checked
culledBy  Optional pointer to an int which will be filled by the plane number which culled the box if the result was false;
Returns:
If the box was visible, true is returned.

Otherwise, false is returned.

Definition at line 201 of file OgreFrustum.cpp.

References Ogre::FrustumPlane, Ogre::Plane::getSide(), mFrustumPlanes, and updateView().

bool Ogre::Frustum::isVisible const Sphere   bound,
FrustumPlane   culledBy = 0
 

Tests whether the given container is visible in the Frustum.

Parameters:
bound  Bounding sphere to be checked
culledBy  Optional pointer to an int which will be filled by the plane number which culled the box if the result was false;
Returns:
If the sphere was visible, true is returned.

Otherwise, false is returned.

Definition at line 224 of file OgreFrustum.cpp.

References Ogre::FrustumPlane, Ogre::Sphere::getCenter(), Ogre::Plane::getDistance(), Ogre::Sphere::getRadius(), mFrustumPlanes, and updateView().

bool Ogre::Frustum::isVisible const AxisAlignedBox   bound,
FrustumPlane   culledBy = 0
 

Tests whether the given container is visible in the Frustum.

Parameters:
bound  Bounding box to be checked
culledBy  Optional pointer to an int which will be filled by the plane number which culled the box if the result was false;
Returns:
If the box was visible, true is returned.

Otherwise, false is returned.

Definition at line 164 of file OgreFrustum.cpp.

References Ogre::FrustumPlane, Ogre::AxisAlignedBox::getAllCorners(), Ogre::Plane::getSide(), Ogre::AxisAlignedBox::isNull(), mFrustumPlanes, and updateView().

virtual void Ogre::MovableObject::removeQueryFlags unsigned long    flags [virtual, inherited]
 

As setQueryFlags, except the flags passed as parameters are removed from the existing flags on this object.

Definition at line 172 of file OgreMovableObject.h.

void Ogre::Frustum::setAspectRatio Real    ratio
 

Sets the aspect ratio for the frustum viewport.

Remarks:
The ratio between the x and y dimensions of the rectangular area visible through the frustum is known as aspect ratio: aspect = width / height .

The default for most fullscreen windows is 1.3333 - this is also assumed by Ogre unless you use this method to state otherwise.

Definition at line 503 of file OgreFrustum.cpp.

References mAspect, mRecalcFrustum, and Ogre::Real.

void Ogre::Frustum::setFarClipDistance Real    farDist
 

Sets the distance to the far clipping plane.

Remarks:
The view frustrum is a pyramid created from the frustum position and the edges of the viewport. This frustrum does not extend to infinity - it is cropped near to the frustum and there is a far plane beyond which nothing is displayed. This method sets the distance for the far plane. Different applications need different values: e.g. a flight sim needs a much further far clipping plane than a first-person shooter. An important point here is that the larger the gap between near and far clipping planes, the lower the accuracy of the Z-buffer used to depth-cue pixels. This is because the Z-range is limited to the size of the Z buffer (16 or 32-bit) and the max values must be spread over the gap between near and far clip planes. The bigger the range, the more the Z values will be approximated which can cause artifacts when lots of objects are close together in the Z-plane. So make sure you clip as close to the frustum as you can - don't set a huge value for the sake of it.
Parameters:
far  The distance to the far clipping plane from the frustum in world coordinates.

Definition at line 100 of file OgreFrustum.cpp.

References mFarDist, mRecalcFrustum, and Ogre::Real.

void Ogre::Frustum::setFOVy Real    fovy
 

Sets the Y-dimension Field Of View (FOV) of the frustum.

Remarks:
Field Of View (FOV) is the angle made between the frustum's position, and the left & right edges of the 'screen' onto which the scene is projected. High values (90+) result in a wide-angle, fish-eye kind of view, low values (30-) in a stretched, telescopic kind of view. Typical values are between 45 and 60.

This value represents the HORIZONTAL field-of-view. The vertical field of view is calculated from this depending on the dimensions of the viewport (they will only be the same if the viewport is square).

Note:
Setting the FOV overrides the value supplied for frustum::setNearClipPlane.

Definition at line 86 of file OgreFrustum.cpp.

References mFOVy, mRecalcFrustum, and Ogre::Real.

void Ogre::Frustum::setNearClipDistance Real    nearDist
 

Sets the position of the near clipping plane.

Remarks:
The position of the near clipping plane is the distance from the frustums position to the screen on which the world is projected. The near plane distance, combined with the field-of-view and the aspect ratio, determines the size of the viewport through which the world is viewed (in world co-ordinates). Note that this world viewport is different to a screen viewport, which has it's dimensions expressed in pixels. The frustums viewport should have the same aspect ratio as the screen viewport it renders into to avoid distortion.
Parameters:
near  The distance to the near clipping plane from the frustum in world coordinates.

Definition at line 113 of file OgreFrustum.cpp.

References Except, mNearDist, mRecalcFrustum, and Ogre::Real.

virtual void Ogre::MovableObject::setQueryFlags unsigned long    flags [virtual, inherited]
 

Sets the query flags for this object.

Remarks:
When performing a scene query, this object will be included or excluded according to flags on the object and flags on the query. This is a bitwise value, so only when a bit on these flags is set, will it be included in a query asking for that flag. The meaning of the bits is application-specific.

Definition at line 164 of file OgreMovableObject.h.

void Ogre::MovableObject::setRenderQueueGroup RenderQueueGroupID    queueID [virtual, inherited]
 

Sets the render queue group this entity will be rendered through.

Remarks:
Render queues are grouped to allow you to more tightly control the ordering of rendered objects. If you do not call this method, all Entity objects default to RENDER_QUEUE_MAIN which is fine for most objects. You may want to alter this if you want this entity to always appear in front of other objects, e.g. for a 3D menu system or such.

See RenderQueue for more details.

Parameters:
queueID  Enumerated value of the queue group to use.

Definition at line 82 of file OgreMovableObject.cpp.

References Ogre::MovableObject::mRenderQueueID, and Ogre::RenderQueueGroupID.

virtual void Ogre::MovableObject::setUserObject UserDefinedObject   obj [virtual, inherited]
 

Call this to associate your own custom user object instance with this MovableObject.

Remarks:
By simply making your game / application object a subclass of UserDefinedObject, you can establish a link between an OGRE instance of MovableObject and your own application classes. Call this method to establish the link.

Definition at line 132 of file OgreMovableObject.h.

void Ogre::MovableObject::setVisible bool    visible [virtual, inherited]
 

Tells this object whether to be visible or not, if it has a renderable component.

Reimplemented in Ogre::Light.

Definition at line 71 of file OgreMovableObject.cpp.

References Ogre::MovableObject::mVisible.

void Ogre::Frustum::updateFrustum void    const [protected]
 

Definition at line 248 of file OgreFrustum.cpp.

References Ogre::VertexBufferBinding::getBuffer(), mAspect, mBoundingBox, mCoeffB, mCoeffL, mCoeffR, mCoeffT, mFarDist, mFOVy, mNearDist, mProjMatrix, mRecalcFrustum, mVertexData, Ogre::Real, Ogre::AxisAlignedBox::setExtents(), and Ogre::VertexData::vertexBufferBinding.

Referenced by getProjectionMatrix(), getRenderOperation(), getStandardProjectionMatrix(), and updateView().

void Ogre::Frustum::updateView void    const [protected]
 

Definition at line 405 of file OgreFrustum.cpp.

References Ogre::Vector3::dotProduct(), Ogre::FRUSTUM_PLANE_BOTTOM, Ogre::FRUSTUM_PLANE_FAR, Ogre::FRUSTUM_PLANE_LEFT, Ogre::FRUSTUM_PLANE_NEAR, Ogre::FRUSTUM_PLANE_RIGHT, Ogre::FRUSTUM_PLANE_TOP, Ogre::Matrix3::GetColumn(), isViewOutOfDate(), mCoeffB, mCoeffL, mCoeffR, mCoeffT, mFarDist, mFrustumPlanes, mLastParentOrientation, mLastParentPosition, mNearDist, mRecalcView, mViewMatrix, Ogre::Real, Ogre::Quaternion::ToRotationMatrix(), Ogre::Matrix3::Transpose(), updateFrustum(), Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.

Referenced by Frustum(), getFrustumPlane(), getRenderOperation(), getViewMatrix(), and isVisible().

virtual bool Ogre::Renderable::useIdentityProjection void    const [virtual, inherited]
 

Returns whether or not to use an 'identity' projection.

Remarks:
Usually Renderable objects will use a projection matrix as determined by the active camera. However, if they want they can cancel this out and use an identity projection, which effectively projects in 2D using a {-1, 1} view space. Useful for overlay rendering. Normal renderables need not override this.

Reimplemented in Ogre::GuiElement, and Ogre::BorderRenderable.

Definition at line 108 of file OgreRenderable.h.

Referenced by Ogre::SceneManager::useRenderableViewProjMode().

virtual bool Ogre::Renderable::useIdentityView void    const [virtual, inherited]
 

Returns whether or not to use an 'identity' projection.

Remarks:
Usually Renderable objects will use a view matrix as determined by the active camera. However, if they want they can cancel this out and use an identity matrix, which means all geometry is assumed to be relative to camera space already. Useful for overlay rendering. Normal renderables need not override this.

Reimplemented in Ogre::GuiElement, and Ogre::BorderRenderable.

Definition at line 118 of file OgreRenderable.h.

Referenced by Ogre::SceneManager::useRenderableViewProjMode().


Member Data Documentation

Real Ogre::Frustum::mAspect [protected]
 

x/y viewport ratio - default 1.3333

Definition at line 62 of file OgreFrustum.h.

Referenced by Frustum(), getAspectRatio(), setAspectRatio(), and updateFrustum().

AxisAlignedBox Ogre::Frustum::mBoundingBox [protected]
 

Definition at line 98 of file OgreFrustum.h.

Referenced by getBoundingBox(), and updateFrustum().

Real Ogre::Frustum::mCoeffB[2] [protected]
 

Temp coefficient values calculated from a frustum change, used when establishing the frustum planes when the view changes.

Definition at line 86 of file OgreFrustum.h.

Referenced by updateFrustum(), and updateView().

Real Ogre::Frustum::mCoeffL[2] [protected]
 

Temp coefficient values calculated from a frustum change, used when establishing the frustum planes when the view changes.

Definition at line 86 of file OgreFrustum.h.

Referenced by updateFrustum(), and updateView().

Real Ogre::Frustum::mCoeffR[2] [protected]
 

Temp coefficient values calculated from a frustum change, used when establishing the frustum planes when the view changes.

Definition at line 86 of file OgreFrustum.h.

Referenced by updateFrustum(), and updateView().

Real Ogre::Frustum::mCoeffT[2] [protected]
 

Temp coefficient values calculated from a frustum change, used when establishing the frustum planes when the view changes.

Definition at line 86 of file OgreFrustum.h.

Referenced by updateFrustum(), and updateView().

Real Ogre::Frustum::mFarDist [protected]
 

Far clip distance - default 10000.

Definition at line 58 of file OgreFrustum.h.

Referenced by Frustum(), getBoundingRadius(), getFarClipDistance(), setFarClipDistance(), updateFrustum(), and updateView().

Real Ogre::Frustum::mFOVy [protected]
 

y-direction field-of-view (default 45)

Definition at line 56 of file OgreFrustum.h.

Referenced by Frustum(), getFOVy(), setFOVy(), and updateFrustum().

Plane Ogre::Frustum::mFrustumPlanes[6] [protected]
 

The 6 main clipping planes.

Definition at line 65 of file OgreFrustum.h.

Referenced by getFrustumPlane(), isVisible(), and updateView().

Quaternion Ogre::Frustum::mLastParentOrientation [protected]
 

Stored versions of parent orientation / position.

Definition at line 68 of file OgreFrustum.h.

Referenced by isViewOutOfDate(), and updateView().

Vector3 Ogre::Frustum::mLastParentPosition [protected]
 

Definition at line 69 of file OgreFrustum.h.

Referenced by isViewOutOfDate(), and updateView().

Material* Ogre::Frustum::mMaterial [protected]
 

Definition at line 101 of file OgreFrustum.h.

Referenced by Frustum(), and getMaterial().

Real Ogre::Frustum::mNearDist [protected]
 

Near clip distance - default 100.

Definition at line 60 of file OgreFrustum.h.

Referenced by Frustum(), getNearClipDistance(), setNearClipDistance(), updateFrustum(), and updateView().

bool Ogre::MovableObject::mParentIsTagPoint [protected, inherited]
 

Definition at line 48 of file OgreMovableObject.h.

Referenced by Ogre::MovableObject::_notifyAttached(), Ogre::MovableObject::MovableObject(), and Ogre::MovableObject::~MovableObject().

Node* Ogre::MovableObject::mParentNode [protected, inherited]
 

node to which this object is attached

Definition at line 47 of file OgreMovableObject.h.

Referenced by Ogre::MovableObject::_getParentNodeFullTransform(), Ogre::MovableObject::_notifyAttached(), Ogre::Entity::_notifyCurrentCamera(), Ogre::ParticleSystem::_triggerEmitters(), Ogre::ParticleSystem::_updateBounds(), Ogre::BillboardSet::_updateBounds(), Ogre::Camera::Camera(), Frustum(), Ogre::BillboardSet::genBillboardAxes(), Ogre::Entity::getBoundingBox(), Ogre::Entity::getBoundingRadius(), Ogre::TerrainRenderable::getLights(), Ogre::SimpleRenderable::getLights(), Ogre::BillboardSet::getLights(), Ogre::MovableObject::getParentNode(), getSquaredViewDepth(), Ogre::BillboardSet::getSquaredViewDepth(), Ogre::MovableObject::getWorldBoundingSphere(), Ogre::TerrainRenderable::getWorldOrientation(), Ogre::SubEntity::getWorldOrientation(), Ogre::SimpleRenderable::getWorldOrientation(), Ogre::ParticleSystem::getWorldOrientation(), getWorldOrientation(), Ogre::BillboardSet::getWorldOrientation(), Ogre::TerrainRenderable::getWorldPosition(), Ogre::SubEntity::getWorldPosition(), Ogre::SimpleRenderable::getWorldPosition(), Ogre::ParticleSystem::getWorldPosition(), getWorldPosition(), Ogre::BillboardSet::getWorldPosition(), Ogre::TerrainRenderable::getWorldTransforms(), Ogre::SimpleRenderable::getWorldTransforms(), getWorldTransforms(), Ogre::MovableObject::isAttached(), isViewOutOfDate(), Ogre::Camera::isViewOutOfDate(), Ogre::Light::Light(), Ogre::MovableObject::MovableObject(), Ogre::SimpleRenderable::SimpleRenderable(), Ogre::Light::update(), and Ogre::MovableObject::~MovableObject().

Matrix4 Ogre::Frustum::mProjMatrix [protected]
 

Pre-calced projection matrix.

Definition at line 72 of file OgreFrustum.h.

Referenced by Frustum(), getProjectionMatrix(), and updateFrustum().

unsigned long Ogre::MovableObject::mQueryFlags [protected, inherited]
 

Flags determining whether this object is included / excluded from scene queries.

Definition at line 56 of file OgreMovableObject.h.

Referenced by Ogre::MovableObject::MovableObject().

bool Ogre::Frustum::mRecalcFrustum [protected]
 

Something's changed in the frustrum shape?

Definition at line 78 of file OgreFrustum.h.

Referenced by Frustum(), isFrustumOutOfDate(), setAspectRatio(), setFarClipDistance(), setFOVy(), setNearClipDistance(), and updateFrustum().

bool Ogre::Frustum::mRecalcView [protected]
 

Something re the view pos has changed.

Definition at line 80 of file OgreFrustum.h.

Referenced by Frustum(), isViewOutOfDate(), and updateView().

RenderQueueGroupID Ogre::MovableObject::mRenderQueueID [protected, inherited]
 

The render queue to use when rendering this object.

Definition at line 54 of file OgreMovableObject.h.

Referenced by Ogre::Entity::_updateRenderQueue(), Ogre::BillboardSet::_updateRenderQueue(), Ogre::MovableObject::getRenderQueueGroup(), Ogre::MovableObject::MovableObject(), and Ogre::MovableObject::setRenderQueueGroup().

String Ogre::Frustum::msMovableType = "Frustum" [static, protected]
 

Shared class-level name for Movable type.

Definition at line 42 of file OgreFrustum.cpp.

Referenced by getMovableType(), and getName().

Matrix4 Ogre::Frustum::mStandardProjMatrix [protected]
 

Pre-calced standard projection matrix.

Definition at line 74 of file OgreFrustum.h.

Referenced by getStandardProjectionMatrix().

UserDefinedObject* Ogre::MovableObject::mUserObject [protected, inherited]
 

User defined object which is linked to this object.

Definition at line 52 of file OgreMovableObject.h.

Referenced by Ogre::MovableObject::MovableObject().

VertexData Ogre::Frustum::mVertexData [protected]
 

Definition at line 99 of file OgreFrustum.h.

Referenced by Frustum(), getRenderOperation(), and updateFrustum().

Matrix4 Ogre::Frustum::mViewMatrix [protected]
 

Pre-calced view matrix.

Definition at line 76 of file OgreFrustum.h.

Referenced by Frustum(), getViewMatrix(), and updateView().

bool Ogre::MovableObject::mVisible [protected, inherited]
 

Is this object visible?

Definition at line 50 of file OgreMovableObject.h.

Referenced by Frustum(), Ogre::MovableObject::isVisible(), Ogre::MovableObject::MovableObject(), and Ogre::MovableObject::setVisible().

AxisAlignedBox Ogre::MovableObject::mWorldAABB [protected, inherited]
 

Cached world AABB of this object.

Definition at line 58 of file OgreMovableObject.h.

Referenced by Ogre::MovableObject::getWorldBoundingBox(), and Ogre::MovableObject::MovableObject().

Sphere Ogre::MovableObject::mWorldBoundingSphere [protected, inherited]
 

Definition at line 60 of file OgreMovableObject.h.

Referenced by Ogre::MovableObject::getWorldBoundingSphere().


The documentation for this class was generated from the following files:

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:17:25 2004