DigitalSpaces::DIOGRECamera Struct Reference
[Ogre]

#include <OGREInterfaces.h>

Inherits DigitalSpaces::DIObjectBase.


Public Member Functions

DIOGRESceneManagerGetSceneManager (void)
 Returns a pointer to the SceneManager this camera is rendering through.
const char * GetName (void)
 Gets the camera's name.
void SetPolygonMode (OGREPolygonMode sd)
 Sets the level of rendering detail required from this camera.
OGREPolygonMode GetPolygonMode (void)
 Retrieves the level of detail that the camera will render.
void SetPosition (float x, float y, float z)
 Sets the camera's position.
void SetPosition (in_Vector3f *vec)
 Sets the camera's position.
void GetPosition (out_Vector3f *vec)
 Retrieves the camera's position.
void Move (in_Vector3f *vec)
 Moves the camera's position by the vector offset provided along world axes.
void MoveRelative (in_Vector3f *vec)
 Moves the camera's position by the vector offset provided along it's own axes (relative to orientation).
void SetDirection (float x, float y, float z)
 Sets the camera's direction vector.
void SetDirection (in_Vector3f *vec)
 Sets the camera's direction vector.
void GetDirection (out_Vector3f *vec)
void GetUp (out_Vector3f *vec)
 Gets the camera's up vector.
void GetRight (out_Vector3f *vec)
 Gets the camera's right vector.
void LookAt (in_Vector3f *targetPoint)
 Points the camera at a location in worldspace.
void LookAt (float x, float y, float z)
 Points the camera at a location in worldspace.
void RollRadian (const float angle)
 Rolls the camera anticlockwise, around its local z axis.
void RollDegree (const float angle)
void YawRadian (const float angle)
 Rotates the camera anticlockwise around it's local y axis.
void YawDegree (const float angle)
void PitchRadian (const float angle)
 Pitches the camera up/down anticlockwise around it's local z axis.
void PitchDegree (const float angle)
void RotateRadian (in_Vector3f *axis, const float angle)
 Rotate the camera around an arbitrary axis.
void RotateDegree (in_Vector3f *axis, const float angle)
void Rotate (in_Quaternionf *q)
 Rotate the camera around an aritrary axis using a Quarternion.
void SetFixedYawAxis (bool useFixed)
 Tells the camera whether to yaw around it's own local Y axis or a fixed axis of choice.
void SetFixedYawAxis (bool useFixed, in_Vector3f *fixedAxis)
void GetOrientation (out_Quaternionf *q)
 Returns the camera's current orientation.
void SetOrientation (in_Quaternionf *q)
 Sets the camera's orientation.
void GetDerivedOrientation (out_Quaternionf *q)
 Gets the derived orientation of the camera, including any rotation inherited from a node attachment.
void GetDerivedPosition (out_Vector3f *vec)
 Gets the derived position of the camera, including any translation inherited from a node attachment.
void GetDerivedDirection (out_Vector3f *vec)
 Gets the derived direction vector of the camera, including any translation inherited from a node attachment.
void SetAutoTracking (bool enabled)
 Enables / disables automatic tracking of a SceneNode.
void SetAutoTracking (bool enabled, DIOGRESceneNode *target, in_Vector3f *offset)
void SetLodBias ()
 Sets the level-of-detail factor for this Camera.
void SetLodBias (float factor)
float GetLodBias (void)
 Returns the level-of-detail bias factor currently applied to this camera.
DIOGRERayGetCameraToViewportRay (float screenx, float screeny)
 Gets a world space ray as cast from the camera through a viewport position.
void SetWindow (float Left, float Top, float Right, float Bottom)
 Sets the viewing window inside of viewport.
void ResetWindow (void)
 Cancel view window.
bool IsWindowSet (void)
 Returns if a viewport window is being used.
DIOGRESceneNodeGetAutoTrackTarget (void)
 Get the auto tracking target for this camera, if any.
void GetAutoTrackOffset (out_Vector3f *vec)
 Get the auto tracking offset for this camera, if it is auto tracking.
