TalanSoft Toolkits  201707
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
List of all members
iCamera Struct Referenceabstract
Inheritance diagram for iCamera:
iUnknown

Detailed Description

Camera interface.

General

virtual void Copy (const iCamera *pSrc)=0
 Copy the camera. More...
 
virtual iCameraClone () const =0
 Clone the camera. More...
 
virtual ni::sMatrixf GetWorldMatrix () const =0
 Get the world matrix. {Property}. More...
 
virtual ni::sMatrixf GetViewMatrix () const =0
 Get the view matrix. {Property}. More...
 
virtual ni::sMatrixf GetProjectionMatrix () const =0
 Get the projection matrix. {Property}. More...
 
virtual ni::iFrustumGetFrustum () const =0
 Get the frustum. {Property}. More...
 
virtual ni::sVec3f GetRay (ni::tF32 afX, ni::tF32 afY, const ni::sRectf &aRect)=0
 Compute a ray from the given screen position and rectangle. More...
 
virtual sVec3f GetRayStart () const =0
 Get the starting point of the last ray {Property}. More...
 
virtual ni::sVec3f GetScreenPosition (const ni::sVec3f &avPos, const ni::sRectf &aRect) const =0
 Get a screen position from the given 3d position. More...
 
virtual void SetViewMatrix (const sMatrixf &aViewMatrix)=0
 Set the view matrix directly. More...
 
virtual void SetProjectionMatrix (const sMatrixf &aProjMatrix)=0
 Set the projection matrix directly. More...
 
virtual void SetFromWorldMatrix (const ni::sMatrixf &aMatrix, tBool abSetUp)=0
 Set the camera position, target and up vector from a matrix. More...
 

Projection setup

virtual void SetProjection (eCameraProjectionType aProjectionType)=0
 Set projection type. {Property}. More...
 
virtual eCameraProjectionType GetProjection () const =0
 Get orthogonal projection. {Property}. More...
 
virtual void SetViewport (const ni::sRectf &aRect)=0
 Set the camera's viewport rectangle. {Property}. More...
 
virtual ni::sRectf GetViewport () const =0
 Get the camera's viewport rectangle. {Property}. More...
 
virtual void SetFov (ni::tF32 fFOV)=0
 Set the vertical field of view. {Property}. More...
 
virtual ni::tF32 GetFov () const =0
 Get the vertical field of view. {Property}. More...
 
virtual void SetAspect (ni::tF32 fAspect)=0
 Set the aspect ratio. {Property}. More...
 
virtual ni::tF32 GetAspect () const =0
 Get the aspect ratio. {Property}. More...
 
virtual ni::tF32 GetAbsoluteAspect () const =0
 Get the absolute aspect ratio. {Property}. More...
 
virtual void SetNearClipPlane (ni::tF32 afD)=0
 Set the near clipping plane. {Property}. More...
 
virtual ni::tF32 GetNearClipPlane () const =0
 Get the near clipping plane. {Property}. More...
 
virtual void SetFarClipPlane (ni::tF32 afD)=0
 Set the far clipping plane. {Property}. More...
 
virtual ni::tF32 GetFarClipPlane () const =0
 Get the far clipping plane. {Property}. More...
 
virtual void SetOrthoSize (tF32 afSize)=0
 Set the orthogonal projection size. {Property}. More...
 
virtual ni::tF32 GetOrthoSize () const =0
 Get the orthogonal projection size. {Property}. More...
 

Position

virtual void SetPosition (const ni::sVec3f &vPos)=0
 Set the position. {Property}. More...
 
virtual ni::sVec3f GetPosition () const =0
 Get the position. {Property}. More...
 
virtual void SetTarget (const ni::sVec3f &avTarget)=0
 Set the target. {Property}. More...
 
virtual ni::sVec3f GetTarget () const =0
 Get the target. {Property}. More...
 
virtual void SetTargetUp (const ni::sVec3f &avUp)=0
 Set the target up vector. {Property}. More...
 
virtual ni::sVec3f GetTargetUp () const =0
 Get the target up vector. {Property}. More...
 
