Drag[en]gine Script Module DragonScript
1.23
|
Behavior element behavior adding support to control desktop by player. More...
Classes | |
class | Instance |
Behavior instance. More... | |
Public Member Functions | |
void | dispose () |
Dispose of behavior. More... | |
ECPString | getBone () |
Bone name or empty string to not use. More... | |
ECPVector | getLowerLeft () |
Virtual plane lower left position. More... | |
ECPVector | getLowerRight () |
Virtual plane lower right position. More... | |
ECBehaviorRenderableDesktop | getRenderableDesktop () |
Renderable desktop behavior. More... | |
ECPVector | getUpperLeft () |
Virtual plane upper left position. More... | |
Instance | instance (BehaviorElement element) |
Get instance in element from owner element class. More... | |
ECBehaviorControlDesktop | new (BehaviorElementClass eclass, ECBehaviorRenderableDesktop renderableDesktop) |
Create behavior element class. More... | |
ECBehaviorControlDesktop | new (BehaviorElementClass eclass, ECBehaviorRenderableDesktop renderableDesktop, String id) |
ECBehaviorControlDesktop | new (BehaviorElementClass eclass, ECBehaviorRenderableDesktop renderableDesktop, String id, String prefix) |
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
void | assignInstanceIndex (int instanceIndex) |
Assign instance index. More... | |
String | getBehaviorID () |
Unique identifier of behavior. More... | |
String | getID () |
Identifier. More... | |
int | getInstanceIndex () |
Instance index. More... | |
void | loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance) |
Load instance data of another behavior. More... | |
bool | supportsBehaviorID (String identifier) |
Behavior supports loading instance data of another behavior. More... | |
Public Member Functions inherited from Dragengine.Scenery.ECBehavior | |
ECBehaviorInstance | createInstance (BehaviorElement element) |
Create Behavior instance. More... | |
Static Public Member Functions | |
static ECBehaviorControlDesktop | getBehaviorIn (BehaviorElementClass eclass) |
Get behavior in element class or null if absent. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
DefaultECBehavior | new (BehaviorElementClass eclass) |
Create default composeable behavior with empty identifier. More... | |
DefaultECBehavior | new (BehaviorElementClass eclass, String id) |
Create default composeable behavior. More... | |
void | setBehaviorID (String identifier) |
Set behavior identifier. More... | |
void | useClassNameAsBehaviorID () |
Set behavior identifier to "<class-name>:<identifier>". More... | |
void | useFullyQualifiedClassNameAsBehaviorID () |
Set behavior identifier to "<fully-qualified-class-name>:<identifier>". More... | |
Behavior element behavior adding support to control desktop by player.
The behavior allows player (or other actors) to move the mouse pointer on a ECBehaviorRenderableDesktop by looking or pointing at the desired position. Also the player can simulate a left or right mouse click by using an input binding defined by the actor himself. This kind of input is typically used for VR games but can be also used for non VR games like first person shooters.
The behavior defines three corner points of a virtual rectangular plane. The player looking or pointing direction is intersected with this virtual plane. The relative position of this hit point is mapped to the Desktop widget. The three corners of the virtual plane are the lower left, lower right and upper left corner.
Optionally a bone name can be specified. If the bone name is not empty the virtual plane corners are relative to the bone. This allows to create desktop input zones which can be displaced.
The behavior can be optionally disabled to allow the input to be available to the player only if certain conditions are fulfilled.
The actor is responsible to move the mouse pointer. This behavior provides convenience methods to do the calculation and updating of the mouse pointer.
A typical usage of this behavior looks like this:
The same example can be done using ECBehaviorLookAt instead of ECBehaviorVRHandPointAt.
This behavior can be used multiple times for example to control different renderable desktops. Element class properties have the prefix "controlDesktop{(id)}.".
This behavior requires ECBehaviorRenderableDesktop to be present.
This behavior require the element class to be persistable (setPersistable).
void Dragengine.Scenery.ECBehaviorControlDesktop.dispose | ( | ) |
Dispose of behavior.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
|
static |
Get behavior in element class or null if absent.
Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorComponent.
ECPString Dragengine.Scenery.ECBehaviorControlDesktop.getBone | ( | ) |
Bone name or empty string to not use.
ECPVector Dragengine.Scenery.ECBehaviorControlDesktop.getLowerLeft | ( | ) |
Virtual plane lower left position.
ECPVector Dragengine.Scenery.ECBehaviorControlDesktop.getLowerRight | ( | ) |
Virtual plane lower right position.
ECBehaviorRenderableDesktop Dragengine.Scenery.ECBehaviorControlDesktop.getRenderableDesktop | ( | ) |
Renderable desktop behavior.
ECPVector Dragengine.Scenery.ECBehaviorControlDesktop.getUpperLeft | ( | ) |
Virtual plane upper left position.
Instance Dragengine.Scenery.ECBehaviorControlDesktop.instance | ( | BehaviorElement | element | ) |
Get instance in element from owner element class.
ECBehaviorControlDesktop Dragengine.Scenery.ECBehaviorControlDesktop.new | ( | BehaviorElementClass | eclass, |
ECBehaviorRenderableDesktop | renderableDesktop | ||
) |
Create behavior element class.
ECBehaviorControlDesktop Dragengine.Scenery.ECBehaviorControlDesktop.new | ( | BehaviorElementClass | eclass, |
ECBehaviorRenderableDesktop | renderableDesktop, | ||
String | id | ||
) |
ECBehaviorControlDesktop Dragengine.Scenery.ECBehaviorControlDesktop.new | ( | BehaviorElementClass | eclass, |
ECBehaviorRenderableDesktop | renderableDesktop, | ||
String | id, | ||
String | prefix | ||
) |