DIOGREViewportGetViewport (void)
 Get the last viewport which was attached to this camera.
void SetAutoAspectRatio (bool autoratio)
 If set to true a vieport that owns this frustum will be able to recalculate the aspect ratio whenever the frustum is resized.
bool GetAutoAspectRatio (void)
 Retreives if AutoAspectRatio is currently set or not.
void SetFOVyRadian (const float fovy)
 Sets the Y-dimension Field Of View (FOV) of the frustum.
void SetFOVyDegree (const float fovy)
float GetFOVyRadian (void)
 Retrieves the frustums Y-dimension Field Of View (FOV).
float GetFOVyDegree (void)
void SetNearClipDistance (float nearDist)
 Sets the position of the near clipping plane.
float GetNearClipDistance (void)
 Sets the position of the near clipping plane.
void SetFarClipDistance (float farDist)
 Sets the distance to the far clipping plane.
float GetFarClipDistance (void)
 Retrieves the distance from the frustum to the far clipping plane.
void SetAspectRatio (float ratio)
 Sets the aspect ratio for the frustum viewport.
float GetAspectRatio (void)
 Retreives the current aspect ratio.
void GetProjectionMatrixWithRSDepth (out_Matrix4f *mat)
 Gets the 'standard' projection matrix for this frustum, ie the projection matrix which conforms to standard right-handed rules.
void GetViewMatrix (out_Matrix4f *mat)
 Gets the view matrix for this frustum.
void GetFrustumPlane (unsigned short plane, out_Vector4f *outPlane)
 Retrieves a specified plane of the frustum.
bool IsVisible (DIOGREAxisAlignedBox *bound)
 Tests whether the given container is visible in the Frustum.
bool IsVisible (DIOGREAxisAlignedBox *bound, OGREFrustumPlane *culledBy)
bool IsVisible (in_Vector4f *sphere)
 Tests whether the given container is visible in the Frustum.
bool IsVisible (in_Vector4f *sphere, OGREFrustumPlane *culledBy)
bool IsVisible (in_Vector3f *vert)
 Tests whether the given vertex is visible in the Frustum.
bool IsVisible (in_Vector3f *vert, OGREFrustumPlane *culledBy)
void SetProjectionType (OGREProjectionType pt)
 Sets the type of projection to use (orthographic or perspective).
OGREProjectionType GetProjectionType (void)
 Retrieves info on the type of projection used (orthographic or perspective).

Member Function Documentation

DIOGRESceneManager* DigitalSpaces::DIOGRECamera::GetSceneManager ( void   ) 

Returns a pointer to the SceneManager this camera is rendering through.

const char* DigitalSpaces::DIOGRECamera::GetName ( void   ) 

Gets the camera's name.

void DigitalSpaces::DIOGRECamera::SetPolygonMode ( OGREPolygonMode  sd  ) 

Sets the level of rendering detail required from this camera.

Remarks:
Each camera is set to render at full detail by default, that is with full texturing, lighting etc. This method lets you change that behaviour, allowing you to make the camera just render a wireframe view, for example.

OGREPolygonMode DigitalSpaces::DIOGRECamera::GetPolygonMode ( void   ) 

Retrieves the level of detail that the camera will render.

void DigitalSpaces::DIOGRECamera::SetPosition ( float  x,
float  y,
float  z 
)

Sets the camera's position.

void DigitalSpaces::DIOGRECamera::SetPosition ( in_Vector3f vec  ) 

Sets the camera's position.

void DigitalSpaces::DIOGRECamera::GetPosition ( out_Vector3f vec  ) 

Retrieves the camera's position.

void DigitalSpaces::DIOGRECamera::Move ( in_Vector3f vec  ) 

Moves the camera's position by the vector offset provided along world axes.

void DigitalSpaces::DIOGRECamera::MoveRelative ( in_Vector3f vec  ) 

Moves the camera's position by the vector offset provided along it's own axes (relative to orientation).

void DigitalSpaces::DIOGRECamera::SetDirection ( float  x,
float  y,
float  z 
)

Sets the camera's direction vector.