virtual void SetTargetDistance (ni::tF32 afDist)=0
 Set the distance between the camera and it's target by moving the target. {Property}. More...
 
virtual ni::tF32 GetTargetDistance () const =0
 Get the distance between the camera and it's target. {Property}. More...
 
virtual void SetPositionDistance (ni::tF32 afDist)=0
 Set the distance between the camera and it's target by moving the position. {Property}. More...
 
virtual ni::tF32 GetPositionDistance () const =0
 Get the distance between the camera and it's target. {Property}. More...
 
virtual void SetTargetDirection (const ni::sVec3f &avDir)=0
 Set the direction of the target. {Property}. More...
 
virtual ni::sVec3f GetTargetDirection () const =0
 Get the direction of the target. {Property}. More...
 

Movements

virtual void SetMoveType (eCameraMoveType aMode)=0
 Set the camera move mode. {Property}. More...
 
virtual eCameraMoveType GetMoveType () const =0
 Get the camera move mode. {Property}. More...
 
virtual void MoveSidewards (ni::tF32 delta)=0
 Move the camera sidewards relatively to itself. (X axis) More...
 
virtual void MoveUp (ni::tF32 delta)=0
 Move the camera upward relatively to itself. (Y axis) More...
 
virtual void MoveForward (ni::tF32 delta)=0
 Move the camera forward relatively to itself. (Y axis) More...
 
virtual void SetMove (const ni::sVec3f &avMove)=0
 Set the relative movement vector. (x+ sidewards, y+ upwards and z+ forward) {Property}. More...
 
virtual ni::sVec3f GetMove () const =0
 Get the relative movement vector. {Property}. More...
 

Orientation

virtual void RotateTarget (ni::sVec3f avAxis, ni::tF32 afAngle)=0
 Rotates the target around the specified axis. More...
 
virtual void RotateTargetUp (ni::sVec3f avAxis, ni::tF32 afAngle)=0
 Rotates the target up around the specified axis. More...
 
virtual void AddYaw (ni::tF32 a)=0
 Rotates the target up around the specified axis. Add yaw. More...
 
virtual void AddPitch (ni::tF32 a)=0
 Add pitch. More...
 
virtual void AddRoll (ni::tF32 a)=0
 Add roll. More...
 
virtual void OrbitUp (ni::tF32 afA)=0
 Orbit up/down the position of the camera around the current target. More...
 
virtual void OrbitSidewards (ni::tF32 afA)=0
 Orbit left/right the position of the camera around the current target. More...
 
virtual ni::sVec3f GetForward () const =0
 Get the forward vector. {Property}. More...
 
virtual ni::sVec3f GetRight () const =0
 Get the right vector. {Property}. More...
 
virtual ni::sVec3f GetUp () const =0
 Get the up vector. {Property}. More...
 

Additional Inherited Members

- Public Member Functions inherited from iUnknown
virtual tBool IsOK () const =0
 Check if the object is valid. More...
 
virtual tI32 AddRef ()=0
 Signal that one more reference of the object has been created. More...
 
virtual tI32 Release ()=0
 Release a reference of the object. More...
 
virtual void DeleteThis ()=0
 Bypass any reference counting and delete this object. More...
 
virtual void Invalidate ()=0
 Invalidate the object. More...
 
virtual iUnknownQueryInterface (const tUUID &aIID)=0
 Query an interface. More...
 
virtual void ListInterfaces (iMutableCollection *apLst, tU32 anFlags) const =0
 Fill a UUID list containing the UUIDs of the implemented interfaces. More...
 
virtual tI32 SetNumRefs (tI32 anNumRefs)=0
 Set the reference counter directly. More...
 
virtual tI32 GetNumRefs () const =0
 Get the number of references to this object. More...
 

Member Function Documentation

virtual void Copy ( const iCamera pSrc)
pure virtual

Copy the camera.

virtual iCamera* Clone ( ) const
pure virtual

Clone the camera.

virtual ni::sMatrixf GetWorldMatrix ( ) const
pure virtual

