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

Behavior element behavior adding camera support. More...

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

Classes

class  Factory
 Behavior factory. More...
 

Additional Inherited Members

- Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
void assignInstanceIndex (int instanceIndex)
 Assign instance index.
 
void dispose ()
 Dispose of behavior.
 
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.
 
- 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 camera support.

Behavior adds a Camera resource to the the behavior element. This behavior can be added multiple times to an element. Each instance creates one camera attached to the element collider which can be individually modified. To distinguish the cameras each instance has an identifier which can be used to retrieve a specific instance. Hence to use more than one camera use code like this in your subclass constructor:

class MyElement extends BehaviorElementClass
func new()
ECBehaviorCamera.new(this)
ECBehaviorCamera.new(this, "subCamera")
end
end
Behavior element element class.
Definition BehaviorElementClass.ds:54
Behavior element behavior adding camera support.
Definition ECBehaviorCamera.ds:76

You can now define the parameters to use for both cameras using for example the properties "camera.fov" for the first camera and "camera(subCamera).fov" for the second camera.

It is recommended to always specify an identifier even if only one camera is used. This avoids potentially name conflicts especially if other behaviors are added attaching other resources too.

If the ECBehaviorCollider behavior is present in the behavior element before this behavior is added the camera is attached. The camera is attached to the named bone if defined otherwise it is attached statically.

Element class properties have the prefix "camera{(id)}.".

This behavior does require the element class to be persistable (setPersistable).

Effects

Cameras can be equipped with effects modifying the rendering. Effects can be added to ECBehaviorCamera by adding after the camera behavior one or more camera effect behaviors.

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

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