|
Drag[en]gine Script Module DragonScript 1.35
|
Public Member Functions | |
| void | addToGameWorld () |
| Dictionary | debugInformation () |
| Debug information as Dictionary. | |
| void | dispose () |
| Dispose of element. | |
| void | enterFrame () |
| Frame update started. | |
| ElementClass | getClass () |
| DMatrix | getElementMatrix () |
| Matrix to transform from element space into world space. | |
| GameWorld | getGameWorld () |
| UniqueID | getID () |
| DMatrix | getInverseElementMatrix () |
| Matrix to transform from world space into element space. | |
| bool | getIsScaled () |
| Is scaled. | |
| Quaternion | getOrientation () |
| Orientation. | |
| Element | getParent () |
| DVector | getPosition () |
| Position. | |
| Vector | getScaling () |
| Scaling. | |
| StubElement | getStub () |
| Element stub used to create the element. | |
| bool | getTouchable () |
| bool | getVisible () |
| void | init (StubElement stub) |
| Initialize element from stub. | |
| bool | isChildOf (Element parent) |
| bool | isDisposed () |
| Element has been disposed of. | |
| bool | isMyselfOrChildOf (Element parent) |
| bool | isNotDisposed () |
| Element has not been disposed of. | |
| void | log (String message) |
| Log using BaseGameApp Console if present. | |
| Element | new (ElementClass elementClass) |
| void | onSetGameWorld () |
| void | onSetGeometry () |
| Position, orientation or scaling changed. | |
| void | onSetOrientation () |
| Orientation changed. | |
| void | onSetParent () |
| void | onSetPosition () |
| Position changed. | |
| void | onSetScaling () |
| Scaling changed. | |
| void | onSetTouchable () |
| void | onSetVisible () |
| void | postThink (float elapsed) |
| void | readFromFile (PersistencyEnvironment env, FileReader reader) |
| Read element from file reader. | |
| void | removeFromGameWorld () |
| void | removeFromGameWorldIfPresent () |
| Remove element from game world if present. | |
| void | safeDispose () |
| Remove element from game world if present and dispose of element. | |
| void | setGameWorld (GameWorld gameWorld) |
| void | setGeometry (DVector position, Quaternion orientation) |
| Set position and orientation. | |
| void | setGeometry (DVector position, Quaternion orientation, Vector scaling) |
| Set position, orientation and scaling of element. | |
| void | setID (UniqueID id) |
| void | setOrientation (Quaternion orientation) |
| Set orientation. | |
| void | setParent (Element parent) |
| void | setPosition (DVector position) |
| Set position. | |
| void | setScaling (Vector scaling) |
| Set scaling. | |
| void | setStub (StubElement stub) |
| Set element stub used to create the element. | |
| void | setTouchable (bool touchable) |
| void | setVisible (bool visible) |
| void | think (float elapsed) |
| String | toString () |
| void | updateStubGeometryFromElement () |
| Update stub position, rotation and scaling from element. | |
| void | visit (ElementVisitor visitor) |
| void | writeToFile (PersistencyEnvironment env, FileWriter writer) |
| Write element to file writer. | |
| void | writeToFileWithStub (PersistencyEnvironment env, FileWriter writer) |
| Write element to file writer with stub. | |
Static Public Member Functions | |
| static Element | readElementFromFileWithStub (PersistencyEnvironment env, FileReader reader, ElementClassList ElementClassList) |
| Load element from file reader with stub supporting null element. | |
| static void | writeElementToFileWithStub (PersistencyEnvironment env, FileWriter writer, Element element) |
| Write element to file writer with stub supporting null element. | |
Public Attributes | |
| ElementClass | pClass |
| GameWorld | pGameWorld |
| UniqueID | pID |
| bool | pIsScaled |
| DMatrix | pMatrix |
| DMatrix | pMatrixInverse |
| Quaternion | pOrientation |
| Element | pParent |
| DVector | pPosition |
| Vector | pScaling |
| StubElement | pStub |
| bool | pTouchable |
| bool | pVisible |
Game world element.
| void Dragengine.Scenery.Element.addToGameWorld | ( | ) |
Adds the element content to the game world if required.
Reimplemented in Dragengine.Scenery.BaseActor.
References pMatrix, pOrientation, and pPosition.
Referenced by debugInformation(), Dragengine.Scenery.BehaviorElement.onSetPosition(), and readFromFile().
| Dictionary Dragengine.Scenery.Element.debugInformation | ( | ) |
Debug information as Dictionary.
References addToGameWorld(), debugInformation(), dispose(), enterFrame(), isChildOf(), isMyselfOrChildOf(), log(), onSetGameWorld(), onSetGeometry(), onSetOrientation(), onSetParent(), onSetPosition(), onSetScaling(), onSetTouchable(), onSetVisible(), pClass, pGameWorld, pID, pOrientation, postThink(), pParent, pPosition, pScaling, pStub, pTouchable, pVisible, readElementFromFileWithStub(), readFromFile(), removeFromGameWorld(), removeFromGameWorldIfPresent(), safeDispose(), think(), toString(), updateStubGeometryFromElement(), visit(), writeElementToFileWithStub(), writeToFile(), and writeToFileWithStub().
Referenced by debugInformation().
| void Dragengine.Scenery.Element.dispose | ( | ) |
Dispose of element.
Breaks reference loops and cleans up.
Reimplemented in Dragengine.Scenery.SimpleElementOnRail.
References pIsScaled, pOrientation, pScaling, pTouchable, and pVisible.
Referenced by debugInformation(), Dragengine.Scenery.BehaviorElement.findInstance(), Dragengine.Scenery.BehaviorElement.getAttachableBehaviorCount(), and isNotDisposed().
| 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.
References getParent(), onSetGeometry(), pParent, and setParent().
Referenced by debugInformation(), and Dragengine.Scenery.BehaviorElement.onSetPosition().
| ElementClass Dragengine.Scenery.Element.getClass | ( | ) |
| DMatrix Dragengine.Scenery.Element.getElementMatrix | ( | ) |
Matrix to transform from element space into world space.
References pMatrix, and pOrientation.
Referenced by onSetParent(), and onSetPosition().
| GameWorld Dragengine.Scenery.Element.getGameWorld | ( | ) |
Retrieves the game world or null if not attached.
References getPosition(), and pPosition.
Referenced by Dragengine.Scenery.BehaviorElement.onSetPosition(), and think().
| UniqueID Dragengine.Scenery.Element.getID | ( | ) |
| DMatrix Dragengine.Scenery.Element.getInverseElementMatrix | ( | ) |
Matrix to transform from world space into element space.
References getScaling(), onSetOrientation(), pMatrixInverse, and pScaling.
Referenced by onSetParent().
| bool Dragengine.Scenery.Element.getIsScaled | ( | ) |
Is scaled.
Referenced by removeFromGameWorldIfPresent().
| Quaternion Dragengine.Scenery.Element.getOrientation | ( | ) |
Orientation.
Referenced by setTouchable(), and Dragengine.Scenery.BaseActor.visit().
| Element Dragengine.Scenery.Element.getParent | ( | ) |
Retrieves the parent or null if not attached.
References getClass().
Referenced by enterFrame(), and toString().
| DVector Dragengine.Scenery.Element.getPosition | ( | ) |
Position.
Referenced by getGameWorld().
| Vector Dragengine.Scenery.Element.getScaling | ( | ) |
| StubElement Dragengine.Scenery.Element.getStub | ( | ) |
Element stub used to create the element.
References pOrientation.
Referenced by Dragengine.Scenery.BehaviorElement.onSetPosition(), and updateStubGeometryFromElement().
| bool Dragengine.Scenery.Element.getTouchable | ( | ) |
Determines if the element is touchable.
References pMatrix, and pMatrixInverse.
Referenced by writeToFileWithStub().
| bool Dragengine.Scenery.Element.getVisible | ( | ) |
Determines if the element is visible.
References pPosition, and setPosition().
Referenced by readFromFile().
| 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.Gui.MainMenus.Interactive.IMMCameraSpot, Dragengine.Scenery.BaseActor, and Dragengine.Scenery.SimpleElementOnRail.
References isDisposed().
Referenced by Dragengine.Scenery.BehaviorElement.addAttachableBehavior(), Dragengine.Scenery.BehaviorElement.getAttachableBehaviorAt(), and setPosition().
| 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.
References pScaling, and setScaling().
Referenced by debugInformation(), and toString().
| 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.
References pIsScaled, pMatrix, pMatrixInverse, and pScaling.
Referenced by debugInformation().
| bool Dragengine.Scenery.Element.isNotDisposed | ( | ) |
| void Dragengine.Scenery.Element.log | ( | String | message | ) |
Log using BaseGameApp Console if present.
Referenced by debugInformation().
| Element Dragengine.Scenery.Element.new | ( | ElementClass | elementClass | ) |
| void Dragengine.Scenery.Element.onSetGameWorld | ( | ) |
Game world changed.
References pMatrixInverse.
Referenced by debugInformation(), and readFromFile().
| void Dragengine.Scenery.Element.onSetGeometry | ( | ) |
Position, orientation or scaling changed.
Referenced by debugInformation(), enterFrame(), Dragengine.Scenery.BehaviorElement.onSetPosition(), and removeFromGameWorld().
| void Dragengine.Scenery.Element.onSetOrientation | ( | ) |
Orientation changed.
References pIsScaled, pMatrix, pOrientation, pPosition, and pScaling.
Referenced by debugInformation(), getInverseElementMatrix(), and Dragengine.Scenery.BehaviorElement.onSetPosition().
| void Dragengine.Scenery.Element.onSetParent | ( | ) |
Parent changed.
References getElementMatrix(), getInverseElementMatrix(), and pMatrixInverse.
Referenced by debugInformation(), and think().
| void Dragengine.Scenery.Element.onSetPosition | ( | ) |
Position changed.
Reimplemented in Dragengine.Scenery.BehaviorElement.
References getElementMatrix(), and pMatrix.
Referenced by debugInformation(), and setTouchable().
| void Dragengine.Scenery.Element.onSetScaling | ( | ) |
Scaling changed.
References pMatrix.
Referenced by debugInformation(), Dragengine.Scenery.BehaviorElement.onSetPosition(), and removeFromGameWorldIfPresent().
| void Dragengine.Scenery.Element.onSetTouchable | ( | ) |
Touchable state changed.
Referenced by debugInformation(), Dragengine.Scenery.BehaviorElement.onSetPosition(), and writeElementToFileWithStub().
| void Dragengine.Scenery.Element.onSetVisible | ( | ) |
Visible state changed.
Referenced by debugInformation(), Dragengine.Scenery.BehaviorElement.onSetPosition(), and writeToFile().
| 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 |
References setGameWorld().
Referenced by debugInformation(), and Dragengine.Scenery.BehaviorElement.onSetPosition().
|
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.
References pStub.
Referenced by debugInformation().
| 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.
References addToGameWorld(), getVisible(), onSetGameWorld(), and pVisible.
Referenced by debugInformation(), and Dragengine.Scenery.BehaviorElement.onSetPosition().
| void Dragengine.Scenery.Element.removeFromGameWorld | ( | ) |
Removes the element content from the game world if placed there before.
References onSetGeometry(), pIsScaled, pMatrix, pMatrixInverse, pOrientation, pPosition, pScaling, and setGeometry().
Referenced by debugInformation(), Dragengine.Scenery.BehaviorElement.onSetPosition(), and visit().
| void Dragengine.Scenery.Element.removeFromGameWorldIfPresent | ( | ) |
Remove element from game world if present.
References getIsScaled(), onSetScaling(), and pIsScaled.
Referenced by debugInformation().
| 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.
References pOrientation, pPosition, and setGeometry().
Referenced by debugInformation().
| void Dragengine.Scenery.Element.setGameWorld | ( | GameWorld | gameWorld | ) |
Sets the game world or null if not attached.
Referenced by postThink().
| void Dragengine.Scenery.Element.setGeometry | ( | DVector | position, |
| Quaternion | orientation ) |
Set position and orientation.
Referenced by removeFromGameWorld(), and safeDispose().
| void Dragengine.Scenery.Element.setGeometry | ( | DVector | position, |
| Quaternion | orientation, | ||
| Vector | scaling ) |
| void Dragengine.Scenery.Element.setID | ( | UniqueID | id | ) |
Sets the unique id or null to unset it.
References isNotDisposed(), and pClass.
Referenced by setGeometry().
| void Dragengine.Scenery.Element.setOrientation | ( | Quaternion | orientation | ) |
Set orientation.
Referenced by setStub(), and Dragengine.Scenery.BaseActor.visit().
| void Dragengine.Scenery.Element.setParent | ( | Element | parent | ) |
| void Dragengine.Scenery.Element.setPosition | ( | DVector | position | ) |
| void Dragengine.Scenery.Element.setScaling | ( | Vector | scaling | ) |
| void Dragengine.Scenery.Element.setStub | ( | StubElement | stub | ) |
Set element stub used to create the element.
References pOrientation, and setOrientation().
Referenced by updateStubGeometryFromElement().
| void Dragengine.Scenery.Element.setTouchable | ( | bool | touchable | ) |
Sets if the element is touchable.
References getOrientation(), and onSetPosition().
Referenced by writeToFileWithStub().
| void Dragengine.Scenery.Element.setVisible | ( | bool | visible | ) |
Sets if the element is visible.
References pPosition.
Referenced by Dragengine.Scenery.BaseActor.visit(), and writeToFile().
| 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 |
References getGameWorld(), onSetParent(), and pGameWorld.
Referenced by debugInformation(), and Dragengine.Scenery.BehaviorElement.onSetPosition().
| String Dragengine.Scenery.Element.toString | ( | ) |
Return string representation of this Element.
References getParent(), and isChildOf().
Referenced by debugInformation().
| void Dragengine.Scenery.Element.updateStubGeometryFromElement | ( | ) |
Update stub position, rotation and scaling from element.
References getStub(), pStub, and setStub().
Referenced by debugInformation().
| void Dragengine.Scenery.Element.visit | ( | ElementVisitor | visitor | ) |
Visit this element.
Reimplemented in Dragengine.Gui.MainMenus.Interactive.IMMCameraSpot, Dragengine.Gui.MainMenus.Interactive.IMMEnvironmentMap, Dragengine.Gui.MainMenus.Interactive.IMMHotSpot, Dragengine.Gui.MainMenus.Interactive.IMMLight, Dragengine.Gui.MainMenus.Interactive.IMMParticleEmitter, Dragengine.Gui.MainMenus.Interactive.IMMProp, Dragengine.Gui.MainMenus.Interactive.IMMSpeaker, Dragengine.Scenery.AnimatedElement, Dragengine.Scenery.AttachableBaseBillboard, Dragengine.Scenery.AttachableBaseForceField, Dragengine.Scenery.AttachableBaseLight, Dragengine.Scenery.AttachableBaseParticleEmitter, Dragengine.Scenery.AttachableBaseSpeaker, Dragengine.Scenery.AttachSlot, Dragengine.Scenery.BaseActor, Dragengine.Scenery.BaseBillboard, Dragengine.Scenery.BaseForceField, Dragengine.Scenery.BaseLight, Dragengine.Scenery.BaseParticleEmitter, Dragengine.Scenery.BaseSky, Dragengine.Scenery.BaseSpeaker, Dragengine.Scenery.BaseVRActor, Dragengine.Scenery.BaseWorld, Dragengine.Scenery.EnvironmentMap, Dragengine.Scenery.GhostElement, Dragengine.Scenery.HiddenElement, Dragengine.Scenery.InfoConvoCoordSystem, Dragengine.Scenery.PhysicsElement, Dragengine.Scenery.SimpleElement, Dragengine.Scenery.SimpleElementOnRail, Dragengine.Scenery.TriggerConversation, Dragengine.Scenery.TriggerEvaluate, Dragengine.Scenery.TriggerShout, Dragengine.Scenery.TriggerTimer, Dragengine.Scenery.TriggerToggle, Dragengine.Scenery.TriggerTouch, and Dragengine.Scenery.TwoStateAnimatedElement.
References pGameWorld, and removeFromGameWorld().
Referenced by debugInformation(), and Dragengine.Scenery.BehaviorElement.onSetPosition().
|
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.
References onSetTouchable(), and pTouchable.
Referenced by debugInformation().
| 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.
References onSetVisible(), pVisible, and setVisible().
Referenced by debugInformation(), and Dragengine.Scenery.BehaviorElement.onSetPosition().
| 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.
References getTouchable(), pTouchable, and setTouchable().
Referenced by debugInformation().
| ElementClass Dragengine.Scenery.Element.pClass |
Referenced by debugInformation(), getID(), isNotDisposed(), new(), setID(), and setParent().
| GameWorld Dragengine.Scenery.Element.pGameWorld |
Referenced by debugInformation(), isNotDisposed(), think(), and visit().
| UniqueID Dragengine.Scenery.Element.pID |
Referenced by debugInformation(), setGeometry(), setGeometry(), and setOrientation().
| bool Dragengine.Scenery.Element.pIsScaled |
Referenced by dispose(), isMyselfOrChildOf(), onSetOrientation(), removeFromGameWorld(), removeFromGameWorldIfPresent(), and setScaling().
| DMatrix Dragengine.Scenery.Element.pMatrix |
| DMatrix Dragengine.Scenery.Element.pMatrixInverse |
Referenced by getInverseElementMatrix(), getTouchable(), isMyselfOrChildOf(), onSetGameWorld(), onSetParent(), and removeFromGameWorld().
| Quaternion Dragengine.Scenery.Element.pOrientation |
Referenced by addToGameWorld(), debugInformation(), dispose(), getElementMatrix(), getScaling(), getStub(), onSetOrientation(), removeFromGameWorld(), safeDispose(), and setStub().
| Element Dragengine.Scenery.Element.pParent |
Referenced by debugInformation(), enterFrame(), and isNotDisposed().
| DVector Dragengine.Scenery.Element.pPosition |
Referenced by addToGameWorld(), debugInformation(), getGameWorld(), getScaling(), getVisible(), new(), onSetOrientation(), removeFromGameWorld(), safeDispose(), and setVisible().
| Vector Dragengine.Scenery.Element.pScaling |
| StubElement Dragengine.Scenery.Element.pStub |
| bool Dragengine.Scenery.Element.pTouchable |
Referenced by debugInformation(), dispose(), writeElementToFileWithStub(), and writeToFileWithStub().
| bool Dragengine.Scenery.Element.pVisible |
Referenced by debugInformation(), dispose(), readFromFile(), and writeToFile().