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

Q::EntityInstance2 Struct Reference
[Entity platform]

Extends EntityInstance. More...

#include <Q/gamedev.h>

Inheritance diagram for Q::EntityInstance2:

Q::EntityInstance Com::Unknown List of all members.

Public Types

typedef Com::Ptr< EntityInstance2PTR
enum  MoveMode {
  NotMoving,
  MoveReferenceGroup,
  StartPosition
}

Public Member Functions

virtual Group referenceGroup () const=0
virtual MoveMode moveMode () const=0
virtual Utils::Result setMoveMode (MoveMode)=0
virtual short tickPriority () const=0
virtual Utils::Result setTickPriority (short)=0

Static Public Member Functions

PTR create (const char *name, const Group &referenceGroup, const Concept &type, MoveMode moving, const Database &db=Database())

Static Public Attributes

Com::UUID IID

Detailed Description

Extends EntityInstance.

This class extends the features of the EntityInstance class. It adds extra support for moving entity instances, i.e. entities who moves from a start position, may travel accross several portals and then may come back or move to the new location when disembodied. This particular kind of entities require some specific support, e.g. for using a temporary group when embodied or for asset dependencies.

See also:
QDemo2 production guide for guidance on how to build and import entities in Q files.


Member Typedef Documentation

typedef Com::Ptr<EntityInstance2> Q::EntityInstance2::PTR
 

A COM pointer to an object of this class

Reimplemented from Q::EntityInstance.


Member Enumeration Documentation

enum Q::EntityInstance2::MoveMode
 

Move mode. Indicate what group the EntityInstance uses when embodied in relation to its reference group and what happens to it when it gets disembodied.

Enumeration values:
NotMoving  Indicates that the reference group is the group. This mode is the one usually used for EntityInstance objects that do not travel and do not need to carry their dependent assets across zones (scenery entities, such as doors, lifts, bridges..)
MoveReferenceGroup  Indicates that the reference group is the start position of the instance. In this case, there is no need to register any scope instances to this EntityInstance for it to embody. The reference group will trigger its activation when entering/exiting the scope. This mode is the one usually used for EntityInstance objects that are spawned at runtime and do not need to be persisted or placed in the scene (e.g. projectiles)
StartPosition  Indicates that the EntityInstance is moving. In this mode, a lightweight group is created when the EntityInstance is embodied. This group matches the reference group and is parented to the zone root (so that it crosses portal when it moves). When disembodied, the reference group stays where it is so that the EntityInstance will start from the same start position everytime it gets into the scope.T his mode is the one usually used for EntityInstance objects that are placed, may travel accross zones but do not need to remember their state when they are disembodied (stateless).


Member Function Documentation

EntityInstance2::PTR Q::EntityInstance2::create const char *  name,
const Group referenceGroup,
const Concept type,
MoveMode  moving,
const Database db = Database()
[inline, static]
 

Create an EntityInstance with the specified name, the specified reference group and the specified type.

Parameters:
name If the name is not null, the EntityInstance is written in the Q file (hence requiring that the application is connected to at least one writable database).
referenceGroup The reference group. If the instance has a move mode other than NotMoving, this group works as a start location: it triggers the activation of the instance. If the mode is StartPosition, a lightweight group is created that matches the start position for each activation and is the group of the EntityInstance. Otherwise, this group is the group of the EntityInstance.
type Indicates the type of the EntityInstance.
moving Indicates whether the EntityInstance is moving or not, and how it moves. If the mode is NotMoving, the group of the EntityInstance is the reference group throughout its lifetime. If the mode is MoveReferenceGroup, the group of the EntityInstance is the reference group throughout its lifetime and it acts as a trigger for activation (no need for scope instances). If the mode is StartPosition, a temporary lightweight group is created when the EntityInstance is embodied . This group matches the reference group and is parented to the zone root (so that it crosses portal when it moves). When disembodied, the reference group can be moved to the new location or stays where it is, depending on the value of the move mode of the instance.
db If specified, db indicates which database to create the object in.

virtual MoveMode Q::EntityInstance2::moveMode  )  const [pure virtual]
 

Gets the move mode. The mode indicates what is used for the group when the EntityInstance object get embodied and what happens to it when it gets disembodied.

See also:
MoveMode

virtual Group Q::EntityInstance2::referenceGroup  )  const [pure virtual]
 

The reference group of the EntityInstance. If the move mode is NotMoving or MoveReferenceGroup, their reference group is their group. Otherwise, it is the group used as a reference to generate the lightweight group of the instance when the latter is embodied.

virtual Utils::Result Q::EntityInstance2::setMoveMode MoveMode   )  [pure virtual]
 

Sets the move mode. The mode indicates what is used for the group when the EntityInstance object get embodied and what happens to it when it gets disembodied.

See also:
MoveMode

virtual Utils::Result Q::EntityInstance2::setTickPriority short   )  [pure virtual]
 

The ticking priority for this entity. Within a frame update, ticking entities is ordered by tick priority. Entities with higher priority are ticked before entities with lower priority.

virtual short Q::EntityInstance2::tickPriority  )  const [pure virtual]
 

Return the ticking priority. Within a frame update, ticking entities is ordered by tick priority. Entities with higher priority are ticked before entities with lower priority.


Member Data Documentation

Com::UUID Q::EntityInstance2::IID [static]
 

COM IID d32ecc39-45a7-40f6-bcd9-cd97064a09dd

Reimplemented from Q::EntityInstance.

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