User Tools

Site Tools


democap:behavior_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)
    <point name='cameraFeedView.feedSize' x='512' y='320'/>

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)
    <float name='cameraFeedView.viewAngle'>45</float>

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)
    <string name='cameraFeedView.model'>box.demodel</string>

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)
    <string name='cameraFeedView.skin'>box.deskin</string>

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)
    <string name='cameraFeedView.rig'>box.derig</string>

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)
    <string name='cameraFeedView.occlusionMesh'>box.deoccmesh</string>

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)
    <string name='cameraFeedView.audioModel'>box.demodel</string>

renderEnvMap

Set if component is rendered in environment maps.

  • Full name: cameraFeedView.renderEnvMap or cameraFeedView({id}).renderEnvMap
  • Type: boolean
  • Default Value: true
  • Example (*.deeclass)
    <boolean name='cameraFeedView.renderEnvMap'>false</boolean>

affectsAudio

Set if component is affecting audio.

  • Full name: cameraFeedView.affectsAudio or cameraFeedView({id}).affectsAudio
  • Type: boolean
  • Default Value: false
  • Example (*.deeclass)
    <boolean name='cameraFeedView.affectsAudio'>false</boolean>

hintMovement

Set movement hint.

  • Full name: cameraFeedView.hintMovement or cameraFeedView({id}).hintMovement
  • Type: enumeration
  • Allowed Values:

    ValueDescription
    stationaryComponent remains static for the entire lifetime.
    jitteringComponent remains mostly static jittering in a small area.
    dynamicComponent moves around freely.
  • Default Value: dynamic
  • Example (*.deeclass)
    <string name='cameraFeedView.hintMovement'>dynamic</string>

enableGI

Set enable GI in graphic module if supported.

  • Full name: cameraFeedView.enableGI or cameraFeedView({id}).enableGI
  • Type: boolean
  • Default Value: false
  • Example (*.deeclass)
    <boolean name='cameraFeedView.enableGI'>false</boolean>

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)
    <integer name='cameraFeedView.hintGIImportance'>3</integer>

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)

    <map name='component.textureReplacements'>
      <!-- define texture replacement with unique identifier 'material' -->
      <map key='material'>
        <!-- optional: path to skin to replace texture with -->
        <string key='skin'>different_material.deskin</string>
     
        <!-- optional: apply tinting to material. requires color type renderable named 'tint' -->
        <color key='tint' r='0.5' g='0.8' b='1'/>
     
        <!-- optional: transform texture coordinates -->
        <map key='transform'>
          <!-- optional: texture coordinate scaling with center of texture as origin -->
          <vector2 key='scale' x='2' y='2'/>
     
          <!-- optional: texture coordinate rotation with center of texture as pivot point -->
          <float key='rotate'>90</float>
     
          <!-- optional: texture coordinate translation -->
          <vector2 key='translate' x='0.5' y='0'/>
        </map>
      </map>
    </map>

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

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):

<?xml version='1.0' encoding='UTF-8'?>
<elementClass name='MyClass' class='GenericBehaviorElement'>
  <behavior type='ECBehaviorCollider'/>
  <behavior type='ECBehaviorCamera'>
    <string name='.pathParameters'>/content/camera/videocamera.decamera</string>
  </behavior>
 
  <behavior type='ECBCameraFeedView'>
    <!-- optional: use camera with id instead of empty string -->
    <string name='camera'>second</string>
 
    <!-- set element properties. omit property prefix if used inside behavior tag -->
    <string name='.model'>cameraFinder.demodel</string>
  </behavior>
</elementClass>

Live Examples

You could leave a comment if you were logged in.
democap/behavior_ecbcamerafeedview.txt · Last modified: 2025/03/22 17:25 by dragonlord