Drag[en]gine Script Module DragonScript  1.23
Dragengine.CameraDirectors.PlayerControlledActorCameraDirector Class Reference

Place camera relative player controlled actor with orbit support. More...

Inheritance diagram for Dragengine.CameraDirectors.PlayerControlledActorCameraDirector:
Dragengine.CameraDirectors.ElementCameraDirector Dragengine.CameraDirectors.CameraDirector Dragengine.CameraDirectors.VRPlayerControlledActorCameraDirector

Classes

class  ActorChanged
 Tracker listener. More...
 

Public Member Functions

ECBehaviorPlayerControllable.Instance getActor ()
 Actor or null. More...
 
ECBehaviorColliderAI.Instance getColliderAI ()
 Collider AI or null if absent. More...
 
bool getLockAzimuth ()
 Do not update azimuth from locomotion changes. More...
 
bool getLockElevation ()
 Do not update elevation from locomotion changes. More...
 
ECBehaviorLocomotion.Instance getLocomotion ()
 Locomotion or null if absent. More...
 
ECBehaviorPlayerControllable.Tracker getTracker ()
 Tracker or null. More...
 
PlayerControlledActorCameraDirector new ()
 Create camera director. More...
 
PlayerControlledActorCameraDirector new (Camera camera, Microphone microphone)
 Create camera director. More...
 
PlayerControlledActorCameraDirector new (Camera camera, Microphone microphone, ECBehaviorPlayerControllable.Tracker tracker)
 Create camera director. More...
 
void setActor (ECBehaviorPlayerControllable.Instance actor)
 Set actor or null. More...
 
void setLockAzimuth (bool lock)
 Set to not update azimuth from locomotion changes. More...
 
void setLockElevation (bool lock)
 Set to not update elevation from locomotion changes. More...
 
void setPivotAboveGround (float distance)
 Set pivot point at desired distance above ground. More...
 
void setTracker (ECBehaviorPlayerControllable.Tracker tracker)
 Set tracker or null. More...
 
void updateCamera (float elapsed)
 Update camera. More...
 
void updateMicrophone (float elapsed)
 Update microphone. More...
 
- Public Member Functions inherited from Dragengine.CameraDirectors.ElementCameraDirector
float getAzimuth ()
 Vertical rotation. More...
 
DMatrix getCameraMatrix ()
 Camera matrix. More...
 
float getDistance ()
 Distance. More...
 
Element getElement ()
 Element. More...
 
float getElevation ()
 Horizontal rotation. More...
 
DMatrix getLocalMatrix ()
 Local matrix. More...
 
DVector getPivot ()
 Rotation point. More...
 
bool getUseOrientation ()
 Use element orientation. More...
 
ElementCameraDirector new (Element element)
 Create camera director. More...
 
ElementCameraDirector new (Element element, Camera camera, Microphone microphone)
 Create camera director. More...
 
void setAzimuth (float azimuth)
 Set vertical rotation. More...
 
void setDistance (float distance)
 Set distance. More...
 
void setElement (Element element)
 Set element. More...
 
void setElevation (float elevation)
 Set horizontal rotation. More...
 
void setLocalMatrix (DMatrix localMatrix)
 Set local matrix. More...
 
void setLocalMatrix (Vector position, Vector rotation)
 Set local matrix from position and rotation. More...
 
void setPivot (DVector pivot)
 Set rotation point. More...
 
void setUseOrientation (bool useOrientation)
 Set use element orientation. More...
 
- Public Member Functions inherited from Dragengine.CameraDirectors.CameraDirector
void activate ()
 Director has been activated. More...
 
void applyParameters (Camera camera)
 Apply parameters to camera. More...
 
void applyParameters (Microphone microphone)
 Apply parameters to microphone. More...
 
void copyParameters (Camera camera)
 Copy parameters from camera. More...
 
void copyParameters (CameraDirector director)
 Copy parameters from camera director. More...
 
void copyParameters (Microphone microphone)
 Copy parameters from microphone. More...
 
void deactivate ()
 Director has been deactivated. More...
 
float getAdaptionTime ()
 Adaption time. More...
 
float getBloomBlend ()
 Bloom blend as multiplier of intensity beyond bloom intensity. More...
 
float getBloomIntensity ()
 Bloom intensity multiplier. More...
 
float getBloomSize ()
 Bloom size as percentage of screen width. More...
 
float getBloomStrength ()
 Bloom strength as multiplier of intensity beyond bloom intensity. More...
 
Camera getCamera ()
 Camera to modify. More...
 
bool getEnableAuralization ()
 Enable auralization if supported. More...
 
bool getEnableGI ()
 Enable global illumination (GI) if supported. More...
 
