Start Page » DragonScript Scripting Language » Behavior Elements: Quick and Easy Development » ECBehaviorEnvMapProbe
Behavior element behavior adding environment map probe support.
Attaches an EnvMapProbe resource to the behavior element.
If the ECBehaviorCollider behavior is present in the behavior element the EnvMapProbe is attached to the collider.
This behavior can be used multiple times on an element to add multiple environment map probes to mainpulate. Use the behavior identifier to tell them apart.
Element class properties have the prefix envMapProbe.
or envMapProbe({id}).
if id is not empty.
Set influence shape. Geometry touching this shape is affected by this environment map probe. Has to be box shapes.
envMapProbe.influenceArea
or envMapProbe({id}).influenceArea
<string name='envMapProbe.influenceArea'>box:position,0,0.5,0:extends,2,1,0.5</string>
Set influence border size. Geometry inside this distance from the border is faded out gradually.
envMapProbe.influenceBorderSize
or envMapProbe({id}).influenceBorderSize
<float name='envMapProbe.influenceBorderSize'>0.2</float>
Set influence priority. If multiple environment maps overlap the same geometry the influence priority decided which probe affects the geometry. Higher values win over lower values.
envMapProbe.influencePriority
or envMapProbe({id}).influencePriority
<float name='envMapProbe.influencePriority'>10</float>
Set reflection shape. Has to be a single box shape.
envMapProbe.reflectionShape
or envMapProbe({id}).reflectionShape
<string name='envMapProbe.reflectionShape'>box:position,0,0.5,0:extends,2,1,0.5</string>
Set reflection mask. Cuts holes into the environment map. Useful for hallways to avoid exits looking flat. Has to be box shapes.
envMapProbe.reflectionMask
or envMapProbe({id}).reflectionMask
<string name='envMapProbe.reflectionMask'>box:position,0,0.5,0:extends,2,1,0.5</string>
Set position to attach resource to collider.
envMapProbe.position
or envMapProbe({id}).position
<vector name='envMapProbe.position' x='0' y='0' z='0.1'/>
Set orientation to attach resource to collider in degrees.
envMapProbe.orientation
or envMapProbe({id}).orientation
<vector name='envMapProbe.orientation' x='30' y='0' z='0'/>
Set bone to attach resource to. If empty string attach to collider.
envMapProbe.bone
or envMapProbe({id}).bone
<string name='envMapProbe.bone'>attach</string>
This behavior has no events.
This behavior requires no other behaviors.
This behavior does require the element class to be persistable (setPersistable).
Since DragonScript Module Version 1.0
This example defines an element which contains an environment map probe.
class MyElement extends BehaviorElementClass public var ECBehaviorCollider collider public var ECBehaviorEnvMapProbe envMapProbe func new() collider = ECBehaviorCollider.new(this, null) envMapProbe = ECBehaviorEnvMapProbe.new(this, collider) envMapProbe.getEnvMapProbe().getInfluencePriority().setValue(10) envMapProbe.getAttach().getPosition().setVector(Vector.new(0, 1.5, 0)) end end
Using element class supporting adding behaviors the behavior can be added like this:
<?xml version='1.0' encoding='UTF-8'?> <elementClass name='MyClass' class='GenericBehaviorElement'> <behavior type='ECBehaviorCollider'/> <behavior type='ECBehaviorEnvMapProbe'> <!-- optional: set layer mask. default value is '1' which means BaseGameApp.WorldLayerBit.envmap . list contains bits to set separated by whitespaces. --> <string name='layerMask'>0 1 4</string> <!-- set element properties. omit property prefix if used inside behavior tag --> <string name='.reflectionShape'>box:position,0,0.5,0:extends,2,1,0.5</string> </behavior> <!-- for adding multiple behaviors use unique identifiers --> <behavior type='ECBehaviorEnvMapProbe' id='second'/> </elementClass>