GameBase

consoledoc.h

Base class for game objects which use datablocks, networking, are editable, and need to process ticks.

More...

Game

Script datablock used for game objects.

Callbacks

void
setControl(bool controlled)

Called when the client controlling the object changes.

Public Static Attributes

bool

Toggles on the rendering of the bounding boxes for certain types of objects in scene.

bool

Disables rendering of all instances of this type.

bool

Disables selection of all instances of this type.

Public Functions

bool
applyImpulse(Point3F pos, VectorF vel)

Apply an impulse to this object as defined by a world position and velocity vector.

void
applyRadialImpulse(Point3F origin, float radius, float magnitude)

Applies a radial impulse to the object using the given origin and force.

bool
attachChild(GameBase _subObject)

attach an object to this one, preserving its present transform.

bool
detachChild(GameBase _subObject)

attach an object to this one, preserving its present transform.

int

Get the datablock used by this object.

bool

Assign this GameBase to use the specified datablock.

Detailed Description

Base class for game objects which use datablocks, networking, are editable, and need to process ticks.

Game

GameBaseData dataBlock 

Script datablock used for game objects.

Callbacks

setControl(bool controlled)

Called when the client controlling the object changes.

Parameters:

controlled

true if a client now controls this object, false if no client controls this object.

Public Static Attributes

bool boundingBox 

Toggles on the rendering of the bounding boxes for certain types of objects in scene.

bool isRenderable 

Disables rendering of all instances of this type.

bool isSelectable 

Disables selection of all instances of this type.

Public Functions

applyImpulse(Point3F pos, VectorF vel)

Apply an impulse to this object as defined by a world position and velocity vector.

Parameters:

pos

impulse world position

vel

impulse velocity (impulse force F = m * v)

return:

Always true

note:

Not all objects that derrive from GameBase have this defined.

applyRadialImpulse(Point3F origin, float radius, float magnitude)

Applies a radial impulse to the object using the given origin and force.

Parameters:

origin

World point of origin of the radial impulse.

radius

The radius of the impulse area.

magnitude

The strength of the impulse.

note:

Not all objects that derrive from GameBase have this defined.

attachChild(GameBase _subObject)

attach an object to this one, preserving its present transform.

detachChild(GameBase _subObject)

attach an object to this one, preserving its present transform.

getDataBlock()

Get the datablock used by this object.

return:

the datablock this GameBase is using.

setDataBlock(GameBaseData data)

Assign this GameBase to use the specified datablock.

Parameters:

data

new datablock to use

return:

true if successful, false if failed.