instantreality 1.0

Component:
Snapping
Status:
partly implemented
Structure type:
concrete
Standard:
Avalon

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
SFMatrix4f matrix SFMatrix4f inputOutput identity the matrix to be observed and "snapped" on trigger. Think of it as a "through" connection.
SFVec3f translation SFVec3f inputOutput 0 0 0 translation part of matrix
SFRotation rotation SFRotation inputOutput 0 0 1 0 rotation part of matrix
MFString idList MFString initializeOnly default id's of SnapIns that we can snap to. Nothing listet here means snap to every SnapIn.
SFFloat sensingRadius SFFloat initializeOnly 10 [-1, inf) below 0 is infinite
SFMatrix4f matrixOffset_changed SFMatrix4f outputOnly corrected offset matrix. reroute to the sensor, that delivers the matrices to that snap sensor
SFVec3f translationOffset_changed SFVec3f outputOnly translation part of matrixOffset
SFRotation rotationOffset_changed SFRotation outputOnly rotation part of matrixOffset
SFBool set_isActive SFBool inputOnly isActive is defined as EventOut only, so we have to add this one to make the "through" connection possible.
SFBool 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).
SFNode 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")
MFNode 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.
SFMatrix4f locationOffset SFMatrix4f initializeOnly identity offset of the SnapSomething relative to its parent node
SFVec3f locationTranslation SFVec3f initializeOnly 0 0 0 translation of the SnapSomething relative to its parent node
SFRotation locationRotation SFRotation initializeOnly 0 0 0 1 rotation of the SnapSomething relative to its parent node
SFFloat visibleSize SFFloat initializeOnly 1.0 (-inf, inf) the scalation for the indicator nodes
SFNode indicatorNode SFNode initializeOnly Node If two SnapSomethings are matched as compatible the indicatorNode is shown. Default is a green sphere.
SFNode 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.
SFNode standbyNode SFNode initializeOnly Node the standbyNode is selected when neither of indicator/highlight is shown. It defaults to nothing, so that it is invisible.
SFBool highlightActivated SFBool outputOnly Indicates if highlight is activated or not.
SFString 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
SFBool enabled SFBool inputOutput TRUE Enables/disables the sensor node.
SFBool isActive SFBool outputOnly FALSE isActive true/false events are sent when the sensor gets active
SFTime 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.
MFString 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
SFNode metadata SFNode inputOutput MetadataObject container for payload metadata inside MetadataSet element