Drag[en]gine Script Module DragonScript Script API  1.0
Element Class Reference
Inheritance diagram for Element:
BaseLight SimpleElement SpawnPoint Trigger TestingElement LightPoint LightSpot TriggerShout TriggerTarget TriggerArea TriggerCounter

Public Member Functions

void addToGameWorld ()
 
void dispose ()
 
ElementClass getClass ()
 
DMatrix getElementMatrix ()
 Matrix to transform from element space into world space. More...
 
GameWorld getGameWorld ()
 
UniqueID getID ()
 
DMatrix getInverseElementMatrix ()
 Matrix to transform from world space into element space. More...
 
Quaternion getOrientation ()
 
Element getParent ()
 
DVector getPosition ()
 
bool getTouchable ()
 
bool getVisible ()
 
void init (StubElement stub)
 
bool isChildOf (Element parent)
 
bool isMyselfOrChildOf (Element parent)
 
Element new (ElementClass elementClass)
 
void onSetGameWorld ()
 
void onSetGeometry ()
 
void onSetOrientation ()
 
void onSetParent ()
 
void onSetPosition ()
 
void onSetTouchable ()
 
void onSetVisible ()
 
void postLoadInit ()
 
void postThink (float elapsed)
 
void readFromFile (FileReader reader)
 
void removeFromGameWorld ()
 
void removeFromGameWorldIfPresent ()
 Remove element from game world if present. More...
 
void setGameWorld (GameWorld gameWorld)
 
void setGeometry (DVector position, Quaternion orientation)
 
void setID (UniqueID id)
 
void setOrientation (Quaternion orientation)
 
void setParent (Element parent)
 
void setPosition (DVector position)
 
void setTouchable (bool touchable)
 
void setVisible (bool visible)
 
void think (float elapsed)
 
String toString ()
 
void visit (ElementVisitor visitor)
 
void writeToFile (FileWriter writer)
 

Detailed Description

Element of a game.

Author
Roland Pl├╝ss
Version
1.0

Member Function Documentation

§ addToGameWorld()

void addToGameWorld ( )

Adds the element content to the game world if required.

§ dispose()

void dispose ( )

Disposes of this Element. Use this function to unset all cross-references that would cause this Element to litter the memory.

§ getClass()

ElementClass getClass ( )

Retrieves the element class.

§ getElementMatrix()

DMatrix getElementMatrix ( )

Matrix to transform from element space into world space.

§ getGameWorld()

GameWorld getGameWorld ( )

Retrieves the game world or null if not attached.

§ getID()

UniqueID getID ( )

Retrieves the unique id or null if not set.

§ getInverseElementMatrix()

DMatrix getInverseElementMatrix ( )

Matrix to transform from world space into element space.

§ getOrientation()

Quaternion getOrientation ( )

Retrieves orientation of element.

§ getParent()

Element getParent ( )

Retrieves the parent or null if not attached.

§ getPosition()

DVector getPosition ( )

Returns position of element.

§ getTouchable()

bool getTouchable ( )

Determines if the element is touchable.

§ getVisible()

bool getVisible ( )

Determines if the element is visible.

§ init()

void init ( StubElement  stub)

Initialize the element from a stub.

§ isChildOf()

bool isChildOf ( Element  parent)

Determines if a this element is parented directly or indirectly to the given element. If the element is the same as the given element false is returned.

§ isMyselfOrChildOf()

bool isMyselfOrChildOf ( Element  parent)

Determines if a this element is parented directly or indirectly to the given element. If the element is the same as the given element true is returned.

§ new()

Element new ( ElementClass  elementClass)

Creates a new element object.

§ onSetGameWorld()

void onSetGameWorld ( )

Game world changed.

§ onSetGeometry()

void onSetGeometry ( )

Position and orientation changed.

§ onSetOrientation()

void onSetOrientation ( )

Orientation changed.

§ onSetParent()

void onSetParent ( )

Parent changed.

§ onSetPosition()

void onSetPosition ( )

Position changed.

§ onSetTouchable()

void onSetTouchable ( )

Touchable state changed.

§ onSetVisible()

void onSetVisible ( )

Visible state changed.

§ postLoadInit()

void postLoadInit ( )

Initialises an element created from a map object. This is called for each such element after the map loading process has finished. This is used to init links to other map objects that can not be resolved during loading of the map.

§ postThink()

void postThink ( float  elapsed)

Called after the physics system has carried out collision detection and physics simulations. The element has to update its states like position or rotation from its registered physics objects like Colliders or Components. Complex animated elements also update here the skeletal animations.

Parameters
elapsedTime elapsed since last frame update in seconds

§ readFromFile()

void readFromFile ( FileReader  reader)

Reads the element from a file writer.

§ removeFromGameWorld()

void removeFromGameWorld ( )

Removes the element content from the game world if placed there before.

§ removeFromGameWorldIfPresent()

void removeFromGameWorldIfPresent ( )

Remove element from game world if present.

§ setGameWorld()

void setGameWorld ( GameWorld  gameWorld)

Sets the game world or null if not attached.

§ setGeometry()

void setGeometry ( DVector  position,
Quaternion  orientation 
)

Sets the position and orientation of element.

§ setID()

void setID ( UniqueID  id)

Sets the unique id or null to unset it.

§ setOrientation()

void setOrientation ( Quaternion  orientation)

Set orientation of element.

§ setParent()

void setParent ( Element  parent)

Sets the parent or null if not attached.

§ setPosition()

void setPosition ( DVector  position)

Sets the position of element.

§ setTouchable()

void setTouchable ( bool  touchable)

Sets if the element is touchable.

§ setVisible()

void setVisible ( bool  visible)

Sets if the element is visible.

§ think()

void think ( float  elapsed)

Thinks about what the element is going to do in this frame. This is the place to use AI functions to determine the next motions beeing it displacement, rotation or other shape changes. The game world will use this information to carry out changes to the elements. An element does not change its state by itself rather waits for the game world to apply the required changes. Execute here als updates to dynamic skins that are independant, hence not requiring the game world to be uptodate for rendering.

Parameters
elapsedTime elapsed since last frame update in seconds

§ toString()

String toString ( )

Return string representation of this Element.

§ visit()

void visit ( ElementVisitor  visitor)

Visit this element.

§ writeToFile()

void writeToFile ( FileWriter  writer)

Writes the element to a file writer.


The documentation for this class was generated from the following file: