DXGfxLib.Avatar Class Reference

The avatar is a special scene node. It is meant to be used in conjonction with a class implementing IInputHandler. The input handler will be notified of events and will pass relevant information both to the camera and the avatar. Each of these could also possibly implement its own logic to react to event. At the moment this is a bit overengineered as we have only a ThirdPersonCamera and a Base avatar class but this could change in the future. More...

Collaboration diagram for DXGfxLib.Avatar:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Avatar (SceneObject sceneObj)
 We also want to be able to build one from a SceneObject.
void MoveTo (Vector3 desiredDestination)
 Call this method to indicate to the Avatar who want it to move to the specified location.
void StopMoving ()
 Well name of the method is quite explicit. No argument needed :).
void FrameMove (float elapsedTime)
 We use that function to update the Avatar on a regular basis. In the base class this is only used to move the Avatar at the speed specified by the speed member variable to the destination indicated by destination member, all this happen if the currentState of the Avatar is moving. If instead the current state is resting then this method doesn't perform anything in fact ! The base Avatar class is not so interesting for movements. The Avatar will only go to its destination whatever it may be. It will attempt to do so by flying !! In fact for any specific situation this class will most probably be overriden. For example we could have biped, quadriped, plane, car classes deriving from Avatar ! So on top of moving the Avatar this FrameMove method could also trigger the appropriate animation.
 Avatar (SceneObject sceneObj)
 We also want to be able to build one from a SceneObject.
void MoveTo (Vector3 desiredDestination)
 Call this method to indicate to the Avatar who want it to move to the specified location.
void StopMoving ()
 Well name of the method is quite explicit. No argument needed :).
void FrameMove (float elapsedTime)
 We use that function to update the Avatar on a regular basis. In the base class this is only used to move the Avatar at the speed specified by the speed member variable to the destination indicated by destination member, all this happen if the currentState of the Avatar is moving. If instead the current state is resting then this method doesn't perform anything in fact ! The base Avatar class is not so interesting for movements. The Avatar will only go to its destination whatever it may be. It will attempt to do so by flying !! In fact for any specific situation this class will most probably be overriden. For example we could have biped, quadriped, plane, car classes deriving from Avatar ! So on top of moving the Avatar this FrameMove method could also trigger the appropriate animation.

Public Attributes

float speed = 1.0f
 The base avatar class will implement a basic move to functionnality. If you call the MoveTo method on an avatar he will remember its destination and move to reach that point of 3D space at the below speed.
Vector3 destination
 We need to keep track of where we want to go.
AvatarState currentState = AvatarState.Resting
 Our current state. It is important to know in some function if we are still moving or not for example. Derived Avatar class might have a lot of additional different state.
SceneObject associatedSceneObject = null
 An Avatar needs to be attached to a sceneObject if you want it to be visible.


Detailed Description

The avatar is a special scene node. It is meant to be used in conjonction with a class implementing IInputHandler. The input handler will be notified of events and will pass relevant information both to the camera and the avatar. Each of these could also possibly implement its own logic to react to event. At the moment this is a bit overengineered as we have only a ThirdPersonCamera and a Base avatar class but this could change in the future.

Definition at line 19 of file Avatar.cs.


Constructor & Destructor Documentation

DXGfxLib.Avatar.Avatar ( SceneObject  sceneObj  ) 

We also want to be able to build one from a SceneObject.

Parameters:
sceneObj 

Definition at line 63 of file Avatar.cs.

DXGfxLib.Avatar.Avatar ( SceneObject  sceneObj  ) 

We also want to be able to build one from a SceneObject.

Parameters:
sceneObj 

Definition at line 63 of file Avatar.cs.


Member Function Documentation

void DXGfxLib.Avatar.FrameMove ( float  elapsedTime  ) 

We use that function to update the Avatar on a regular basis. In the base class this is only used to move the Avatar at the speed specified by the speed member variable to the destination indicated by destination member, all this happen if the currentState of the Avatar is moving. If instead the current state is resting then this method doesn't perform anything in fact ! The base Avatar class is not so interesting for movements. The Avatar will only go to its destination whatever it may be. It will attempt to do so by flying !! In fact for any specific situation this class will most probably be overriden. For example we could have biped, quadriped, plane, car classes deriving from Avatar ! So on top of moving the Avatar this FrameMove method could also trigger the appropriate animation.

Parameters:
elapsedTime 

Definition at line 99 of file Avatar.cs.

Here is the call graph for this function:

void DXGfxLib.Avatar.FrameMove ( float  elapsedTime  ) 

We use that function to update the Avatar on a regular basis. In the base class this is only used to move the Avatar at the speed specified by the speed member variable to the destination indicated by destination member, all this happen if the currentState of the Avatar is moving. If instead the current state is resting then this method doesn't perform anything in fact ! The base Avatar class is not so interesting for movements. The Avatar will only go to its destination whatever it may be. It will attempt to do so by flying !! In fact for any specific situation this class will most probably be overriden. For example we could have biped, quadriped, plane, car classes deriving from Avatar ! So on top of moving the Avatar this FrameMove method could also trigger the appropriate animation.

Parameters:
elapsedTime 

Definition at line 99 of file Avatar.cs.

Here is the call graph for this function:

void DXGfxLib.Avatar.MoveTo ( Vector3  desiredDestination  ) 

Call this method to indicate to the Avatar who want it to move to the specified location.

Parameters:
desiredDestination 

Definition at line 72 of file Avatar.cs.

void DXGfxLib.Avatar.MoveTo ( Vector3  desiredDestination  ) 

Call this method to indicate to the Avatar who want it to move to the specified location.

Parameters:
desiredDestination 

Definition at line 72 of file Avatar.cs.

Here is the caller graph for this function:

void DXGfxLib.Avatar.StopMoving (  ) 

Well name of the method is quite explicit. No argument needed :).

Definition at line 81 of file Avatar.cs.

void DXGfxLib.Avatar.StopMoving (  ) 

Well name of the method is quite explicit. No argument needed :).

Definition at line 81 of file Avatar.cs.


Member Data Documentation

An Avatar needs to be attached to a sceneObject if you want it to be visible.

Definition at line 42 of file Avatar.cs.

Our current state. It is important to know in some function if we are still moving or not for example. Derived Avatar class might have a lot of additional different state.

Definition at line 37 of file Avatar.cs.

We need to keep track of where we want to go.

Definition at line 31 of file Avatar.cs.

float DXGfxLib.Avatar::speed = 1.0f

The base avatar class will implement a basic move to functionnality. If you call the MoveTo method on an avatar he will remember its destination and move to reach that point of 3D space at the below speed.

Definition at line 26 of file Avatar.cs.


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

Generated on Thu Jan 8 20:48:34 2009 for DXGfx by  doxygen 1.5.8