Remarks:
Note that the 'up' vector for the camera will automatically be recalculated based on the current 'up' vector (i.e. the roll will remain the same).

void DigitalSpaces::DIOGRECamera::SetDirection ( in_Vector3f vec  ) 

Sets the camera's direction vector.

void DigitalSpaces::DIOGRECamera::GetDirection ( out_Vector3f vec  ) 

void DigitalSpaces::DIOGRECamera::GetUp ( out_Vector3f vec  ) 

Gets the camera's up vector.

void DigitalSpaces::DIOGRECamera::GetRight ( out_Vector3f vec  ) 

Gets the camera's right vector.

void DigitalSpaces::DIOGRECamera::LookAt ( in_Vector3f targetPoint  ) 

Points the camera at a location in worldspace.

Remarks:
This is a helper method to automatically generate the direction vector for the camera, based on it's current position and the supplied look-at point.
Parameters:
targetPoint A vector specifying the look at point.

void DigitalSpaces::DIOGRECamera::LookAt ( float  x,
float  y,
float  z 
)

Points the camera at a location in worldspace.

Remarks:
This is a helper method to automatically generate the direction vector for the camera, based on it's current position and the supplied look-at point.
Parameters:
x 
y 
z Co-ordinates of the point to look at.

void DigitalSpaces::DIOGRECamera::RollRadian ( const float  angle  ) 

Rolls the camera anticlockwise, around its local z axis.

void DigitalSpaces::DIOGRECamera::RollDegree ( const float  angle  ) 

void DigitalSpaces::DIOGRECamera::YawRadian ( const float  angle  ) 

Rotates the camera anticlockwise around it's local y axis.

void DigitalSpaces::DIOGRECamera::YawDegree ( const float  angle  ) 

void DigitalSpaces::DIOGRECamera::PitchRadian ( const float  angle  ) 

Pitches the camera up/down anticlockwise around it's local z axis.

void DigitalSpaces::DIOGRECamera::PitchDegree ( const float  angle  ) 

void DigitalSpaces::DIOGRECamera::RotateRadian ( in_Vector3f axis,
const float  angle 
)

Rotate the camera around an arbitrary axis.

void DigitalSpaces::DIOGRECamera::RotateDegree ( in_Vector3f axis,
const float  angle 
)

void DigitalSpaces::DIOGRECamera::Rotate ( in_Quaternionf q  ) 

Rotate the camera around an aritrary axis using a Quarternion.

void DigitalSpaces::DIOGRECamera::SetFixedYawAxis ( bool  useFixed  ) 

Tells the camera whether to yaw around it's own local Y axis or a fixed axis of choice.

Remarks:
This method allows you to change the yaw behaviour of the camera
  • by default, the camera yaws around a fixed Y axis. This is often what you want - for example if you're making a first-person shooter, you really don't want the yaw axis to reflect the local camera Y, because this would mean a different yaw axis if the player is looking upwards rather than when they are looking straight ahead. You can change this behaviour by calling this method, which you will want to do if you are making a completely free camera like the kind used in a flight simulator.
Parameters:
useFixed If true, the axis passed in the second parameter will always be the yaw axis no matter what the camera orientation. If false, the camera yaws around the local Y.
fixedAxis The axis to use if the first parameter is true.

void DigitalSpaces::DIOGRECamera::SetFixedYawAxis ( bool  useFixed,
in_Vector3f fixedAxis 
)

void DigitalSpaces::DIOGRECamera::GetOrientation ( out_Quaternionf q  ) 

Returns the camera's current orientation.

void DigitalSpaces::DIOGRECamera::SetOrientation ( in_Quaternionf q  ) 

Sets the camera's orientation.

void DigitalSpaces::DIOGRECamera::GetDerivedOrientation ( out_Quaternionf q  ) 

Gets the derived orientation of the camera, including any rotation inherited from a node attachment.

void DigitalSpaces::DIOGRECamera::GetDerivedPosition ( out_Vector3f vec  ) 

Gets the derived position of the camera, including any translation inherited from a node attachment.

