Drag[en]gine Script Module DragonScript
1.23
|
Basic actor class. More...
Public Member Functions | |
void | addToGameWorld () |
Add to game world. More... | |
ECBehaviorActorAnimated.Instance | getActorAnimated () |
Actor animated behavior instance. More... | |
ECBehaviorActorMover.Instance | getActorMover () |
Actor mover instance. More... | |
ECBehaviorActorAIAction.Instance | getAIAction () |
AI-Action instance. More... | |
ECBehaviorAlignActor.Instance | getAlignActor () |
Align actor instance. More... | |
ECBehaviorAvoidCollision.Instance | getAvoidCollision () |
Avoid collision instance. More... | |
ECBehaviorAvoidedByActor.Instance | getAvoidedByActor () |
Avoided by actor instance. More... | |
ECBehaviorCollider.Instance | getCollider () |
Collider behavior instance. More... | |
ECBehaviorColliderAI.Instance | getColliderAI () |
Collider AI behavior instance. More... | |
ECBehaviorComponent.Instance | getComponent () |
Component behavio instance. More... | |
ECBehaviorConversationActor.Instance | getConversationActor () |
Conversation actor instance. More... | |
ECBehaviorFootSteps.Instance | getFootSteps () |
Foot steps instance. More... | |
ECBehaviorLocomotion.Instance | getLocomotion () |
Locomotion behavior instance. More... | |
ECBehaviorNavigator.Instance | getNavigator () |
Navigator instance. More... | |
ECBehaviorParameterTable.Instance | getParameterTable () |
Parameter table instance. More... | |
ECBehaviorPlayerControllable.Instance | getPlayerControllable () |
Player controllable instance. More... | |
ECBehaviorPlayerInputCrouch.Instance | getPlayerInputCrouch () |
Player input crouching behavior instance. More... | |
ECBehaviorPlayerInputLook.Instance | getPlayerInputLook () |
Player input looking around behavior instance. More... | |
ECBehaviorPlayerInputMove.Instance | getPlayerInputMove () |
Player input moving behavior instance. More... | |
ECBehaviorPlayerInputTurn.Instance | getPlayerInputTurn () |
Player input turning behavior instance. More... | |
ECBehaviorProjectToGround.Instance | getProjectToGround () |
Project to ground behavior instance. More... | |
ECBehaviorRideOn.Instance | getRideOn () |
Ride on instance. More... | |
void | init (StubElement stub) |
Initialize element from stub. More... | |
BaseActor | new (BaseActorClass eclass) |
Create element. More... | |
void | readFromFile (PersistencyEnvironment env, FileReader reader) |
Read element from file. More... | |
void | teleportAdjustActor () |
Adjust actor after teleporting. More... | |
void | visit (ElementVisitor visitor) |
Visit element. More... | |
void | writeToFile (PersistencyEnvironment env, FileWriter writer) |
Public Member Functions inherited from Dragengine.Scenery.BehaviorElement | |
void | addAttachableBehavior (ECAttachableBehavior behavior) |
Add attached behavior. More... | |
Array | collectAttachableBehaviors (Block ablock) |
Collect attached behaviors with block into Array. More... | |
Array | collectInstances (Block ablock) |
Collect behavior instance with block into Array. More... | |
ECAttachableBehavior | findAttachableBehavior (Block ablock) |
Find attached behavior with block. More... | |
ECBehaviorInstance | findInstance (Block ablock) |
Find behavior instance with block. More... | |
void | forEachAttachableBehavior (Block ablock) |
Visit attached s with block. More... | |
void | forEachAttachableBehaviorReverse (Block ablock) |
Visit attached behaviors with block in reverse order. More... | |
void | forEachInstance (Block ablock) |
Visit behavior instances with block. More... | |
void | forEachInstanceReverse (Block ablock) |
Visit behavior instances with block in reverse order. More... | |
ECAttachableBehavior | getAttachableBehaviorAt (int index) |
Attached behavior at index. More... | |
int | getAttachableBehaviorCount () |
Count of attachaed behaviors. More... | |
bool | getRequiresAttachToParent () |
Attach to parent has not been processed yet. More... | |
bool | getRequiresEnterFrame () |
Sub-class requires enterFrame() to be called. More... | |
bool | getRequiresThink () |
Sub-class requires think() to be called. More... | |
bool | isChangingGameWorld () |
Behavior element is in progress of beeing added to or removed from a GameWorld. More... | |
bool | isReallyInGameWorld () |
Element is in GameWorld and not in progress of beeing removed from it. More... | |
BehaviorElement | new (BehaviorElementClass eclass) |
Create element. More... | |
void | onSetPosition () |
Position changed. More... | |
void | removeAttachableBehavior (ECAttachableBehavior behavior) |
Remove attached behavior. More... | |
void | requiresThinkChanged () |
Requires thinking changed. More... | |
void | setRequiresAttachToParent (bool requiresAttachToParent) |
Set if attach to parent has not been processed yet. More... | |
Public Member Functions inherited from Dragengine.Scenery.Element | |
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 () |
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 | onSetScaling () |
Scaling changed. More... | |
void | onSetTouchable () |
void | onSetVisible () |
void | postThink (float elapsed) |
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 | updateStubGeometryFromElement () |
Update stub position, rotation and scaling from element. More... | |
void | writeToFileWithStub (PersistencyEnvironment env, FileWriter writer) |
Write element to file writer with stub. More... | |
Public Attributes | |
ECBehaviorActorAnimated.Instance | pActorAnimated |
ECBehaviorActorMover.Instance | pActorMover |
ECBehaviorActorAIAction.Instance | pAIAction |
ECBehaviorAlignActor.Instance | pAlignActor |
ECBehaviorAvoidCollision.Instance | pAvoidCollision |
ECBehaviorAvoidedByActor.Instance | pAvoidedByActor |
ECBehaviorCollider.Instance | pCollider |
ECBehaviorColliderAI.Instance | pColliderAI |
ECBehaviorComponent.Instance | pComponent |
ECBehaviorConversationActor.Instance | pConversationActor |
ECBehaviorFootSteps.Instance | pFootSteps |
ECBehaviorLocomotion.Instance | pLocomotion |
ECBehaviorNavigator.Instance | pNavigator |
ECBehaviorParameterTable.Instance | pParameterTable |
ECBehaviorPlayerControllable.Instance | pPlayerControllable |
ECBehaviorPlayerInputCrouch.Instance | pPlayerInputCrouch |
ECBehaviorPlayerInputLook.Instance | pPlayerInputLook |
ECBehaviorPlayerInputMove.Instance | pPlayerInputMove |
ECBehaviorPlayerInputTurn.Instance | pPlayerInputTurn |
ECBehaviorProjectToGround.Instance | pProjectToGround |
ECBehaviorRideOn.Instance | pRideOn |
Public Attributes inherited from Dragengine.Scenery.BehaviorElement | |
Array | pAttachableBehaviors |
Array | pInstances |
bool | pIsChangingGameWorld |
bool | pIsThinker |
bool | pRequiresAttachToParent |
bool | pRequiresEnterFrame |
bool | pRequiresThink |
Public Attributes inherited from Dragengine.Scenery.Element | |
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 |
Protected Member Functions | |
void | initAvoidCollisionShape (StubElement stub) |
Initialize avoid collision collider shape. More... | |
void | initColliderShape (StubElement stub) |
Initialize collider AI shape. More... | |
void | initNavigator (StubElement stub) |
Initialize navigator. More... | |
void | initProjectToGroundShapes (StubElement stub) |
Initialize project to ground shapes. More... | |
void | spawnAdjustActor () |
Adjust actor after spawning. More... | |
Protected Member Functions inherited from Dragengine.Scenery.BehaviorElement | |
void | setRequiresEnterFrame (bool requiresEnterFrame) |
Set if sub-class requires enterFrame() to be called. More... | |
void | setRequiresThink (bool requiresThink) |
Set if sub-class requires think() to be called. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Dragengine.Scenery.Element | |
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... | |
Basic actor class.
Basic implementation of an actor in a game. Actors exhibit complex behavior beyond simple interactions as provided by props. Typically this behavior can be split into two different groups: actions and AI.
BaseActor extends SimpleElement since actor handling requires a visible component as well as a collider to properly move inside the game world. BaseActor registers itself as thinker.
void Dragengine.Scenery.BaseActor.addToGameWorld | ( | ) |
Add to game world.
Reimplemented from Dragengine.Scenery.Element.
ECBehaviorActorAnimated.Instance Dragengine.Scenery.BaseActor.getActorAnimated | ( | ) |
Actor animated behavior instance.
ECBehaviorActorMover.Instance Dragengine.Scenery.BaseActor.getActorMover | ( | ) |
Actor mover instance.
ECBehaviorActorAIAction.Instance Dragengine.Scenery.BaseActor.getAIAction | ( | ) |
AI-Action instance.
ECBehaviorAlignActor.Instance Dragengine.Scenery.BaseActor.getAlignActor | ( | ) |
Align actor instance.
ECBehaviorAvoidCollision.Instance Dragengine.Scenery.BaseActor.getAvoidCollision | ( | ) |
Avoid collision instance.
ECBehaviorAvoidedByActor.Instance Dragengine.Scenery.BaseActor.getAvoidedByActor | ( | ) |
Avoided by actor instance.
ECBehaviorCollider.Instance Dragengine.Scenery.BaseActor.getCollider | ( | ) |
Collider behavior instance.
ECBehaviorColliderAI.Instance Dragengine.Scenery.BaseActor.getColliderAI | ( | ) |
Collider AI behavior instance.
ECBehaviorComponent.Instance Dragengine.Scenery.BaseActor.getComponent | ( | ) |
Component behavio instance.
ECBehaviorConversationActor.Instance Dragengine.Scenery.BaseActor.getConversationActor | ( | ) |
Conversation actor instance.
ECBehaviorFootSteps.Instance Dragengine.Scenery.BaseActor.getFootSteps | ( | ) |
Foot steps instance.
ECBehaviorLocomotion.Instance Dragengine.Scenery.BaseActor.getLocomotion | ( | ) |
Locomotion behavior instance.
ECBehaviorNavigator.Instance Dragengine.Scenery.BaseActor.getNavigator | ( | ) |
Navigator instance.
ECBehaviorParameterTable.Instance Dragengine.Scenery.BaseActor.getParameterTable | ( | ) |
Parameter table instance.
ECBehaviorPlayerControllable.Instance Dragengine.Scenery.BaseActor.getPlayerControllable | ( | ) |
Player controllable instance.
ECBehaviorPlayerInputCrouch.Instance Dragengine.Scenery.BaseActor.getPlayerInputCrouch | ( | ) |
Player input crouching behavior instance.
ECBehaviorPlayerInputLook.Instance Dragengine.Scenery.BaseActor.getPlayerInputLook | ( | ) |
Player input looking around behavior instance.
ECBehaviorPlayerInputMove.Instance Dragengine.Scenery.BaseActor.getPlayerInputMove | ( | ) |
Player input moving behavior instance.
ECBehaviorPlayerInputTurn.Instance Dragengine.Scenery.BaseActor.getPlayerInputTurn | ( | ) |
Player input turning behavior instance.
ECBehaviorProjectToGround.Instance Dragengine.Scenery.BaseActor.getProjectToGround | ( | ) |
Project to ground behavior instance.
ECBehaviorRideOn.Instance Dragengine.Scenery.BaseActor.getRideOn | ( | ) |
Ride on instance.
void Dragengine.Scenery.BaseActor.init | ( | StubElement | stub | ) |
Initialize element from stub.
Calls these hook methods to do initialization work.
Reimplemented from Dragengine.Scenery.Element.
|
protected |
Initialize avoid collision collider shape.
Sets sphere shape with the same size as used for the collider AI shape.
|
protected |
Initialize collider AI shape.
Assigns a capsule shape to the collider AI. The capsule has a total height of 1.8m and is 0.6m wide. This is a reasonable collider AI shape for a humanoid actor.
|
protected |
Initialize navigator.
See ECBehaviorNavigator.init() . Sets layer to 0 and space type to NavigationSpaceType.mesh . Sets default fix cost to 0 and default cost-per-meter to 1. These apply if no cost types are added by the actor or other behaviors. The blocking cost is set to 10000.
Subclass should add type specific costs if required.
|
protected |
Initialize project to ground shapes.
Assigns a box shape to the project to ground touch sensor. The shape is located at the actor position and has a radius of slightly more than the radius used for the collider AI (0.31m) and a height of the same value. This is a reasonable collider AI shape for a humanoid actor.
Assigns a sphere shape to the project to ground instance. This is usually the same shape as used for the collider AI but can be optimized. For example if the shape is a capcule the project to ground shape can be opzimized to a sphere of the matching radius. The default implementation does apply this optimization and uses a sphere with the same radius as used for the collider AI capsule.
BaseActor Dragengine.Scenery.BaseActor.new | ( | BaseActorClass | eclass | ) |
Create element.
void Dragengine.Scenery.BaseActor.readFromFile | ( | PersistencyEnvironment | env, |
FileReader | reader | ||
) |
Read element from file.
Reimplemented from Dragengine.Scenery.Element.
|
protected |
Adjust actor after spawning.
Updates the actor turning to match the orientation. Also resets some parameters to make the actor appear without erratic motions. Called during addToGameWorld.
void Dragengine.Scenery.BaseActor.teleportAdjustActor | ( | ) |
Adjust actor after teleporting.
Calls spawnAdjustActor().
void Dragengine.Scenery.BaseActor.visit | ( | ElementVisitor | visitor | ) |
Visit element.
Reimplemented from Dragengine.Scenery.Element.
Reimplemented in Dragengine.Scenery.BaseVRActor.
void Dragengine.Scenery.BaseActor.writeToFile | ( | PersistencyEnvironment | env, |
FileWriter | writer | ||
) |
Writes the element to a file.
Reimplemented from Dragengine.Scenery.Element.
ECBehaviorActorAnimated.Instance Dragengine.Scenery.BaseActor.pActorAnimated |
ECBehaviorActorMover.Instance Dragengine.Scenery.BaseActor.pActorMover |
ECBehaviorActorAIAction.Instance Dragengine.Scenery.BaseActor.pAIAction |
ECBehaviorAlignActor.Instance Dragengine.Scenery.BaseActor.pAlignActor |
ECBehaviorAvoidCollision.Instance Dragengine.Scenery.BaseActor.pAvoidCollision |
ECBehaviorAvoidedByActor.Instance Dragengine.Scenery.BaseActor.pAvoidedByActor |
ECBehaviorCollider.Instance Dragengine.Scenery.BaseActor.pCollider |
ECBehaviorColliderAI.Instance Dragengine.Scenery.BaseActor.pColliderAI |
ECBehaviorComponent.Instance Dragengine.Scenery.BaseActor.pComponent |
ECBehaviorConversationActor.Instance Dragengine.Scenery.BaseActor.pConversationActor |
ECBehaviorFootSteps.Instance Dragengine.Scenery.BaseActor.pFootSteps |
ECBehaviorLocomotion.Instance Dragengine.Scenery.BaseActor.pLocomotion |
ECBehaviorNavigator.Instance Dragengine.Scenery.BaseActor.pNavigator |
ECBehaviorParameterTable.Instance Dragengine.Scenery.BaseActor.pParameterTable |
ECBehaviorPlayerControllable.Instance Dragengine.Scenery.BaseActor.pPlayerControllable |
ECBehaviorPlayerInputCrouch.Instance Dragengine.Scenery.BaseActor.pPlayerInputCrouch |
ECBehaviorPlayerInputLook.Instance Dragengine.Scenery.BaseActor.pPlayerInputLook |
ECBehaviorPlayerInputMove.Instance Dragengine.Scenery.BaseActor.pPlayerInputMove |
ECBehaviorPlayerInputTurn.Instance Dragengine.Scenery.BaseActor.pPlayerInputTurn |
ECBehaviorProjectToGround.Instance Dragengine.Scenery.BaseActor.pProjectToGround |
ECBehaviorRideOn.Instance Dragengine.Scenery.BaseActor.pRideOn |