|
Drag[en]gine Script Module DragonScript 1.32.1
|
Behavior element behavior adding camera support. More...
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>". | |
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:
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).
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.