C# Class Vitaboy.AvatarBase

Class for drawing and updating the meshes that make up an avatar. Also responsible for animating an avatar.
Inheritance: IDisposable
Show file Open project: Afr0Games/Project-Dollhouse Class Usage Examples

Public Properties

Property Type Description
Animation Files.Vitaboy.Anim
HeadMesh Files.Vitaboy.Mesh
LeftHandTexture Microsoft.Xna.Framework.Graphics.Texture2D
RotationRange float
RotationSpeed float
RotationStartAngle float
ShouldRotate bool
Skel Files.Vitaboy.Skeleton

Protected Properties

Property Type Description
m_BodyEffect Microsoft.Xna.Framework.Graphics.BasicEffect
m_Devc GraphicsDevice

Public Methods

Method Description
AdvanceFrame ( Anim Animation, float TimeDelta ) : void

Advances the frame of an animation for a skeleton used on this mesh.

AvatarBase ( GraphicsDevice Devc, Skeleton Skel ) : System

Creates a new instance of AvatarBase.

ChangeOutfit ( Outfit Oft, SkinType Type ) : void

Changes this avatar's outfit.

ComputeBonePositions ( Bone bone, Matrix world ) : void

Computes the absolute positions for all bones in a Skeleton.

Dispose ( ) : void
Render ( Matrix ViewMatrix, Matrix WorldMatrix, Matrix ProjectionMatrix ) : void

Renders the different meshes making up this avatar.

SetHead ( Outfit HeadOutfit, SkinType Type ) : void

Sets this avatar's head outfit.

Update ( GameTime GTime ) : void

Updates this avatar's rotation.

Protected Methods

Method Description
Dispose ( bool CleanUpManagedResources ) : void

Private Methods

Method Description
DegreesToRadians ( double Angle ) : double

Converts an angle given in degrees to radians.

TransformVertices ( Mesh Msh, Bone bone, MeshType MshType ) : void

Transforms all vertices in a given mesh to their correct positions.

Method Details

AdvanceFrame() public method

Advances the frame of an animation for a skeleton used on this mesh.
public AdvanceFrame ( Anim Animation, float TimeDelta ) : void
Animation Files.Vitaboy.Anim The animation to advance.
TimeDelta float The timedelta of the rendering loop.
return void

AvatarBase() public method

Creates a new instance of AvatarBase.
public AvatarBase ( GraphicsDevice Devc, Skeleton Skel ) : System
Devc GraphicsDevice A GraphicsDevice instance.
Skel Files.Vitaboy.Skeleton A Skeleton instance.
return System

ChangeOutfit() public method

Changes this avatar's outfit.
public ChangeOutfit ( Outfit Oft, SkinType Type ) : void
Oft Files.Vitaboy.Outfit
Type SkinType
return void

ComputeBonePositions() public method

Computes the absolute positions for all bones in a Skeleton.
public ComputeBonePositions ( Bone bone, Matrix world ) : void
bone Files.Vitaboy.Bone The first bone in the skeleton.
world Matrix World matrix.
return void

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool CleanUpManagedResources ) : void
CleanUpManagedResources bool
return void

Render() public method

Renders the different meshes making up this avatar.
public Render ( Matrix ViewMatrix, Matrix WorldMatrix, Matrix ProjectionMatrix ) : void
ViewMatrix Matrix A view matrix.
WorldMatrix Matrix A world matrix.
ProjectionMatrix Matrix A projection matrix.
return void

SetHead() public method

Sets this avatar's head outfit.
public SetHead ( Outfit HeadOutfit, SkinType Type ) : void
HeadOutfit Files.Vitaboy.Outfit
Type SkinType
return void

Update() public method

Updates this avatar's rotation.
public Update ( GameTime GTime ) : void
GTime Microsoft.Xna.Framework.GameTime A GameTime instance.
return void

Property Details

Animation public property

public Anim,Files.Vitaboy Animation
return Files.Vitaboy.Anim

HeadMesh public property

public Mesh,Files.Vitaboy HeadMesh
return Files.Vitaboy.Mesh

LeftHandTexture public property

public Texture2D,Microsoft.Xna.Framework.Graphics LeftHandTexture
return Microsoft.Xna.Framework.Graphics.Texture2D

RotationRange public property

public float RotationRange
return float

RotationSpeed public property

public float RotationSpeed
return float

RotationStartAngle public property

public float RotationStartAngle
return float

ShouldRotate public property

Should this avatar be rotated when rendered? Used for rendering in UI.
public bool ShouldRotate
return bool

Skel public property

public Skeleton,Files.Vitaboy Skel
return Files.Vitaboy.Skeleton

m_BodyEffect protected property

protected BasicEffect,Microsoft.Xna.Framework.Graphics m_BodyEffect
return Microsoft.Xna.Framework.Graphics.BasicEffect

m_Devc protected property

protected GraphicsDevice m_Devc
return GraphicsDevice