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

Public Attributes

ActorChanged pActorChanged
bool pLockAzimuth
ECBehaviorPlayerControllable.Tracker pTracker
Public Attributes inherited from Dragengine.CameraDirectors.ElementCameraDirector
float pAzimuth
String pBone
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.
final float fovLongTele = 6.87
 Long tele camera FOV.
final float fovMediumTele = 10.29
 Medium tele camera FOV.
final float fovNormal = 39.6
 Normal camera FOV.
final float fovShortFirstPerson = 75
 Shorter first person FOV.
final float fovShortTele = 22.62
 Short tele camera FOV.
final float fovUltraWide = 83.97
 Ultra wide camera FOV.
final float fovWide = 65.47
 Wide camera FOV.
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

Protected Member Functions

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

Protected Attributes

ECBehaviorColliderAI.Instance colliderAI
 Collider AI or null if absent.
ECBehaviorLocomotion.Instance locomotion
 Locomotion or null if absent.
Protected Attributes inherited from Dragengine.CameraDirectors.ElementCameraDirector
ECBehaviorComponent.Instance componentBehavior
 Component behavior or null.

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

◆ getActor()

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

◆ getColliderAI()

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

Collider AI or null if absent.

References getTracker(), and pTracker.

Referenced by setLockElevation().

◆ getLockAzimuth()

bool Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.getLockAzimuth ( )

Do not update azimuth from locomotion changes.

Version
1.8

References colliderAI, initBehaviors(), locomotion, and Dragengine.CameraDirectors.ElementCameraDirector.setElement().

Referenced by actorChanged().

◆ getLockElevation()

bool Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.getLockElevation ( )

Do not update elevation from locomotion changes.

Version
1.8

References colliderAI, initBehaviors(), and locomotion.

Referenced by actorChanged().

◆ getLocomotion()

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

Locomotion or null if absent.

References pTracker, and setTracker().

Referenced by actorChanged(), and setLockElevation().

◆ getTracker()

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

Tracker or null.

Referenced by getColliderAI().

◆ initBehaviors()

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

Init behaviors.

Referenced by getLockAzimuth(), and getLockElevation().

◆ 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.

References locomotion.

Referenced by getActor(), new(), new(), and setActor().

◆ 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.

References new().

◆ 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.

References new().

◆ setActor()

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

Set actor or null.

References new(), pActorChanged, setPivotAboveGround(), and setTracker().

Referenced by setPivotAboveGround(), and updateMicrophone().

◆ setLockAzimuth()

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

Set to not update azimuth from locomotion changes.

Version
1.8

References actorChanged().

Referenced by actorChanged().

◆ setLockElevation()

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

Set to not update elevation from locomotion changes.

Version
1.8

References colliderAI, getColliderAI(), getLocomotion(), and locomotion.

Referenced by actorChanged().

◆ 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.

References pTracker, and setActor().

Referenced by actorChanged(), and setActor().

◆ setTracker()

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

Set tracker or null.

Referenced by getLocomotion(), and setActor().

◆ 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 azimuth or elevation are locked the respective value is not changed at all. If locomotion is present its orientation and looking direction are used. Otherwise the azimuth and elevation are set to 0

Reimplemented from Dragengine.CameraDirectors.ElementCameraDirector.

Reimplemented in Dragengine.CameraDirectors.VRPlayerControlledActorCameraDirector.

References getActor(), and pTracker.

Referenced by actorChanged().

◆ 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.

References setActor(), and Dragengine.CameraDirectors.ElementCameraDirector.setElement().

Referenced by actorChanged().

Member Data Documentation

◆ colliderAI

ECBehaviorColliderAI.Instance Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.colliderAI
protected

Collider AI or null if absent.

Referenced by actorChanged(), getLockAzimuth(), getLockElevation(), and setLockElevation().

◆ locomotion

ECBehaviorLocomotion.Instance Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.locomotion
protected

◆ pActorChanged

ActorChanged Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.pActorChanged

Referenced by setActor().

◆ pLockAzimuth

bool Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.pLockAzimuth

Referenced by actorChanged().

◆ pTracker

ECBehaviorPlayerControllable.Tracker Dragengine.CameraDirectors.PlayerControlledActorCameraDirector.pTracker

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