Actor Class Reference
#include <Actor.h>
![](../class_actor.png)
# Public Types | |
typedef const ActorSpec | ActorROMSpec |
typedef const PositionedActor | PositionedActorROMSpec |
# Public Member Functions | |
void | constructor (const ActorSpec *actorSpec, int16 internalId, const char *const name) |
override bool | onEvent (ListenerObject eventFirer, uint16 eventCode) |
override void | createComponents (ComponentSpec **componentSpecs) |
override void | destroyComponents () |
Destroy the components that attach to this actor. | |
override void | calculateSize () |
Configure the actor's size. | |
override fixed_t | getRadius () |
override uint32 | getInGameType () |
override void | ready (bool recursive) |
override void | suspend () |
Prepare to suspend this instance's logic. | |
override void | resume () |
Prepare to resume this instance's logic. | |
override void | handleCommand (int32 command, va_list args) |
override bool | handlePropagatedString (const char *string) |
const ActorSpec * | getSpec () |
ActorFactory | getActorFactory () |
Actor | spawnChildActor (const PositionedActor *const positionedActor) |
void | addChildActors (const PositionedActor *childrenSpecs) |
void | addChildActorsDeferred (const PositionedActor *childrenSpecs) |
fixed_t | getWidth () |
fixed_t | getHeight () |
fixed_t | getDepth () |
bool | isInCameraRange (int16 padding, bool recursive) |
void | playAnimation (const char *animationName) |
void | pauseAnimation (bool pause) |
void | stopAnimation () |
Stop any playing animation if any. | |
bool | isPlaying () |
bool | isPlayingAnimation (char *animationName) |
const char * | getPlayingAnimationName () |
void | setActualFrame (int16 frame) |
void | nextFrame () |
Skip the currently playing animation to the next frame. | |
void | previousFrame () |
Rewind the currently playing animation to the previous frame. | |
int16 | getActualFrame () |
int32 | getNumberOfFrames () |
virtual void | setSpec (void *actorSpec) |
virtual void | setExtraInfo (void *extraInfo) |
virtual bool | alwaysStreamIn () |
# Static Public Member Functions | |
static Actor | createActor (const PositionedActor *const positionedActor, int16 internalId) |
static Actor | createActorDeferred (const PositionedActor *const positionedActor, int16 internalId) |
static RightBox | getRightBoxFromSpec (const PositionedActor *positionedActor, const Vector3D *environmentPosition) |
static bool | isInsideFrustrum (Vector3D vector3D, RightBox rightBox) |
# Protected Attributes | |
Size | size |
ActorFactory | actorFactory |
Factory to create this actor's children. | |
const ActorSpec * | actorSpec |
Pointer to the spec that defines how to initialize the actor. | |
Vector3D * | centerDisplacement |
const char * | playingAnimationName |
# Additional Inherited Members | |
![]() | |
void | constructor (int16 internalId, const char *const name) |
override void | setDirection (const Vector3D *direction) |
override void | show () |
Make this instance visible. | |
override void | hide () |
Make this instance invisible. | |
override void | setTransparency (uint8 transparency) |
override void | setPosition (const Vector3D *position) |
override void | setRotation (const Rotation *rotation) |
override void | setScale (const Scale *scale) |
void | setNormalizedDirection (NormalizedDirection normalizedDirection) |
NormalizedDirection | getNormalizedDirection () |
void | deleteMyself () |
int16 | getInternalId () |
void | setName (const char *const name) |
const char * | getName () |
void | streamOut (bool streamOut) |
Container | getParent () |
void | addChild (Container child) |
void | removeChild (Container child, bool deleteChild) |
void | purgeChildren () |
Force the destruction of all children marked to be deleted. | |
bool | getChildren (ClassPointer classPointer, VirtualList children) |
Container | getChildById (int16 id) |
Container | getChildByName (const char *childName, bool recursive) |
Container | getChildAtPosition (int16 position) |
int32 | getChildrenCount () |
Container | getFirstAncestor () |
Container | getRelativeByName (const char *relativeName) |
void | updateChildren () |
Update the children of this container. | |
void | invalidateTransformation () |
void | transformChildren (uint8 invalidateTransformationFlag) |
void | propagateCommand (uint32 command,...) |
bool | propagateMessage (bool(*propagatedMessageHandler)(void *, va_list),...) |
bool | onPropagatedMessage (va_list args) |
bool | propagateString (bool(*propagatedMessageHandler)(void *, va_list),...) |
bool | onPropagatedString (va_list args) |
void | translate (const Vector3D *translation) |
void | rotate (const Rotation *rotation) |
void | scale (const Scale *scale) |
const Vector3D * | getLocalPosition () |
const Rotation * | getLocalRotation () |
const Scale * | getLocalScale () |
virtual void | setLocalPosition (const Vector3D *position) |
virtual void | setLocalRotation (const Rotation *rotation) |
virtual void | setLocalScale (const Scale *scale) |
virtual void | transform (const Transformation *environmentTransform, uint8 invalidateTransformationFlag) |
virtual void | update () |
Update this instance's logic. | |
virtual bool | handlePropagatedMessage (int32 message) |
![]() | |
Container | parent |
Container of which this one is a child. | |
VirtualList | children |
Transformation | localTransformation |
3D local transformation | |
char * | name |
Container's name. | |
int16 | internalId |
Container's internal id, set by the engine. | |
bool | deleteMe |
If true, the parent will delete this container when appropriate. | |
bool | ready |
bool | dontStreamOut |
bool | hidden |
Flag to mark the container (and its children) as non visible. | |
int8 | axisForSynchronizationWithBody |
Axises around which to rotate the container when syncronizing with body. |
# Detailed Description
# Member Typedef Documentation
# ActorROMSpec
typedef const ActorSpec ActorROMSpec |
# PositionedActorROMSpec
typedef const PositionedActor PositionedActorROMSpec |
A PositionedActor spec that is stored in ROM
# Member Function Documentation
# addChildActors()
void Actor::addChildActors | ( | const PositionedActor * | childrenSpecs | ) |
# addChildActorsDeferred()
void Actor::addChildActorsDeferred | ( | const PositionedActor * | childrenSpecs | ) |
# alwaysStreamIn()
|
virtual |
# calculateSize()
|
virtual |
# constructor()
# createActor()
|
static |
Create a new actor instance and configure it with the provided arguments.
- Parameters
-
positionedActor Struct that defines which actor spec to use to configure the new actor and the spatial information about where and how to positione it internalId ID to keep track internally of the new instance
- Returns
- The new actor
# createActorDeferred()
|
static |
Create a new actor instance and configure it over time with the provided arguments.
- Parameters
-
positionedActor Struct that defines which actor spec to use to configure the new actor and the spatial information about where and how to positione it internalId ID to keep track internally of the new instance
- Returns
- The new, still not configured actor
# createComponents()
|
virtual |
# destroyComponents()
|
virtual |
# getActorFactory()
ActorFactory Actor::getActorFactory | ( | ) |
# getActualFrame()
int16 Actor::getActualFrame | ( | ) |
Retrieve the actual frame of the playing animation if any.
- Returns
- Actual frame of the playing animation if any
# getDepth()
fixed_t Actor::getDepth | ( | ) |
# getHeight()
fixed_t Actor::getHeight | ( | ) |
# getInGameType()
|
virtual |
# getNumberOfFrames()
int32 Actor::getNumberOfFrames | ( | ) |
Retrieve the number of frames in the currently playing animation if any.
- Returns
- The numer of frames if an animation is playing; o otherwise
# getPlayingAnimationName()
const char * Actor::getPlayingAnimationName | ( | ) |
# getRadius()
|
virtual |
# getRightBoxFromSpec()
|
static |
Compute the spatially located bounding box of an actor created with the provided positioned actor struct.
- Parameters
-
positionedActor Struct that defines which actor spec to use to configure the an actor environmentPosition Vector used as the origin with respect to which computed the bounding box's position
- Returns
- Spatially located bounding box of an actor that would be created with the provided positioned actor struct
# getSpec()
const ActorSpec * Actor::getSpec | ( | ) |
# getWidth()
fixed_t Actor::getWidth | ( | ) |
# handleCommand()
|
virtual |
# handlePropagatedString()
|
virtual |
# isInCameraRange()
# isInsideFrustrum()
# isPlaying()
bool Actor::isPlaying | ( | ) |
# isPlayingAnimation()
bool Actor::isPlayingAnimation | ( | char * | animationName | ) |
# nextFrame()
void Actor::nextFrame | ( | ) |
# onEvent()
|
virtual |
Process an event that the instance is listen for.
- Parameters
-
eventFirer ListenerObject that signals the event eventCode Code of the firing event
- Returns
- False if the listener has to be removed; true to keep it
Reimplemented from ListenerObject.
# pauseAnimation()
void Actor::pauseAnimation | ( | bool | pause | ) |
# playAnimation()
void Actor::playAnimation | ( | const char * | animationName | ) |
# previousFrame()
void Actor::previousFrame | ( | ) |
# ready()
|
virtual |
# resume()
|
virtual |
Prepare to resume this instance's logic.
Reimplemented from Container.
Reimplemented in ParticleSystem.
# setActualFrame()
void Actor::setActualFrame | ( | int16 | frame | ) |
# setExtraInfo()
|
virtual |
Set any extra info provided by the PositionedActor struct used to instantiate this actor.
- Parameters
-
extraInfo Pointer to the extra information that the actor might need
# setSpec()
|
virtual |
Set the actor's spec.
- Parameters
-
actorSpec Specification that determines how to configure the actor
Reimplemented in ParticleSystem.
# spawnChildActor()
Actor Actor::spawnChildActor | ( | const PositionedActor *const | positionedActor | ) |
# stopAnimation()
void Actor::stopAnimation | ( | ) |
# suspend()
|
virtual |
Prepare to suspend this instance's logic.
Reimplemented from Container.
Reimplemented in ParticleSystem.
# Member Data Documentation
# actorFactory
|
protected |
# actorSpec
|
protected |
# centerDisplacement
|
protected |
# playingAnimationName
|
protected |
# size
|
protected |
The documentation for this class was generated from the following files: