Drag[en]gine Script Module DragonScript
1.21
|
Public Member Functions | |
void | addToGameWorld () |
Dictionary | debugInformation () |
Debug information as Dictionary. More... | |
void | dispose () |
Dispose of element. More... | |
void | enterFrame () |
Frame update started. More... | |
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... | |
bool | getIsScaled () |
Is scaled. More... | |
Quaternion | getOrientation () |
Orientation. More... | |
Element | getParent () |
DVector | getPosition () |
Position. More... | |
Vector | getScaling () |
Scaling. More... | |
StubElement | getStub () |
Element stub used to create the element. More... | |
bool | getTouchable () |
bool | getVisible () |
void | init (StubElement stub) |
Initialize element from stub. More... | |
bool | isChildOf (Element parent) |
bool | isDisposed () |
Element has been disposed of. More... | |
bool | isMyselfOrChildOf (Element parent) |
bool | isNotDisposed () |
Element has not been disposed of. More... | |
void | log (String message) |
Log using BaseGameApp Console if present. More... | |
Element | new (ElementClass elementClass) |
void | onSetGameWorld () |
void | onSetGeometry () |
Position, orientation or scaling changed. More... | |
void | onSetOrientation () |
Orientation changed. More... | |
void | onSetParent () |
void | onSetPosition () |
Position changed. More... | |
void | onSetScaling () |
Scaling changed. More... | |
void | onSetTouchable () |
void | onSetVisible () |
void | postThink (float elapsed) |
void | readFromFile (PersistencyEnvironment env, FileReader reader) |
Read element from file reader. More... | |
void | removeFromGameWorld () |
void | removeFromGameWorldIfPresent () |
Remove element from game world if present. More... | |
void | safeDispose () |
Remove element from game world if present and dispose of element. More... | |
void | setGameWorld (GameWorld gameWorld) |
void | setGeometry (DVector position, Quaternion orientation) |
Set position and orientation. More... | |
void | setGeometry (DVector position, Quaternion orientation, Vector scaling) |
Set position, orientation and scaling of element. More... | |
void | setID (UniqueID id) |
void | setOrientation (Quaternion orientation) |
Set orientation. More... | |
void | setParent (Element parent) |
void | setPosition (DVector position) |
Set position. More... | |
void | setScaling (Vector scaling) |
Set scaling. More... | |
void | setStub (StubElement stub) |
Set element stub used to create the element. More... | |
void | setTouchable (bool touchable) |
void | setVisible (bool visible) |
void | think (float elapsed) |
String | toString () |
void | visit (ElementVisitor visitor) |
void | writeToFile (PersistencyEnvironment env, FileWriter writer) |
Write element to file writer. More... | |
void | writeToFileWithStub (PersistencyEnvironment env, FileWriter writer) |
Write element to file writer with stub. More... | |
Static Public Member Functions | |
static Element | readElementFromFileWithStub (PersistencyEnvironment env, FileReader reader, ElementClassList ElementClassList) |
Load element from file reader with stub supporting null element. More... | |
static void | writeElementToFileWithStub (PersistencyEnvironment env, FileWriter writer, Element element) |
Write element to file writer with stub supporting null element. More... | |
Game world element.
void Dragengine.Scenery.Element.addToGameWorld | ( | ) |
Adds the element content to the game world if required.
Reimplemented in Dragengine.Scenery.BaseActor.
Dictionary Dragengine.Scenery.Element.debugInformation | ( | ) |
Debug information as Dictionary.
void Dragengine.Scenery.Element.dispose | ( | ) |
Dispose of element.
Breaks reference loops and cleans up.
Reimplemented in Dragengine.Scenery.SimpleElementOnRail.
void Dragengine.Scenery.Element.enterFrame | ( | ) |
Frame update started.
To receive this event call GameWorld.addEnterFrameOnce() from inside addToGameWorld(). This event is called at the beginning of the next frame update before think() of any element is called.
Use this method as a one-time call to carry out tasks required to be done once before any elements start thinking. Typically this is done after adding a new element to a game world to finish connections to other elements in the game world which can not be established before all required elements are added too.
ElementClass Dragengine.Scenery.Element.getClass | ( | ) |
Retrieves the element class.
DMatrix Dragengine.Scenery.Element.getElementMatrix | ( | ) |
Matrix to transform from element space into world space.
GameWorld Dragengine.Scenery.Element.getGameWorld | ( | ) |
Retrieves the game world or null if not attached.
UniqueID Dragengine.Scenery.Element.getID | ( | ) |
Retrieves the unique id or null if not set.
DMatrix Dragengine.Scenery.Element.getInverseElementMatrix | ( | ) |
Matrix to transform from world space into element space.
bool Dragengine.Scenery.Element.getIsScaled | ( | ) |
Is scaled.
Quaternion Dragengine.Scenery.Element.getOrientation | ( | ) |
Orientation.
Element Dragengine.Scenery.Element.getParent | ( | ) |
Retrieves the parent or null if not attached.
DVector Dragengine.Scenery.Element.getPosition | ( | ) |
Position.
Vector Dragengine.Scenery.Element.getScaling | ( | ) |
Scaling.
StubElement Dragengine.Scenery.Element.getStub | ( | ) |
Element stub used to create the element.
bool Dragengine.Scenery.Element.getTouchable | ( | ) |
Determines if the element is touchable.
bool Dragengine.Scenery.Element.getVisible | ( | ) |
Determines if the element is visible.
void Dragengine.Scenery.Element.init | ( | StubElement | stub | ) |
Initialize element from stub.
Stub is stored in element for saving. Stub can be changed in certain situations. In general though the stub should be kept unchanged.
Reimplemented in Dragengine.Scenery.SimpleElementOnRail, Dragengine.Scenery.BaseActor, and Dragengine.Gui.MainMenus.Interactive.IMMCameraSpot.
bool Dragengine.Scenery.Element.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.
bool Dragengine.Scenery.Element.isDisposed | ( | ) |
Element has been disposed of.
bool Dragengine.Scenery.Element.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.
bool Dragengine.Scenery.Element.isNotDisposed | ( | ) |
Element has not been disposed of.
void Dragengine.Scenery.Element.log | ( | String | message | ) |
Log using BaseGameApp Console if present.
Element Dragengine.Scenery.Element.new | ( | ElementClass | elementClass | ) |
Creates a new element object.
void Dragengine.Scenery.Element.onSetGameWorld | ( | ) |
Game world changed.
void Dragengine.Scenery.Element.onSetGeometry | ( | ) |
Position, orientation or scaling changed.
void Dragengine.Scenery.Element.onSetOrientation | ( | ) |
Orientation changed.
void Dragengine.Scenery.Element.onSetParent | ( | ) |
Parent changed.
void Dragengine.Scenery.Element.onSetPosition | ( | ) |
Position changed.
Reimplemented in Dragengine.Scenery.BehaviorElement.
void Dragengine.Scenery.Element.onSetScaling | ( | ) |
Scaling changed.
void Dragengine.Scenery.Element.onSetTouchable | ( | ) |
Touchable state changed.
void Dragengine.Scenery.Element.onSetVisible | ( | ) |
Visible state changed.
void Dragengine.Scenery.Element.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.
elapsed | Time elapsed since last frame update in seconds |
|
static |
Load element from file reader with stub supporting null element.
Reads element class name from reader. If element class name is empty null element is returned. Otherwise stub and element is read from file reader. Uses ElementClass.loadElement() if supported.
void Dragengine.Scenery.Element.readFromFile | ( | PersistencyEnvironment | env, |
FileReader | reader | ||
) |
Read element from file reader.
The default implementation reads a single byte expecting value 0 indicating version 0. This allows subclasses to add persistency support by overwriting this method without super calling it.
Reimplemented in Dragengine.Scenery.BaseActor.
void Dragengine.Scenery.Element.removeFromGameWorld | ( | ) |
Removes the element content from the game world if placed there before.
void Dragengine.Scenery.Element.removeFromGameWorldIfPresent | ( | ) |
Remove element from game world if present.
void Dragengine.Scenery.Element.safeDispose | ( | ) |
Remove element from game world if present and dispose of element.
This is the prefered way to dispose of an element no matter if it is part of a game world or not. Do not use dispose() directly otherwise clean up logic done by removeFromGameWorld() is skipped.
void Dragengine.Scenery.Element.setGameWorld | ( | GameWorld | gameWorld | ) |
Sets the game world or null if not attached.
void Dragengine.Scenery.Element.setGeometry | ( | DVector | position, |
Quaternion | orientation | ||
) |
Set position and orientation.
void Dragengine.Scenery.Element.setGeometry | ( | DVector | position, |
Quaternion | orientation, | ||
Vector | scaling | ||
) |
Set position, orientation and scaling of element.
void Dragengine.Scenery.Element.setID | ( | UniqueID | id | ) |
Sets the unique id or null to unset it.
void Dragengine.Scenery.Element.setOrientation | ( | Quaternion | orientation | ) |
Set orientation.
void Dragengine.Scenery.Element.setParent | ( | Element | parent | ) |
Sets the parent or null if not attached.
void Dragengine.Scenery.Element.setPosition | ( | DVector | position | ) |
Set position.
void Dragengine.Scenery.Element.setScaling | ( | Vector | scaling | ) |
Set scaling.
void Dragengine.Scenery.Element.setStub | ( | StubElement | stub | ) |
Set element stub used to create the element.
void Dragengine.Scenery.Element.setTouchable | ( | bool | touchable | ) |
Sets if the element is touchable.
void Dragengine.Scenery.Element.setVisible | ( | bool | visible | ) |
Sets if the element is visible.
void Dragengine.Scenery.Element.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.
elapsed | Time elapsed since last frame update in seconds |
String Dragengine.Scenery.Element.toString | ( | ) |
Return string representation of this Element.
void Dragengine.Scenery.Element.visit | ( | ElementVisitor | visitor | ) |
Visit this element.
Reimplemented in Dragengine.Scenery.TwoStateAnimatedElement, Dragengine.Scenery.TriggerTouch, Dragengine.Scenery.TriggerToggle, Dragengine.Scenery.TriggerTimer, Dragengine.Scenery.TriggerShout, Dragengine.Scenery.TriggerEvaluate, Dragengine.Scenery.TriggerConversation, Dragengine.Scenery.SimpleElement, Dragengine.Scenery.SimpleElementOnRail, Dragengine.Scenery.PhysicsElement, Dragengine.Scenery.InfoConvoCoordSystem, Dragengine.Scenery.HiddenElement, Dragengine.Scenery.GhostElement, Dragengine.Scenery.EnvironmentMap, Dragengine.Scenery.BaseSpeaker, Dragengine.Scenery.BaseSky, Dragengine.Scenery.BaseParticleEmitter, Dragengine.Scenery.BaseLight, Dragengine.Scenery.BaseForceField, Dragengine.Scenery.BaseBillboard, Dragengine.Scenery.AttachSlot, Dragengine.Scenery.AttachableBaseSpeaker, Dragengine.Scenery.AttachableBaseParticleEmitter, Dragengine.Scenery.AttachableBaseLight, Dragengine.Scenery.AttachableBaseForceField, Dragengine.Scenery.AttachableBaseBillboard, Dragengine.Scenery.AnimatedElement, Dragengine.Scenery.BaseVRActor, Dragengine.Scenery.BaseActor, Dragengine.Gui.MainMenus.Interactive.IMMSpeaker, Dragengine.Gui.MainMenus.Interactive.IMMProp, Dragengine.Gui.MainMenus.Interactive.IMMParticleEmitter, Dragengine.Gui.MainMenus.Interactive.IMMLight, Dragengine.Gui.MainMenus.Interactive.IMMHotSpot, Dragengine.Gui.MainMenus.Interactive.IMMEnvironmentMap, and Dragengine.Gui.MainMenus.Interactive.IMMCameraSpot.
|
static |
Write element to file writer with stub supporting null element.
Writes element class name, then the stub parameters and then the element parameters. If no stub exists an empty one is used for writing stub parameters. If element is null empty element class name is written. Empty element class name is used during loading to indicate a null element.
void Dragengine.Scenery.Element.writeToFile | ( | PersistencyEnvironment | env, |
FileWriter | writer | ||
) |
Write element to file writer.
The default implementation writes a single byte of value 0 indicating version 0. This allows subclasses to add persistency support by overwriting this method without super calling it.
Reimplemented in Dragengine.Scenery.BaseActor.
void Dragengine.Scenery.Element.writeToFileWithStub | ( | PersistencyEnvironment | env, |
FileWriter | writer | ||
) |
Write element to file writer with stub.
Writes element class name, then the stub parameters and then the element parameters. If no stub exists an empty one is used for writing stub parameters.