Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.ECBehaviorPlayerInputLook Class Reference

Behavior element behavior adding looking around player input. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorPlayerInputLook:
Dragengine.Scenery.DefaultECBehavior Dragengine.Scenery.ECBehavior Dragengine.Scenery.BehaviorCompatiblePersistency

Classes

class  Factory
 Behavior factory. More...
class  Instance
 Behavior instance. More...

Public Member Functions

void dispose ()
 Dispose of behavior.
ECPFloat getAnalogFactorLookHorizontal ()
 Analog Look left right factor relative to left right input speed.
ECPFloat getAnalogFactorLookVertical ()
 Analog Look up down factor relative to up down input speed.
ECComposeBTSM getBTSMs ()
 Compose behavior trees and state machines.
ECBehaviorLocomotion getLocomotion ()
 Locomotion behavior or null.
String getPrefix ()
 Prefix.
ECPFloat getSpeedLookHorizontal ()
 Look left right speed in degrees per second.
ECPFloat getSpeedLookVertical ()
 Look up down speed in degrees per second.
Instance instance (BehaviorElement element)
 Get instance in element from owner element class.
ECBehaviorPlayerInputLook new (BehaviorElementClass eclass, ECBehaviorLocomotion locomotion)
 Create behavior element class.
ECBehaviorPlayerInputLook new (BehaviorElementClass eclass, ECBehaviorLocomotion locomotion, String prefix)
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
void assignInstanceIndex (int instanceIndex)
 Assign instance index.
String getBehaviorID ()
 Unique identifier of behavior.
String getID ()
 Identifier.
int getInstanceIndex ()
 Instance index.
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance)
 Load instance data of another behavior.
bool supportsBehaviorID (String identifier)
 Behavior supports loading instance data of another behavior.
Public Member Functions inherited from Dragengine.Scenery.ECBehavior
ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance.

Static Public Member Functions

static ECBehaviorPlayerInputLook getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent.

Public Attributes

ECPFloat pAnalogFactorLookHorizontal
ECPFloat pAnalogFactorLookVertical
ECComposeBTSM pBTSMs
ECBehaviorLocomotion pLocomotion
String pPrefix
ECPFloat pSpeedLookHorizontal
ECPFloat pSpeedLookVertical

Additional Inherited Members

Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
DefaultECBehavior new (BehaviorElementClass eclass)
 Create default composeable behavior with empty identifier.
DefaultECBehavior new (BehaviorElementClass eclass, String id)
 Create default composeable behavior.
void setBehaviorID (String identifier)
 Set behavior identifier.
void useClassNameAsBehaviorID ()
 Set behavior identifier to "<class-name>:<identifier>".
void useFullyQualifiedClassNameAsBehaviorID ()
 Set behavior identifier to "<fully-qualified-class-name>:<identifier>".

Detailed Description

Behavior element behavior adding looking around player input.

Keeps track of looking around player input and applies them to actor locomotion.

This behavior supports persistable element class (setPersistable).

Digital Input

Supports digital input by player for looking left-right and up-down using digital input devices like keyboard or game pad buttons. The setSpeedLookHorizontal() and setSpeedLookVertical() methods set the speed of looking while the input is enabled. The calculation of looking delta by digital input is this:

delta = (+/-) speed * elapsedTime

Whereas + is if left input is enabled while - is used if right input is enabled. Using negative speed switches direction.

Analog Input

Supports analog input by player for looking left-right and up-down using analog input devices like mouse, game pad analog sticksothers. The analog input can be set directly from the input event (for example mouse move deltas). The setAnalogFactorLookHorizontal() and setAnalogFactorLookVertical() methods set the sensitivity of the input value transforming it into a value comparable to using digital input. The default value is 0.01 resulting in analog input suitable for first person navigation. Smaller values make analog input slower increasing accuracy pointing at specific locations while larger values make analog input faster. The same holds true for changing the digital input speed. The calculation of looking delta by analog input is this:

delta = analogInput * analogFactor * speed

This calculation applies only to non-sticky input as this originates from mouse input devices only. Sticky inputs originating from game pads and similar used the elapsed time instead of analogFactor and thus are similar to digital input.

