{{tag>dragonscript behavior}} [[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[abstractions#behavior_elementsquick_and_easy_development|Behavior Elements: Quick and Easy Development]] >> **ECBehaviorEnvMapProbe** * [[behaviors_use_cases|Behaviors Explained: By Use-Case]] * [[behaviors_a_to_z|Behaviors Explained: From A to Z]] ====== ECBehaviorEnvMapProbe ====== Behavior element behavior adding environment map probe support. Attaches an EnvMapProbe resource to the behavior element. If the [[behavior_collider|ECBehaviorCollider]] behavior is present in the behavior element the EnvMapProbe is attached to the collider. ====== Instance Counts ====== 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 ====== Element class properties have the prefix ''envMapProbe.'' or ''envMapProbe({id}).'' if id is not empty. ===== influenceArea ===== Set influence shape. Geometry touching this shape is affected by this environment map probe. Has to be box shapes. * Full name: ''envMapProbe.influenceArea'' or ''envMapProbe({id}).influenceArea'' * Type: string (shape format). See "Shape List Encoding" in CodecPropertyString. * Default Value: empty string * Example (*.deeclass) box:position,0,0.5,0:extends,2,1,0.5 ===== influenceBorderSize ===== Set influence border size. Geometry inside this distance from the border is faded out gradually. * Full name: ''envMapProbe.influenceBorderSize'' or ''envMapProbe({id}).influenceBorderSize'' * Type: float * Default Value: 0.1 * Restriction: At least 0 * Example (*.deeclass) 0.2 ===== influencePriority ===== 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. * Full name: ''envMapProbe.influencePriority'' or ''envMapProbe({id}).influencePriority'' * Type: integer * Default Value: 0 * Example (*.deeclass) 10 ===== reflectionShape ===== Set reflection shape. Has to be a single box shape. * Full name: ''envMapProbe.reflectionShape'' or ''envMapProbe({id}).reflectionShape'' * Type: string (shape format). See "Shape List Encoding" in CodecPropertyString. * Default Value: empty string * Example (*.deeclass) box:position,0,0.5,0:extends,2,1,0.5 ===== reflectionMask ===== Set reflection mask. Cuts holes into the environment map. Useful for hallways to avoid exits looking flat. Has to be box shapes. * Full name: ''envMapProbe.reflectionMask'' or ''envMapProbe({id}).reflectionMask'' * Type: string (shape format). See "Shape List Encoding" in CodecPropertyString. * Default Value: empty string * Example (*.deeclass) box:position,0,0.5,0:extends,2,1,0.5 ===== position ===== Set position to attach resource to collider. * Full name: ''envMapProbe.position'' or ''envMapProbe({id}).position'' * Type: 3-component float vector * Default Value: (0,0,0) * Example (*.deeclass) ===== orientation ===== Set orientation to attach resource to collider in degrees. * Full name: ''envMapProbe.orientation'' or ''envMapProbe({id}).orientation'' * Type: 3-component float vector * Default Value: (0,0,0) * Example (*.deeclass) ===== bone ===== Set bone to attach resource to. If empty string attach to collider. * Full name: ''envMapProbe.bone'' or ''envMapProbe({id}).bone'' * Type: string * Default Value: empty string * Example (*.deeclass) attach ====== Events ====== This behavior has no events. ====== Required Behaviors ====== This behavior requires no other behaviors. ====== Optional Behaviors ====== * [[behavior_collider|ECBehaviorCollider]]: Collider to attach resource to. ====== Persistency ====== This behavior does require the element class to be persistable (setPersistable). ====== API Documentation ====== #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorEnvMapProbe.html,ECBehaviorEnvMapProbe~@#. Since DragonScript Module Version ''1.0'' ====== Use Cases ====== * Generate environment map probe from element position. ====== Element Class Example ====== 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 ====== Behavior Factory ====== Using element class supporting adding behaviors the behavior can be added like this: 0 1 4 box:position,0,0.5,0:extends,2,1,0.5 ====== Live Examples ====== * [[https://github.com/LordOfDragons/deexamples|DEExamples Repository]]