SnapSensor
SnapSensors snap into SnapIns. Think of them as a filter between e.g. a SpaceSensor and the Transformation it controls. The SpaceSensor is routed through the SnapSensor into the target field. If the SnapSensor is close to a compatible SnapIn, it will adjust the incoming transformation to match the SnapIn's constraints. The typical route connections: sender.matrix_changed TO snapSensor.set_matrix snapSensor.matrix_changed TO receiver.set_matrix sender.isActive TO snapSensor.set_isActive snapSensor.matrixOffset_changed TO sender.set_matrixOffset
Inheritance
Code
XML encoding
<SnapSensor matrix='identity' translation='0 0 0' rotation='0 0 1 0' idList='default' sensingRadius='10' locationOffset='identity' locationTranslation='0 0 0' locationRotation='0 0 0 1' visibleSize='1.0' description='' enabled='TRUE' logFeature='' />
Classic encoding
SnapSensor { matrix identity translation 0 0 0 rotation 0 0 1 0 idList ["default"] sensingRadius 10 locationOffset identity locationTranslation 0 0 0 locationRotation 0 0 0 1 visibleSize 1.0 description "" enabled TRUE logFeature [""] }
Interface
Filter: X3D only | Avalon only | All
id | Name | DataType | PartType | Default | ValueType | Description |
---|---|---|---|---|---|---|
matrix | SFMatrix4f | inputOutput | identity | the matrix to be observed and "snapped" on trigger. Think of it as a "through" connection. | ||
translation | SFVec3f | inputOutput | 0 0 0 | translation part of matrix | ||
rotation | SFRotation | inputOutput | 0 0 1 0 | rotation part of matrix | ||
idList | MFString | initializeOnly | default | id's of SnapIns that we can snap to. Nothing listet here means snap to every SnapIn. | ||
sensingRadius | SFFloat | initializeOnly | 10 | [-1, inf) | below 0 is infinite | |
matrixOffset_changed | SFMatrix4f | outputOnly | corrected offset matrix. reroute to the sensor, that delivers the matrices to that snap sensor | |||
translationOffset_changed | SFVec3f | outputOnly | translation part of matrixOffset | |||
rotationOffset_changed | SFRotation | outputOnly | rotation part of matrixOffset | |||
set_isActive | SFBool | inputOnly | isActive is defined as EventOut only, so we have to add this one to make the "through" connection possible. | |||
snapped | SFBool | outputOnly | Triggered, when this node snaps into a SnapIn. Not triggered, when the SnapSensor is moved by a SnapIn it sticks to. (That's the difference to the offset-Fields which fire upon every change of the incoming matrix). | |||
snapTo | SFNode | inputOutput | SnapIn | If a SnapIn is passed to set_snapTo, the SnapSensor will snap into it, disregarding the current distance to that SnapIn. Specifies an initial snapped-in-state. Fired when a snapping occured (together with "snapped") | ||
linkedSnapIns | MFNode | initializeOnly | SnapIn | SnapIns to be ignored. SnapIns beneath the parentNode will be ignored automatically, but not siblings of snapped-to-those-SnapIns SnapSensors. ConstructionKit does this automatically. | ||
locationOffset | SFMatrix4f | initializeOnly | identity | offset of the SnapSomething relative to its parent node | ||
locationTranslation | SFVec3f | initializeOnly | 0 0 0 | translation of the SnapSomething relative to its parent node | ||
locationRotation | SFRotation | initializeOnly | 0 0 0 1 | rotation of the SnapSomething relative to its parent node | ||
visibleSize | SFFloat | initializeOnly | 1.0 | (-inf, inf) | the scalation for the indicator nodes | |
indicatorNode | SFNode | initializeOnly | Node | If two SnapSomethings are matched as compatible the indicatorNode is shown. Default is a green sphere. | ||
highlightNode | SFNode | initializeOnly | Node | If two SnapSomethings are matched as compatible AND are close enough to "snap", the highlightNode is shown. Default is a red sphere. | ||
standbyNode | SFNode | initializeOnly | Node | the standbyNode is selected when neither of indicator/highlight is shown. It defaults to nothing, so that it is invisible. | ||
highlightActivated | SFBool | outputOnly | Indicates if highlight is activated or not. | |||
description | SFString | inputOutput | Text description to comment the sensor task. Can be used in run-time systems to give usefull feedback to the user and developer | |||
enabled | SFBool | inputOutput | TRUE | Enables/disables the sensor node. | ||
isActive | SFBool | outputOnly | FALSE | isActive true/false events are sent when the sensor gets active | ||
triggerSlot | SFTime | inputOnly | slot which is used internally to connect a dynamic context-slot which name is set by the triggerName value. Its used automatically to install run-time environment trigger. | |||
logFeature | MFString | inputOutput | state, child, parent, route, eventIn, eventOut | controls the logging of changes, state: log state changes (e.g. live), child: log child add/remove, parent: log parent add/remove, route: log route add/remove; eventIn: log receiving of events, eventOut: log sending of events: guiView, runtime system should create node-view, guiEdit: runtime system should create node-editeverything: log everything | ||
metadata | SFNode | inputOutput | MetadataObject | container for payload metadata inside MetadataSet element |