bool getEnableHDRR ()
 Enable high definition range rendering (HDRR) if supported. More...
 
float getExposure ()
 Exposure. More...
 
float getFov ()
 Field of view. More...
 
float getFovRatio ()
 Field of view ratio (height / width). More...
 
float getHighestIntensity ()
 Highest intensity. More...
 
float getImageDistance ()
 Camera image distance. More...
 
LayerMask getLayerMask ()
 Layer mask. More...
 
float getLowestIntensity ()
 Lowest intensity. More...
 
Microphone getMicrophone ()
 Microphone to modify. More...
 
CurveBezier getToneMapCurve ()
 Custom tone mapping curve or empty curve to disable. More...
 
float getViewDistance ()
 Camera view distance. More...
 
float getWhiteIntensity ()
 White intensity multiplier. More...
 
void initCameraParameters ()
 Init camera parameters. More...
 
void initMicrophoneParameters ()
 Init microphone parameters. More...
 
void resetCameraAdaptedIntensity ()
 Request graphic module to reset camera adapted intensity to optimal value. More...
 
void setAdaptionTime (float time)
 Set adaption time. More...
 
void setBloomBlend (float blend)
 Set bloom blend as multiplier of intensity beyond bloom intensity. More...
 
void setBloomIntensity (float intensity)
 Set bloom intensity multiplier. More...
 
void setBloomSize (float size)
 Bloom size as percentage of screen width. More...
 
void setBloomStrength (float strength)
 Set bloom strength as multiplier of intensity beyond bloom intensity. More...
 
void setCamera (Camera camera)
 Set camera to modify. More...
 
void setEnableAuralization (bool enable)
 Set to enable auralization if supported. More...
 
void setEnableGI (bool enable)
 Set to enable global illumination (GI) if supported. More...
 
void setEnableHDRR (bool enable)
 Set to enable high definition range rendering (HDRR) if supported. More...
 
void setExposure (float exposure)
 Set exposure. More...
 
void setFov (float fov)
 Set field of view. More...
 
void setFovRatio (float ratio)
 Set field of view ratio (height / width). More...
 
void setHighestIntensity (float intensity)
 Set highest intensity. More...
 
void setImageDistance (float distance)
 Set camera image distance. More...
 
void setLayerMask (LayerMask layerMask)
 Set layer mask. More...
 
void setLowestIntensity (float intensity)
 Set lowest intensity. More...
 
void setMicrophone (Microphone microphone)
 Set microphone to modify. More...
 
void setToneMapCurve (CurveBezier curve)
 Set custom tone mapping curve or empty curve to disable. More...
 
void setViewDistance (float distance)
 Set camera view distance. More...
 
void setWhiteIntensity (float intensity)
 Set white intensity multiplier. More...
 
void update (float elapsed)
 Update director. More...
 

Protected Member Functions

void actorChanged ()
 Player controlled actor changed. More...
 
void initBehaviors (BehaviorElement element)
 Init behaviors. More...
 

Protected Attributes

ECBehaviorColliderAI.Instance colliderAI
 Collider AI or null if absent. More...
 
ECBehaviorLocomotion.Instance locomotion
 Locomotion or null if absent. More...
 

Additional Inherited Members

- Public Attributes inherited from Dragengine.CameraDirectors.ElementCameraDirector
float pAzimuth
 
float pDistance
 
Element pElement
 
float pElevation
 
DMatrix pLocalMatrix
 
DVector pPivot
 
bool pUseOrientation
 
- Public Attributes inherited from Dragengine.CameraDirectors.CameraDirector
final float fovFirstPerson = 90
 Typical first person FOV. More...
 
final float fovLongTele = 6.87
 Long tele camera FOV. More...
 
final float fovMediumTele = 10.29
 Medium tele camera FOV. More...
 
final float fovNormal = 39.6
 Normal camera FOV. More...
 
final float fovShortFirstPerson = 75
 Shorter first person FOV. More...
 
final float fovShortTele = 22.62
 Short tele camera FOV. More...
 
final float fovUltraWide = 83.97
 Ultra wide camera FOV. More...
 
final float fovWide = 65.47
 Wide camera FOV. More...
 
float pAdaptionTime
 
float pBloomBlend
 
float pBloomIntensity
 
float pBloomSize
 
float pBloomStrength
 
Camera pCamera
 
bool pEnableAuralization
 
bool pEnableGI
 
bool pEnableHDRR
 
float pExposure
 
float pFov
 
float pFovRatio
 
float pHighestIntensity
 
float pImageDistance
 
LayerMask pLayerMask
 
float pLowestIntensity
 
Microphone pMicrophone
 
CurveBezier pToneMapCurve
 
float pViewDistance
 
float pWhiteIntensity
 

Detailed Description

Place camera relative player controlled actor with orbit support.