Get the world matrix. {Property}.

virtual ni::sMatrixf GetViewMatrix ( ) const
pure virtual

Get the view matrix. {Property}.

virtual ni::sMatrixf GetProjectionMatrix ( ) const
pure virtual

Get the projection matrix. {Property}.

virtual ni::iFrustum* GetFrustum ( ) const
pure virtual

Get the frustum. {Property}.

virtual ni::sVec3f GetRay ( ni::tF32  afX,
ni::tF32  afY,
const ni::sRectf aRect 
)
pure virtual

Compute a ray from the given screen position and rectangle.

Returns
The normalized direction of a ray going starting at RayStart and going in the direction of the point in the specified rectangle projected in the camera's space.
Remarks
The starting point of the ray should be retrieved with iCamera::GetRayStart(), while it usually coincide with the camera's position it might not always be the case (such as for orthographic projections).
This method is commonly used to build a ray to be used by picking in camera space.
virtual sVec3f GetRayStart ( ) const
pure virtual

Get the starting point of the last ray {Property}.

virtual ni::sVec3f GetScreenPosition ( const ni::sVec3f avPos,
const ni::sRectf aRect 
) const
pure virtual

Get a screen position from the given 3d position.

virtual void SetViewMatrix ( const sMatrixf aViewMatrix)
pure virtual

Set the view matrix directly.

Remarks
This should one be used with eCameraMoveType_None. {Property}
virtual void SetProjectionMatrix ( const sMatrixf aProjMatrix)
pure virtual

Set the projection matrix directly.

Remarks
This should one be used with eCameraProjectionType_None. {Property}
virtual void SetFromWorldMatrix ( const ni::sMatrixf aMatrix,
tBool  abSetUp 
)
pure virtual

Set the camera position, target and up vector from a matrix.

Parameters
aMatrixis the matrix from which the new camera position and target will be derived
abSetUpif true the target's up vector will also be derived from the specifed matrix.
virtual void SetProjection ( eCameraProjectionType  aProjectionType)
pure virtual

Set projection type. {Property}.

virtual eCameraProjectionType GetProjection ( ) const
pure virtual

Get orthogonal projection. {Property}.

virtual void SetViewport ( const ni::sRectf aRect)
pure virtual

Set the camera's viewport rectangle. {Property}.

virtual ni::sRectf GetViewport ( ) const
pure virtual

Get the camera's viewport rectangle. {Property}.

virtual void SetFov ( ni::tF32  fFOV)
pure virtual

Set the vertical field of view. {Property}.

virtual ni::tF32 GetFov ( ) const
pure virtual

Get the vertical field of view. {Property}.

virtual void SetAspect ( ni::tF32  fAspect)
pure virtual

Set the aspect ratio. {Property}.

Remarks
If the aspect ratio is 0, the aspect of the viewport is used.
virtual ni::tF32 GetAspect ( ) const
pure virtual

Get the aspect ratio. {Property}.

virtual ni::tF32 GetAbsoluteAspect ( ) const
pure virtual

Get the absolute aspect ratio. {Property}.

Remarks
The absolute aspect ratio is the aspect ratio of the viewport if the aspect is <= 0.
virtual void SetNearClipPlane ( ni::tF32  afD)
pure virtual

Set the near clipping plane. {Property}.

virtual ni::tF32 GetNearClipPlane ( ) const
pure virtual

Get the near clipping plane. {Property}.

virtual void SetFarClipPlane ( ni::tF32  afD)
pure virtual

Set the far clipping plane. {Property}.

virtual ni::tF32 GetFarClipPlane ( ) const
pure virtual

Get the far clipping plane. {Property}.

virtual void SetOrthoSize ( tF32  afSize)
pure virtual

Set the orthogonal projection size. {Property}.

virtual ni::tF32 GetOrthoSize ( ) const
pure virtual

Get the orthogonal projection size. {Property}.

Remarks
Height of the othogonal projection, Width = OrthoSize * AbsoluteAspect
virtual void SetPosition ( const ni::sVec3f vPos)
pure virtual

