{{tag>motioncapture democap behavior}}
[[:start|Start Page]] >> [[main|DEMoCap: Drag[en]gine Motion Capture]] >> [[democap:elementclasses|XML Element Classes]] >> ** ECBCameraFeedView **
====== ECBCameraFeedView ======
Behavior adding support to display a camera feed view.
Feed view adds a component resource attached to a bone in the owner collider. The component is oriented to face along the Z axis pointing towards the user. The view can be enabled independent of the owner element. If the owner element is hidden during capturing the feed view stays visible. The size of the view adjusts with the distance to the viewer to make the view always cover an equal amount of screen space. The feed view is oriented to always face the user similar to a decal.
====== Instance Counts ======
This behavior can be used only once on an element.
====== Element Class Properties ======
Element class properties have the prefix ''cameraFeedView.''.
===== feedSize =====
Size in pixels of the image produced by the camera feed.
* Full name: ''cameraFeedView.feedSize''
* Type: 2-component integer vector
* Default Value: ''(512, 320)'' (16:10 ratio)
* Example (*.deeclass)
===== viewAngle =====
View angle in degrees of the camera feed.
* Full name: ''cameraFeedView.viewAngle''
* Type: float
* Default Value: ''45''
* Restriction: At least ''10'' and at most ''110''
* Example (*.deeclass) 45
===== model =====
Set path of model resource to use.
* Full name: ''cameraFeedView.model'' or ''cameraFeedView({id}).model''
* Type: string
* Default Value: ''/content/models/videocamera/camerafeedview.demodel''
* Expected File Type: ''*.demodel''
* Example (*.deeclass) box.demodel
===== skin =====
Set path of skin resource to use.
* Full name: ''cameraFeedView.skin'' or ''cameraFeedView({id}).skin''
* Type: string
* Default Value: ''/content/models/videocamera/camerafeedview.deskin''
* Expected File Type: ''*.deskin''
* Example (*.deeclass) box.deskin
===== rig =====
Set path of rig resource to use.
* Full name: ''cameraFeedView.rig'' or ''cameraFeedView({id}).rig''
* Type: string
* Default Value: empty string
* Expected File Type: ''*.derig''
* Example (*.deeclass) box.derig
===== occlusionMesh =====
Set path of occlusion mesh resource to use.
* Full name: ''cameraFeedView.occlusionMesh'' or ''cameraFeedView({id}).occlusionMesh''
* Type: string
* Default Value: empty string
* Expected File Type: ''*.deoccmesh''
* Example (*.deeclass) box.deoccmesh
===== audioModel =====
Set path of audio model resource to use.
* Full name: ''cameraFeedView.audioModel'' or ''cameraFeedView({id}).audioModel''
* Type: string
* Default Value: empty string
* Expected File Type: ''*.demodel''
* Example (*.deeclass) box.demodel
===== renderEnvMap =====
Set if component is rendered in environment maps.
* Full name: ''cameraFeedView.renderEnvMap'' or ''cameraFeedView({id}).renderEnvMap''
* Type: boolean
* Default Value: ''true''
* Example (*.deeclass) false
===== affectsAudio =====
Set if component is affecting audio.
* Full name: ''cameraFeedView.affectsAudio'' or ''cameraFeedView({id}).affectsAudio''
* Type: boolean
* Default Value: ''false''
* Example (*.deeclass) false
===== hintMovement =====
Set movement hint.
* Full name: ''cameraFeedView.hintMovement'' or ''cameraFeedView({id}).hintMovement''
* Type: enumeration
* Allowed Values:
^Value^Description^
|''stationary''|Component remains static for the entire lifetime.|
|''jittering''|Component remains mostly static jittering in a small area.|
|''dynamic''|Component moves around freely.|
* Default Value: ''dynamic''
* Example (*.deeclass) dynamic
===== enableGI =====
Set enable GI in graphic module if supported.
* Full name: ''cameraFeedView.enableGI'' or ''cameraFeedView({id}).enableGI''
* Type: boolean
* Default Value: ''false''
* Example (*.deeclass) false
===== hintGIImportance =====
Set GI important hint. Value is in the range from ''0'' (very unimportant) to ''4'' (very important). This hint can be used by the graphic module to improve performance by excluding components with a GI important below a user chosen threashold.
* Full name: ''cameraFeedView.hintGIImportance'' or ''cameraFeedView({id}).hintGIImportance''
* Type: integer
* Default Value: ''4''
* Restriction: At least ''0'' and at most ''4''
* Example (*.deeclass) 3
===== textureReplacements =====
Set texture replacements.
* Full name: ''cameraFeedView.textureReplacements'' or ''cameraFeedView({id}).textureReplacements''
* Type: map
* Default Value: ''4''
* Restriction: At least ''0'' and at most ''4''
* Example (*.deeclass)
====== Events ======
This behavior has no events.
====== Conversation Commands ======
This behavior adds no conversation commands.
====== Conversation Conditions ======
This behavior adds no conversation conditions.
====== Behavior Tree Actions ======
This behavior adds no behavior tree actions.
====== Behavior Tree Conditions ======
This behavior adds no behavior tree conditions.
====== Required Behaviors ======
* [[dragengine:modules:dragonscript:behavior_camera|ECBehaviorCamera]]
====== Optional Behaviors ======
This behavior does not support optional behaviors.
====== API Documentation ======
Since DEMoCap Version ''1.3''
====== Use Cases ======
* Show image of camera attached to the front side of the object in a backwards facing "finder" type component.
====== Element Class Example ======
class MyElement extends BehaviorElementClass
public var ECBehaviorCollider collider
public var ECBehaviorCamera camera
public var ECBCameraFeedView feedView
func new()
collider = ECBehaviorCollider.new(this)
camera = ECBehaviorCamera.new(this, collider)
camera.getAttach().getPosition().setVector(Vector.new(0, 0, 0.1))
camera.getViewDistance().setValue(300)
camera.getPathParameters().setValue("/content/camera/videocamera.decamera")
feedView = ECBCameraFeedView.new(this, camera)
end
end
====== Behavior Factory ======
Using element class supporting adding behaviors the behavior can be added like this (again create an example which creates a valid element class):
/content/camera/videocamera.decamera
second
cameraFinder.demodel
====== Live Examples ======