Drag[en]gine Script Module DragonScript  1.23
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  Instance
 Behavior instance. More...
 

Public Member Functions

ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance. More...
 
void dispose ()
 Dispose of behavior. More...
 
ECPFloat getAnalogFactorLookHorizontal ()
 Analog Look left right factor relative to left right input speed. More...
 
ECPFloat getAnalogFactorLookVertical ()
 Analog Look up down factor relative to up down input speed. More...
 
ECBehaviorLocomotion getLocomotion ()
 Locomotion behavior or null. More...
 
ECPFloat getSpeedLookHorizontal ()
 Look left right speed in degrees per second. More...
 
ECPFloat getSpeedLookVertical ()
 Look up down speed in degrees per second. More...
 
Instance instance (BehaviorElement element)
 Get instance in element from owner element class. More...
 
ECBehaviorPlayerInputLook new (BehaviorElementClass eclass, ECBehaviorLocomotion locomotion)
 Create behavior element class. More...
 
ECBehaviorPlayerInputLook new (BehaviorElementClass eclass, ECBehaviorLocomotion locomotion, 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...
 

Static Public Member Functions

static ECBehaviorPlayerInputLook getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent. More...
 
static Instance getInstanceIn (BehaviorElement element)
 Get instance in element 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...
 

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.

Member Function Documentation

◆ createInstance()

ECBehaviorInstance Dragengine.Scenery.ECBehaviorPlayerInputLook.createInstance ( BehaviorElement  element)

Create Behavior instance.

Implements Dragengine.Scenery.ECBehavior.

◆ dispose()

void Dragengine.Scenery.ECBehaviorPlayerInputLook.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ getAnalogFactorLookHorizontal()

ECPFloat Dragengine.Scenery.ECBehaviorPlayerInputLook.getAnalogFactorLookHorizontal ( )

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

◆ getAnalogFactorLookVertical()

ECPFloat Dragengine.Scenery.ECBehaviorPlayerInputLook.getAnalogFactorLookVertical ( )

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

◆ getBehaviorIn()

static ECBehaviorPlayerInputLook Dragengine.Scenery.ECBehaviorPlayerInputLook.getBehaviorIn ( BehaviorElementClass  eclass)
static

Get behavior in element class or null if absent.

Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorPlayerInputLook.

◆ getInstanceIn()

static Instance Dragengine.Scenery.ECBehaviorPlayerInputLook.getInstanceIn ( BehaviorElement  element)
static

Get instance in element or null if absent.

Use this method to check if a particular BehaviorElement contains a behavior instance of type ECBehaviorPlayerInputLook.Instance .

◆ getLocomotion()

ECBehaviorLocomotion Dragengine.Scenery.ECBehaviorPlayerInputLook.getLocomotion ( )

Locomotion behavior or null.

◆ getSpeedLookHorizontal()

ECPFloat Dragengine.Scenery.ECBehaviorPlayerInputLook.getSpeedLookHorizontal ( )

Look left right speed in degrees per second.

◆ getSpeedLookVertical()

ECPFloat Dragengine.Scenery.ECBehaviorPlayerInputLook.getSpeedLookVertical ( )

Look up down speed in degrees per second.

◆ instance()

Instance Dragengine.Scenery.ECBehaviorPlayerInputLook.instance ( BehaviorElement  element)

Get instance in element from owner element class.

◆ new() [1/2]

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

Create behavior element class.

◆ new() [2/2]

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

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