Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

Sprite Class Reference

#include <sprite.h>

Inheritance diagram for Sprite:

Inheritance graph
[legend]
Collaboration diagram for Sprite:

Collaboration graph
[legend]
List of all members.

Detailed Description

A sprite always faces the camera, but can have size, position and rotation around viewing axis.

Author:
Mattias Jansson (mattias@realityrift.com)


Public Member Functions

 Sprite (const MaterialPtr &pkMaterial, float fSizeX=0.0f, float fSizeY=0.0f, const VertexDeclaration *pkFormat=&TexVertex::s_kDecl)
virtual ~Sprite ()
virtual bool Render (Frustum *pkFrustum=0, bool bForce=false)
void SetSize (float fSizeX, float fSizeY, bool bSetDefaultTexCoords=false)
void SetRotation (float fRot)
void Rotate (float fRot)
SceneNodeGetSceneNode ()
BoundingVolumeGetBoundingVolume ()
void SetBoundingVolume (BoundingVolume *pkBoundingVolume)
virtual SceneEntityDuplicate ()
virtual bool Intersection (BoundingVolume *pkObj, ContactSet *pkContactSet=0, bool bInvertNormal=false)
virtual bool Intersection (const Ray &rkRay, ContactSet *pkContactSet=0)
virtual void Update (float fDeltaTime)
bool IsActive () const
virtual void Activate ()
virtual void Deactivate ()
bool Toggle ()
virtual void Accept (BaseVisitor &rkVisitor)=0

Public Attributes

VertexBufferPtr m_pkVertexBuffer
PolygonStripBufferPtr m_pkPolygonBuffer
MaterialPtr m_pkMaterial
unsigned int m_uiLastFrame

Static Public Attributes

unsigned int s_uiFrameCount

Protected Member Functions

virtual void SetNode ()

Static Protected Member Functions

template<class NodeType> void AcceptImpl (NodeType &rkVisited, BaseVisitor &rkVisitor)

Protected Attributes

float m_afSize [2]
float m_fRotation
SceneNodem_pkNode
BoundingVolumem_pkBoundingVolume
bool m_bActive


Constructor & Destructor Documentation

Sprite const MaterialPtr &  pkMaterial,
float  fSizeX = 0.0f,
float  fSizeY = 0.0f,
const VertexDeclaration pkFormat = &TexVertex::s_kDecl
 

Create vertex and polygon buffers, setup position (and optionally default texture) data in vertex buffer

Parameters:
pkMaterial Material for sprite
fSizeX Size in x direction
fSizeY Size in y direction
pkFormat Vertex format declaration

virtual ~Sprite  )  [virtual]
 


Member Function Documentation

virtual bool Render Frustum pkFrustum = 0,
bool  bForce = false
[virtual]
 

Render the sprite

Parameters:
pkFrustum Current frustum
bForce If true, force rendering even if rendered this frame

Reimplemented from RenderEntity.

void SetSize float  fSizeX,
float  fSizeY,
bool  bSetDefaultTexCoords = false
 

Set sprite size

Parameters:
fSizeX Size in x direction
fSizeY Size in y direction
bSetDefaultTexCoords flag to set default texcoords

void SetRotation float  fRot  )  [inline]
 

Set rotation around view axis

Parameters:
fRot Rotation in radians

void Rotate float  fRot  )  [inline]
 

Rotate sprite around view axis

Parameters:
fRot Rotation in radians

virtual void SetNode  )  [inline, protected, virtual, inherited]
 

Called by scene node when entity has been set to a node

Reimplemented in MeshEntity.

SceneNode* GetSceneNode  )  [inline, inherited]
 

Returns:
parent scene node

BoundingVolume* GetBoundingVolume  )  [inline, inherited]
 

Returns:
Bounding volume

void SetBoundingVolume BoundingVolume pkBoundingVolume  )  [inherited]
 

Set new bounding volume object. Old bounding volume object will be deleted. The new bounding volume SRT data should be in LOCAL space, the world space SRT data will be calculated internally

Parameters:
pkBoundingVolume New bounding volume object

virtual SceneEntity* Duplicate  )  [inline, virtual, inherited]
 

Duplicate entity

Returns:
New entity that is exact copy of entity, or null if not supported by entity type

Reimplemented in MeshEntity.

virtual bool Intersection BoundingVolume pkObj,
ContactSet pkContactSet = 0,
bool  bInvertNormal = false
[inline, virtual, inherited]
 

Intersection test with unknown object type

Parameters:
pkObj Bounding volume object to test for intersection with
pkContactSet Collision set object receiving collision contact data, 0 if not needed
bInvertNormal If false, collision normal will point from passed object to this. If true, normal will point in other direction
Returns:
true if volumes intersect, false if not

Reimplemented in MeshEntity.

virtual bool Intersection const Ray rkRay,
ContactSet pkContactSet = 0
[inline, virtual, inherited]
 

Intersection test with ray

Parameters:
rkRay Ray
pkContactSet Collision set object receiving collision contact data, 0 if not needed
Returns:
true if volumes intersect, false if not

Reimplemented in MeshEntity.

virtual void Update float  fDeltaTime  )  [inline, virtual, inherited]
 

Update object

Parameters:
fDeltaTime Time passed since last update

Reimplemented in AnimatedNode, AnimatedSubMesh, Animation, AnimatorController, MassParticle, MeshEntity, NodeAnimatorController, ParticleSystem, PhysicsManager, PhysicsNode, RigidBody, SceneNode, Skeleton, SkeletalSubMesh, SubMesh, SubMeshAnimatorController, Animation< SubMeshKeyframe >, Animation< NodeKeyframe >, AnimatorController< SubMeshAnimation >, AnimatorController< NodeAnimation >, and AnimatorController< SkeletonAnimation >.

bool IsActive  )  const [inline, inherited]
 

Query state of object

Returns:
true if active, false if not

void Activate  )  [inline, virtual, inherited]
 

Activate object

void Deactivate  )  [inline, virtual, inherited]
 

Deactivate object

bool Toggle  )  [inline, inherited]
 

Toggle active state. This method does not need to be overloaded, it is only a wrapper to Activate and Deactivate

Returns:
true if activated, false if deactivated

void AcceptImpl NodeType &  rkVisited,
BaseVisitor rkVisitor
[inline, static, protected, inherited]
 

Accept visitors if implementation available

Parameters:
rkVisited Node being visited
rkVisitor Visitor

virtual void Accept BaseVisitor rkVisitor  )  [pure virtual, inherited]
 

Accept a visitor

Parameters:
rkVisitor Visitor


Member Data Documentation

float m_afSize[2] [protected]
 

Size

float m_fRotation [protected]
 

Rotation around viewing axis

VertexBufferPtr m_pkVertexBuffer
 

Vertex buffer

PolygonStripBufferPtr m_pkPolygonBuffer
 

Polygon buffer

MaterialPtr m_pkMaterial
 

Material

SceneNode* m_pkNode [protected, inherited]
 

Parent scene node object

BoundingVolume* m_pkBoundingVolume [protected, inherited]
 

Bounding volume for this entity

bool m_bActive [protected, inherited]
 

Active flag

unsigned int s_uiFrameCount [static, inherited]
 

Frame counter (at 500 frames per second, can be active ~100 days continously before loop, and then it will just skip one frame -> safe enough)

unsigned int m_uiLastFrame [inherited]
 

Last frame count we were rendered


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:15 2004 for NeoEngine by doxygen 1.3.5