HBhvAction

class HBhvAction

The HBhvAction class encapsulates an animation action.

An action is executed based on the status of all conditions of the sensor it belongs to. Certain action types are directly related to specific target types. The following is a list of action types and targets.

Action Type: DOACTION Associate Target Type: None Action: Triggers a sensor action event.

Action Type: LOADFILE Associate Target Type: None Action: Load a file with the path indicated the value paramater.

Action Type: ACTIVATE Associated Target Type: Animation Action: Activate the target animation and then schedules it for execution. A delay before execution can be indicated by passing the number ticks to the value parameter in the constructor.

Action Type: CONTINUE Associated Target Type: Animation Action: Removes the target animation from the schedule animation list and then reschedules it for later.

Action Type: DEACTIVATE Associated Target Type: Animation Action: Removes the target animation from the schedule animation list and set its currently running flag to false.

Action Type: ACTIVATE Associated Target Type: Sensor Action: Activates the target sensor. A delay before execution can be indicated by passing the number ticks to the value parameter in the constructor.

Action Type: DEACTIVATE Associated Target Type: Sensor Action: Deactivates the target sensor.

Methods

HBhvAction::HBhvAction(char const *target, char const *type, char const *value, HBhvSensor *sensor)

Constructs an HBhvAction object.

Parameters

target: The descriptor for the target object for this action. You can use HBhvTargetObject::CreateTargetString() to generate this string.

type: The action type which are described in the detailed description of this class.

value: Additional data depending on the action type and target type.

sensor: A pointer to the HBhvSensor object that this action belongs to.

virtual HBhvAction::~HBhvAction()

virtual

Destructor for HBhvAction object.

void HBhvAction::SetTargetByPath(char const *targetpath)

Sets target object for the action.

Parameters

target: The descriptor for the target object for this action. You can use HBhvTargetObject::CreateTargetString() to generate this string.
void HBhvAction::DoAction()

Performs action based on the action type.

void HBhvAction::Serialize(HUtilityXMLGenerator *xmlgen)

Writes XML data to a buffer.

static void *HBhvAction::XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData)

static

This is XML read callback which parses XML data and then populates the member variables with the associated values.

Variables

char HBhvAction::m_Type[256]

protected

char

The action type.

char HBhvAction::m_Value[MVO_BUFFER_SIZE]

protected

char

The action value.

HBhvSensor *HBhvAction::m_pSensor

protected

A pointer to the parent sensor.

HBhvTargetObject *HBhvAction::m_pTarget

protected

The action’s target object.