Extends ElementCameraDirector with support to set the tracked element from the player controlled actor set in BaseGameApp at every update call. Using this class the game can switch player control from one actor to another without needing to update the camera directory unless different actors require different parameters.

For convenience the actorChanged() hook method is called whenever the actor switched.

The pivot point is set at the center of the actor head. For best results this should be straight above the actor position. The setPivotAboveGround() takes care of The actor locomotion is used to obtain the actor looking direction. The camera director azimuth and elevation are set to match the looking direction. The distance is not changed and can be set by users of the class to place the camera behind the actor for example for 3rd person views.

Version 1.8

Updating azimuth and elevation from locomotion can be optionally disabled. This is useful for third person cameras with locked elevation or azimuth.

Member Function Documentation

◆ actorChanged()

void Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.actorChanged ( )
protected

Player controlled actor changed.

Called after the new actor has been assigned to the camera directory. Hook method for subclass to apply additional logic for actor switching.

Reimplemented in Dragengine.CameraDirectors.VRPlayerControlledActorCameraDirector.

◆ getActor()

ECBehaviorPlayerControllable.Instance Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.getActor ( )

Actor or null.

◆ getColliderAI()

ECBehaviorColliderAI.Instance Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.getColliderAI ( )

Collider AI or null if absent.

◆ getLockAzimuth()

bool Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.getLockAzimuth ( )

Do not update azimuth from locomotion changes.

Version
1.8

◆ getLockElevation()

bool Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.getLockElevation ( )

Do not update elevation from locomotion changes.

Version
1.8

◆ getLocomotion()

ECBehaviorLocomotion.Instance Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.getLocomotion ( )

Locomotion or null if absent.

◆ getTracker()

ECBehaviorPlayerControllable.Tracker Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.getTracker ( )

Tracker or null.

◆ initBehaviors()

void Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.initBehaviors ( BehaviorElement  element)
protected

Init behaviors.

◆ new() [1/3]

PlayerControlledActorCameraDirector Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.new ( )

Create camera director.

Pivot point is set to 1.6m above ground.

Reimplemented from Dragengine.CameraDirectors.CameraDirector.

Reimplemented in Dragengine.CameraDirectors.VRPlayerControlledActorCameraDirector.

◆ new() [2/3]

PlayerControlledActorCameraDirector Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.new ( Camera  camera,
Microphone  microphone 
)

Create camera director.

Pivot point is set to 1.6m above ground.

Reimplemented from Dragengine.CameraDirectors.CameraDirector.

Reimplemented in Dragengine.CameraDirectors.VRPlayerControlledActorCameraDirector.

◆ new() [3/3]

PlayerControlledActorCameraDirector Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.new ( Camera  camera,
Microphone  microphone,
ECBehaviorPlayerControllable.Tracker  tracker 
)

Create camera director.

Pivot point is set to 1.6m above ground.

Reimplemented in Dragengine.CameraDirectors.VRPlayerControlledActorCameraDirector.

◆ setActor()

void Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.setActor ( ECBehaviorPlayerControllable.Instance  actor)

Set actor or null.

◆ setLockAzimuth()

void Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.setLockAzimuth ( bool  lock)

Set to not update azimuth from locomotion changes.

Version
1.8

◆ setLockElevation()

void Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.setLockElevation ( bool  lock)

Set to not update elevation from locomotion changes.

Version
1.8

◆ setPivotAboveGround()

void Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.setPivotAboveGround ( float  distance)

Set pivot point at desired distance above ground.

Typical value for distance is 1.6 for a adult human actor.

◆ setTracker()

void Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.setTracker ( ECBehaviorPlayerControllable.Tracker  tracker)

Set tracker or null.

◆ updateCamera()

void Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.updateCamera ( float  elapsed)

Update camera.

Set camera director azimuth and elevation to match actor locomotion. Azimuth is set to locomotion.getOrientation() plus locomotion.getLookHorizontal(). Elevation is set to locomotion.getLookVertical(). This equals to actor orientation around his up-axis combined with actor looking around.

If no actor is present azimuth and elevation are set to 0.

Reimplemented from Dragengine.CameraDirectors.ElementCameraDirector.

Reimplemented in Dragengine.CameraDirectors.VRPlayerControlledActorCameraDirector.

◆ updateMicrophone()

void Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.updateMicrophone ( float  elapsed)

Update microphone.

Extends the base functionality setting velocity to match actor velocity.

Reimplemented from Dragengine.CameraDirectors.CameraDirector.

Member Data Documentation

◆ colliderAI

ECBehaviorColliderAI.Instance Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.colliderAI
protected

Collider AI or null if absent.

◆ locomotion

ECBehaviorLocomotion.Instance Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.locomotion
protected

Locomotion or null if absent.


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