void DigitalSpaces::DIOGRECamera::GetDerivedDirection ( out_Vector3f vec  ) 

Gets the derived direction vector of the camera, including any translation inherited from a node attachment.

void DigitalSpaces::DIOGRECamera::SetAutoTracking ( bool  enabled  ) 

Enables / disables automatic tracking of a SceneNode.

Remarks:
If you enable auto-tracking, this Camera will automatically rotate to look at the target SceneNode every frame, no matter how it or SceneNode move. This is handy if you want a Camera to be focused on a single object or group of objects. Note that by default the Camera looks at the origin of the SceneNode, if you want to tweak this, e.g. if the object which is attached to this target node is quite big and you want to point the camera at a specific point on it, provide a vector in the 'offset' parameter and the camera's target point will be adjusted.
Parameters:
enabled If true, the Camera will track the SceneNode supplied as the next parameter (cannot be null). If false the camera will cease tracking and will remain in it's current orientation.
target Pointer to the SceneNode which this Camera will track. Make sure you don't delete this SceneNode before turning off tracking (e.g. SceneManager::clearScene will delete it so be careful of this). Can be null if and only if the enabled param is false.
offset If supplied, the camera targets this point in local space of the target node instead of the origin of the target node. Good for fine tuning the look at point.

void DigitalSpaces::DIOGRECamera::SetAutoTracking ( bool  enabled,
DIOGRESceneNode target,
in_Vector3f offset 
)

void DigitalSpaces::DIOGRECamera::SetLodBias (  ) 

Sets the level-of-detail factor for this Camera.

Remarks:
This method can be used to influence the overall level of detail of the scenes rendered using this camera. Various elements of the scene have level-of-detail reductions to improve rendering speed at distance; this method allows you to hint to those elements that you would like to adjust the level of detail that they would normally use (up or down).
The most common use for this method is to reduce the overall level of detail used for a secondary camera used for sub viewports like rear-view mirrors etc. Note that scene elements are at liberty to ignore this setting if they choose, this is merely a hint.
Parameters:
factor The factor to apply to the usual level of detail calculation. Higher values increase the detail, so 2.0 doubles the normal detail and 0.5 halves it.

void DigitalSpaces::DIOGRECamera::SetLodBias ( float  factor  ) 

float DigitalSpaces::DIOGRECamera::GetLodBias ( void   ) 

Returns the level-of-detail bias factor currently applied to this camera.

Remarks:
See Camera::setLodBias for more details.

DIOGRERay* DigitalSpaces::DIOGRECamera::GetCameraToViewportRay ( float  screenx,
float  screeny 
)

Gets a world space ray as cast from the camera through a viewport position.

Parameters:
screenx,screeny The x and y position at which the ray should intersect the viewport, in normalised screen coordinates [0,1]

void DigitalSpaces::DIOGRECamera::SetWindow ( float  Left,
float  Top,
float  Right,
float  Bottom 
)

Sets the viewing window inside of viewport.

Remarks:
This method can be used to set a subset of the viewport as the rendering target.
Parameters:
Left Relative to Viewport - 0 corresponds to left edge, 1 - to right edge (default - 0).
Top Relative to Viewport - 0 corresponds to top edge, 1 - to bottom edge (default - 0).
Right Relative to Viewport - 0 corresponds to left edge, 1 - to right edge (default - 1).
Bottom Relative to Viewport - 0 corresponds to top edge, 1 - to bottom edge (default - 1).

void DigitalSpaces::DIOGRECamera::ResetWindow ( void   ) 

Cancel view window.

bool DigitalSpaces::DIOGRECamera::IsWindowSet ( void   ) 

Returns if a viewport window is being used.

DIOGRESceneNode* DigitalSpaces::DIOGRECamera::GetAutoTrackTarget ( void   ) 

Get the auto tracking target for this camera, if any.

void DigitalSpaces::DIOGRECamera::GetAutoTrackOffset ( out_Vector3f vec  ) 

Get the auto tracking offset for this camera, if it is auto tracking.

DIOGREViewport* DigitalSpaces::DIOGRECamera::GetViewport ( void   ) 

