OgreRefApp::CollideCamera Class Reference

#include <OgreRefAppCollideCamera.h>

Inheritance diagram for OgreRefApp::CollideCamera:

Inheritance graph
[legend]
Collaboration diagram for OgreRefApp::CollideCamera:

Collaboration graph
[legend]

List of all members.

Public Member Functions

Camera * getRealCamera (void)
void disableOdeBody ()
void _notifyCollided (SceneQuery::WorldFragment *wf, const CollisionInfo &info)
void _notifyCollided (ApplicationObject *otherObj, const CollisionInfo &info)
void _updateFromDynamics ()
 Updates the position of this game object from the simulation.
void setOrientation (const Quaternion &orientation)
const Quaternion & getOrientation (void)
void translate (const Vector3 &d)
void roll (const Radian &angle)
void pitch (const Radian &angle)
void yaw (const Radian &angle)
void rotate (const Vector3 &axis, const Radian &angle)
void rotate (const Quaternion &q)
void setProjectionType (ProjectionType pt)
ProjectionType getProjectionType (void) const
void setPolygonMode (PolygonMode sd)
PolygonMode getPolygonMode (void) const
void setDirection (Real x, Real y, Real z)
void setDirection (const Vector3 &vec)
void lookAt (const Vector3 &targetPoint)
void lookAt (Real x, Real y, Real z)
void setFixedYawAxis (bool useFixed, const Vector3 &fixedAxis=Vector3::UNIT_Y)
void setFOVy (const Radian &fovy)
const Radian & getFOVy (void) const
void setNearClipDistance (Real nearDist)
Real getNearClipDistance (void) const
void setFarClipDistance (Real farDist)
Real getFarClipDistance (void) const
void setAspectRatio (Real ratio)
Real getAspectRatio (void) const
const Plane & getFrustumPlane (FrustumPlane plane)
bool isVisible (const AxisAlignedBox &bound, FrustumPlane *culledBy=0)
bool isVisible (const Sphere &bound, FrustumPlane *culledBy=0)
bool isVisible (const Vector3 &vert, FrustumPlane *culledBy=0)

Protected Member Functions

void setUp (const String &name)
 Set up.
void nearDistChanged (void)
 Triggers recacl of collison bounds.

Protected Attributes

Camera * mCamera
 Contained camera.


Detailed Description

Character camera physics definitions

Member Function Documentation

Camera* OgreRefApp::CollideCamera::getRealCamera ( void   )  [inline]

Gets the internal Camera object.

void OgreRefApp::CollideCamera::disableOdeBody (  ) 

Facilitator camera does not have a body

void OgreRefApp::CollideCamera::_notifyCollided ( SceneQuery::WorldFragment *  wf,
const CollisionInfo info 
) [virtual]

This method is called automatically if testCollide indicates a real collision.

Reimplemented from OgreRefApp::ApplicationObject.

void OgreRefApp::CollideCamera::_notifyCollided ( ApplicationObject otherObj,
const CollisionInfo info 
) [virtual]

This method is called automatically if testCollide indicates a real collision.

Reimplemented from OgreRefApp::ApplicationObject.

void OgreRefApp::CollideCamera::setOrientation ( const Quaternion &  orientation  )  [virtual]

Sets the orientation of this object.

Reimplemented from OgreRefApp::ApplicationObject.

const Quaternion & OgreRefApp::CollideCamera::getOrientation ( void   )  [virtual]

Gets the current orientation of this object.

Reimplemented from OgreRefApp::ApplicationObject.

void OgreRefApp::CollideCamera::translate ( const Vector3 &  d  )  [virtual]

Moves the object along it's local axes.

This method moves the object by the supplied vector along the local axes of the obect.
Parameters:
d Vector with x,y,z values representing the translation.

Reimplemented from OgreRefApp::ApplicationObject.

void OgreRefApp::CollideCamera::roll ( const Radian &  angle  )  [virtual]

Rotate the object around the local Z-axis.

