QSDK 1.1 Documentation
Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

ManicCube Struct Reference

#include <maniccube.h>

Inheritance diagram for ManicCube:

EntityBase PlaybackListener Entity MessagePeerBase Unknown MessagePeer ComObject< MessagePeer, MessagePeerBase > Unknown ComObjectBase List of all members.

Public Types

typedef Com::Ptr< ManicCubePTR

Public Member Functions

 ManicCube ()
 ~ManicCube ()
virtual bool embody (Q::EntityInstance *)
virtual void disembody (bool destroyed)
virtual void entered (unsigned int yourType, Q::EntityInstance *them, unsigned int theirType)
virtual void exited (unsigned int yourType, Q::EntityInstance *them, unsigned int theirType)
virtual void receive (Q::MessagePeer *from, Q::Message *, Q::MessageResult *)
virtual void tick (float dt)
virtual void onStart (Q::Playback &pb, Q::Animation &anim, float start, float end)
virtual void onEnd (Q::Playback &pb, Q::Animation &anim, float start, float end)
void spin ()
void bounce ()
void idle ()
void toggleLooping ()

Private Member Functions

void playAnim (const char *segName)

Private Attributes

Q::Instance inst_
Q::Playback playback_
bool looping_
Utils::String segName_

Static Private Attributes

Q::Animation anim_
Q::Mesh mesh_

Detailed Description

The ManicCube class holds the guts of the Entity that we will create. It will be used to place a 3D star mesh in the scene (the placement was authored using QStudio) when the placed EntityInstance comes into scope.

The methods spin(), bounce(), idle(), toggleLooping() are called externally as a result of keyboard events. They cause a spin or bounce animation to be played, in a loop or a single time. The idle() method will stop the current animation when it has completed its cycle.

The Q::PlaybackListener inheritance and registration (see the embody/ disembody methods for registration details) and its overridden onEnd() method are used to loop the animation by restarting it when it has completed.

Refer to the GameDev tutorial information about the Entity APIs for further detail.

Definition at line 54 of file maniccube.h.


Member Typedef Documentation

typedef Com::Ptr<ManicCube> ManicCube::PTR
 

Reimplemented from EntityBase.

Definition at line 57 of file maniccube.h.


Constructor & Destructor Documentation

ManicCube::ManicCube  ) 
 

ManicCube::~ManicCube  )  [inline]
 

Definition at line 60 of file maniccube.h.

00060 {}


Member Function Documentation

void ManicCube::bounce  ) 
 

virtual void ManicCube::disembody bool  destroyed  )  [virtual]
 

Reimplemented from EntityBase.

virtual bool ManicCube::embody Q::EntityInstance  )  [virtual]
 

virtual void ManicCube::entered unsigned int  yourType,
Q::EntityInstance them,
unsigned int  theirType
[inline, virtual]
 

Definition at line 66 of file maniccube.h.

00068                                                             {}

virtual void ManicCube::exited unsigned int  yourType,
Q::EntityInstance them,
unsigned int  theirType
[inline, virtual]
 

Definition at line 69 of file maniccube.h.

00071                                                                 {}

void ManicCube::idle  ) 
 

virtual void ManicCube::onEnd Q::Playback pb,
Q::Animation anim,
float  start,
float  end
[virtual]
 

virtual void ManicCube::onStart Q::Playback pb,
Q::Animation anim,
float  start,
float  end
[inline, virtual]
 

Definition at line 81 of file maniccube.h.

00082                                                                 {} 

void ManicCube::playAnim const char *  segName  )  [private]
 

virtual void ManicCube::receive Q::MessagePeer from,
Q::Message ,
Q::MessageResult
[inline, virtual]
 

Definition at line 72 of file maniccube.h.

00074                                                          {}

void ManicCube::spin  ) 
 

virtual void ManicCube::tick float  dt  )  [inline, virtual]
 

Implements EntityBase.

Definition at line 75 of file maniccube.h.

00075 {}

void ManicCube::toggleLooping  ) 
 


Member Data Documentation

Q::Animation ManicCube::anim_ [static, private]
 

Definition at line 35 of file maniccube.cpp.

Q::Instance ManicCube::inst_ [private]
 

Definition at line 100 of file maniccube.h.

bool ManicCube::looping_ [private]
 

Definition at line 104 of file maniccube.h.

Q::Mesh ManicCube::mesh_ [static, private]
 

Definition at line 36 of file maniccube.cpp.

Q::Playback ManicCube::playback_ [private]
 

Definition at line 102 of file maniccube.h.

Utils::String ManicCube::segName_ [private]
 

Definition at line 109 of file maniccube.h.

Return to QSDK documentation Contents page. Contact details for support, information and fault-reporting.
Qube Software Limited © 2000-2004