Get the last viewport which was attached to this camera.

Note:
This is not guaranteed to be the only viewport which is using this camera, just the last once which was created referring to it.

void DigitalSpaces::DIOGRECamera::SetAutoAspectRatio ( bool  autoratio  ) 

If set to true a vieport that owns this frustum will be able to recalculate the aspect ratio whenever the frustum is resized.

Remarks:
You should set this to true only if the frustum / camera is used by one viewport at the same time. Otherwise the aspect ratio for other viewports may be wrong.

bool DigitalSpaces::DIOGRECamera::GetAutoAspectRatio ( void   ) 

Retreives if AutoAspectRatio is currently set or not.

void DigitalSpaces::DIOGRECamera::SetFOVyRadian ( const float  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 edges of the 'screen' onto which the scene is projected. High values (90+ degrees) result in a wide-angle, fish-eye kind of view, low values (30- degrees) in a stretched, telescopic kind of view. Typical values are between 45 and 60 degrees.
This value represents the VERTICAL field-of-view. The horizontal 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.

void DigitalSpaces::DIOGRECamera::SetFOVyDegree ( const float  fovy  ) 

float DigitalSpaces::DIOGRECamera::GetFOVyRadian ( void   ) 

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

float DigitalSpaces::DIOGRECamera::GetFOVyDegree ( void   ) 

void DigitalSpaces::DIOGRECamera::SetNearClipDistance ( float  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.

float DigitalSpaces::DIOGRECamera::GetNearClipDistance ( void   ) 

Sets the position of the near clipping plane.

void DigitalSpaces::DIOGRECamera::SetFarClipDistance ( float  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 method sets the distance for the far end of that pyramid. 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 ratio 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. As it happens, you can affect the accuracy far more by altering the near distance rather than the far distance, but keep this in mind.
Parameters:
far The distance to the far clipping plane from the frustum in world coordinates.If you specify 0, this means an infinite view distance which is useful especially when projecting shadows; but be careful not to use a near distance too close.

float DigitalSpaces::DIOGRECamera::GetFarClipDistance ( void   ) 

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

void DigitalSpaces::DIOGRECamera::SetAspectRatio ( float  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.

float DigitalSpaces::DIOGRECamera::GetAspectRatio ( void   ) 

Retreives the current aspect ratio.

void DigitalSpaces::DIOGRECamera::GetProjectionMatrixWithRSDepth ( out_Matrix4f mat  ) 

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.

void DigitalSpaces::DIOGRECamera::GetViewMatrix ( out_Matrix4f mat  ) 

Gets the view matrix for this frustum.

Mainly for use by OGRE internally.

void DigitalSpaces::DIOGRECamera::GetFrustumPlane ( unsigned short  plane,
out_Vector4f outPlane 
)

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.

bool DigitalSpaces::DIOGRECamera::IsVisible ( DIOGREAxisAlignedBox bound  ) 

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.

bool DigitalSpaces::DIOGRECamera::IsVisible ( DIOGREAxisAlignedBox bound,
OGREFrustumPlane culledBy 
)

bool DigitalSpaces::DIOGRECamera::IsVisible ( in_Vector4f sphere  ) 

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.

bool DigitalSpaces::DIOGRECamera::IsVisible ( in_Vector4f sphere,
OGREFrustumPlane culledBy 
)

bool DigitalSpaces::DIOGRECamera::IsVisible ( in_Vector3f vert  ) 

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.

bool DigitalSpaces::DIOGRECamera::IsVisible ( in_Vector3f vert,
OGREFrustumPlane culledBy 
)

void DigitalSpaces::DIOGRECamera::SetProjectionType ( OGREProjectionType  pt  ) 

Sets the type of projection to use (orthographic or perspective).

Default is perspective.

OGREProjectionType DigitalSpaces::DIOGRECamera::GetProjectionType ( void   ) 

Retrieves info on the type of projection used (orthographic or perspective).


The documentation for this struct was generated from the following file:

Generated on Sun Aug 31 17:46:31 2008 for Digital Spaces by  doxygen 1.5.6