Reimplemented from OgreRefApp::ApplicationObject.

void OgreRefApp::CollideCamera::pitch ( const Radian &  angle  )  [virtual]

Rotate the object around the local X-axis.

Reimplemented from OgreRefApp::ApplicationObject.

void OgreRefApp::CollideCamera::yaw ( const Radian &  angle  )  [virtual]

Rotate the object around the local Y-axis.

Reimplemented from OgreRefApp::ApplicationObject.

void OgreRefApp::CollideCamera::rotate ( const Vector3 &  axis,
const Radian &  angle 
) [virtual]

Rotate the object around an arbitrary axis.

Reimplemented from OgreRefApp::ApplicationObject.

void OgreRefApp::CollideCamera::rotate ( const Quaternion &  q  )  [virtual]

Rotate the object around an aritrary axis using a Quarternion.

Reimplemented from OgreRefApp::ApplicationObject.

void OgreRefApp::CollideCamera::setProjectionType ( ProjectionType  pt  ) 

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

ProjectionType OgreRefApp::CollideCamera::getProjectionType ( void   )  const

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

void OgreRefApp::CollideCamera::setPolygonMode ( PolygonMode  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.

PolygonMode OgreRefApp::CollideCamera::getPolygonMode ( void   )  const

Retrieves the level of detail that the camera will render.

void OgreRefApp::CollideCamera::setDirection ( Real  x,
Real  y,
Real  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 OgreRefApp::CollideCamera::setDirection ( const Vector3 &  vec  ) 

Sets the camera's direction vector.

void OgreRefApp::CollideCamera::lookAt ( const Vector3 &  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 OgreRefApp::CollideCamera::lookAt ( Real  x,
Real  y,
Real  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 OgreRefApp::CollideCamera::setFixedYawAxis ( bool  useFixed,
const Vector3 &  fixedAxis = Vector3::UNIT_Y 
)

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 it's own local Y axis. This is often what you want - for example a flying camera
  • but sometimes this produces unwanted effects. 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 setting the yaw to a fixed axis (say, the world Y).
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 returns to it's default behaviour.
fixedAxis The axis to use if the first parameter is true.

void OgreRefApp::CollideCamera::setFOVy ( const Radian &  fovy  ) 

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

Remarks:
Field Of View (FOV) is the angle made between the camera'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 Camera::setNearClipPlane.

const Radian & OgreRefApp::CollideCamera::getFOVy ( void   )  const

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

void OgreRefApp::CollideCamera::setNearClipDistance ( Real  nearDist  ) 

Sets the position of the near clipping plane.

Remarks:
The position of the near clipping plane is the distance from the cameras 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 cameras 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 camera in world coordinates.

Real OgreRefApp::CollideCamera::getNearClipDistance ( void   )  const

Sets the position of the near clipping plane.

void OgreRefApp::CollideCamera::setFarClipDistance ( Real  farDist  ) 

Sets the distance to the far clipping plane.

Remarks:
The view frustrum is a pyramid created from the camera position and the edges of the viewport. This frustrum does not extend to infinity - it is cropped near to the camera 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 camera 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 camera in world coordinates.

Real OgreRefApp::CollideCamera::getFarClipDistance ( void   )  const

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

void OgreRefApp::CollideCamera::setAspectRatio ( Real  ratio  ) 

Sets the aspect ratio for the camera viewport.

Remarks:
The ratio between the x and y dimensions of the rectangular area visible through the camera 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.

Real OgreRefApp::CollideCamera::getAspectRatio ( void   )  const

Retreives the current aspect ratio.

const Plane & OgreRefApp::CollideCamera::getFrustumPlane ( FrustumPlane  plane  ) 

Retrieves a specified plane of the frustum.

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

bool OgreRefApp::CollideCamera::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.

bool OgreRefApp::CollideCamera::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.

bool OgreRefApp::CollideCamera::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.


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

Generated on Sun Jun 15 18:43:30 2008 for SpadeShip Project by  doxygen 1.5.5