Using negative factor switches direction. Using negative factor and speed keeps the direction unchanged.

See also
https://developer.dragondreams.ch/wiki/doku.php/dragengine:modules:dragonscript:behavior_playerinputlook

Member Function Documentation

◆ dispose()

void Dragengine.Scenery.ECBehaviorPlayerInputLook.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

References getAnalogFactorLookVertical().

Referenced by getBehaviorIn().

◆ getAnalogFactorLookHorizontal()

ECPFloat Dragengine.Scenery.ECBehaviorPlayerInputLook.getAnalogFactorLookHorizontal ( )

Analog Look left right factor relative to left right input speed.

Referenced by getBehaviorIn().

◆ getAnalogFactorLookVertical()

ECPFloat Dragengine.Scenery.ECBehaviorPlayerInputLook.getAnalogFactorLookVertical ( )

Analog Look up down factor relative to up down input speed.

Referenced by dispose(), and getBehaviorIn().

◆ getBehaviorIn()

◆ getBTSMs()

ECComposeBTSM Dragengine.Scenery.ECBehaviorPlayerInputLook.getBTSMs ( )

Compose behavior trees and state machines.

Version
1.26

References pLocomotion.

Referenced by getBehaviorIn().

◆ getLocomotion()

ECBehaviorLocomotion Dragengine.Scenery.ECBehaviorPlayerInputLook.getLocomotion ( )

Locomotion behavior or null.

Referenced by getBehaviorIn().

◆ getPrefix()

String Dragengine.Scenery.ECBehaviorPlayerInputLook.getPrefix ( )

Prefix.

Version
1.26

Referenced by getBehaviorIn().

◆ getSpeedLookHorizontal()

ECPFloat Dragengine.Scenery.ECBehaviorPlayerInputLook.getSpeedLookHorizontal ( )

Look left right speed in degrees per second.

Referenced by getBehaviorIn().

◆ getSpeedLookVertical()

ECPFloat Dragengine.Scenery.ECBehaviorPlayerInputLook.getSpeedLookVertical ( )

Look up down speed in degrees per second.

Referenced by getBehaviorIn().

◆ instance()

◆ new() [1/2]

ECBehaviorPlayerInputLook Dragengine.Scenery.ECBehaviorPlayerInputLook.new ( BehaviorElementClass eclass,
ECBehaviorLocomotion locomotion )

Create behavior element class.

Referenced by getBehaviorIn().

◆ new() [2/2]

ECBehaviorPlayerInputLook Dragengine.Scenery.ECBehaviorPlayerInputLook.new ( BehaviorElementClass eclass,
ECBehaviorLocomotion locomotion,
String prefix )

Member Data Documentation

◆ pAnalogFactorLookHorizontal

ECPFloat Dragengine.Scenery.ECBehaviorPlayerInputLook.pAnalogFactorLookHorizontal

Referenced by getBehaviorIn(), and instance().

◆ pAnalogFactorLookVertical

ECPFloat Dragengine.Scenery.ECBehaviorPlayerInputLook.pAnalogFactorLookVertical

Referenced by getBehaviorIn(), and instance().

◆ pBTSMs

ECComposeBTSM Dragengine.Scenery.ECBehaviorPlayerInputLook.pBTSMs

Referenced by getBehaviorIn().

◆ pLocomotion

ECBehaviorLocomotion Dragengine.Scenery.ECBehaviorPlayerInputLook.pLocomotion

Referenced by getBehaviorIn(), and getBTSMs().

◆ pPrefix

String Dragengine.Scenery.ECBehaviorPlayerInputLook.pPrefix

Referenced by getBehaviorIn().

◆ pSpeedLookHorizontal

ECPFloat Dragengine.Scenery.ECBehaviorPlayerInputLook.pSpeedLookHorizontal

Referenced by getBehaviorIn(), and instance().

◆ pSpeedLookVertical

ECPFloat Dragengine.Scenery.ECBehaviorPlayerInputLook.pSpeedLookVertical

Referenced by getBehaviorIn(), and instance().


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