Set the position. {Property}.

virtual ni::sVec3f GetPosition ( ) const
pure virtual

Get the position. {Property}.

virtual void SetTarget ( const ni::sVec3f avTarget)
pure virtual

Set the target. {Property}.

virtual ni::sVec3f GetTarget ( ) const
pure virtual

Get the target. {Property}.

virtual void SetTargetUp ( const ni::sVec3f avUp)
pure virtual

Set the target up vector. {Property}.

virtual ni::sVec3f GetTargetUp ( ) const
pure virtual

Get the target up vector. {Property}.

virtual void SetTargetDistance ( ni::tF32  afDist)
pure virtual

Set the distance between the camera and it's target by moving the target. {Property}.

virtual ni::tF32 GetTargetDistance ( ) const
pure virtual

Get the distance between the camera and it's target. {Property}.

virtual void SetPositionDistance ( ni::tF32  afDist)
pure virtual

Set the distance between the camera and it's target by moving the position. {Property}.

virtual ni::tF32 GetPositionDistance ( ) const
pure virtual

Get the distance between the camera and it's target. {Property}.

virtual void SetTargetDirection ( const ni::sVec3f avDir)
pure virtual

Set the direction of the target. {Property}.

Remarks
The direction is from the camera to the target.
The direction is a normal vector.
virtual ni::sVec3f GetTargetDirection ( ) const
pure virtual

Get the direction of the target. {Property}.

Remarks
The direction is from the camera to the target.
The direction is a normal vector.
virtual void SetMoveType ( eCameraMoveType  aMode)
pure virtual

Set the camera move mode. {Property}.

virtual eCameraMoveType GetMoveType ( ) const
pure virtual

Get the camera move mode. {Property}.

virtual void MoveSidewards ( ni::tF32  delta)
pure virtual

Move the camera sidewards relatively to itself. (X axis)

virtual void MoveUp ( ni::tF32  delta)
pure virtual

Move the camera upward relatively to itself. (Y axis)

virtual void MoveForward ( ni::tF32  delta)
pure virtual

Move the camera forward relatively to itself. (Y axis)

virtual void SetMove ( const ni::sVec3f avMove)
pure virtual

Set the relative movement vector. (x+ sidewards, y+ upwards and z+ forward) {Property}.

virtual ni::sVec3f GetMove ( ) const
pure virtual

Get the relative movement vector. {Property}.

virtual void RotateTarget ( ni::sVec3f  avAxis,
ni::tF32  afAngle 
)
pure virtual

Rotates the target around the specified axis.

virtual void RotateTargetUp ( ni::sVec3f  avAxis,
ni::tF32  afAngle 
)
pure virtual

Rotates the target up around the specified axis.

virtual void AddYaw ( ni::tF32  a)
pure virtual

Rotates the target up around the specified axis. Add yaw.

Remarks
Rotates the target around the Y axis.
virtual void AddPitch ( ni::tF32  a)
pure virtual

Add pitch.

Remarks
Rotates the target around the right axis projected on the XZ plane.
virtual void AddRoll ( ni::tF32  a)
pure virtual

Add roll.

Remarks
Rotates the target up around the forward axis projected on the XZ plane.
virtual void OrbitUp ( ni::tF32  afA)
pure virtual

Orbit up/down the position of the camera around the current target.

Remarks
Rotates the position around the target about it's right axis.
The rotation is clamped to the the pole of the orbit sphere, so that trying to orbit up when the camera is already at the north/top pole will not have any effect, and reciprocicaly at the south/bottom pole.
virtual void OrbitSidewards ( ni::tF32  afA)
pure virtual

Orbit left/right the position of the camera around the current target.

Remarks
Rotates the position around the target about the y axis.
virtual ni::sVec3f GetForward ( ) const
pure virtual

Get the forward vector. {Property}.

virtual ni::sVec3f GetRight ( ) const
pure virtual

Get the right vector. {Property}.

virtual ni::sVec3f GetUp ( ) const
pure virtual

Get the up vector. {Property}.