Inheritance diagram for SphereSensor:

Public Member Functions | |
| virtual bool | handleEvent (const Event &event) |
| Callback function that is implemented by the callee. | |
Input is in normalized device coordinates (NDC), or {x,y} = {[0..1],[0..1]}. Output is a 3D point in world space.
Authoring Interface:
SphereSensor {
field SFString type "SHEET"
field SFVec4f sphere 0 0 0 1
eventIn SFVec2f ndcIn
eventIn SFVec2f startPosIn
eventOut SFVec3f worldOut
eventOut SFVec3f rotOut
}
| sphere | 4-vector defining a sphere: first three vector elements is the sphere center, the fourth element is the radius | |||||||
| ndcIn | input mouse movement in Normalized Device Coordinates. You can use a WindowSensor and a ValueSensor in tandem to get NDC. Example: DEF V ValueSensor { valueOfInterest [ "MOUSEX", "MOUSEY" ] }
DEF W WindowSensor {}
function _getMousePos() {
return SFVec2f( V.value[0] / W.size[0], ( W.size[1] - V.value[1] ) / W.size[1]);
}
| |||||||
| startPosIn | send an NDC to this eventIn when you want to reset the SphereSensor to start at a particular point. Typically this is done at mouse-down: Example: DEF MyShape Shape {
...
pickEvent DO {
if ( self.pickEvent == "OVERBUTTONDOWN" ) then
MySphereSensor.startPosIn = self:_getMousePos();
end
}
}
| |||||||
| worldOut | 3D point projection of ndcIn | |||||||
| rotOut | Rotation vector relative to the projected point startPosIn suitable for sending to the rotation field of a node Example: DEF MySphereSensor SphereSensor {
sphere 0 0 0 1
rotOut DO {
MyShape.rotation = self.rotOut;
}
}
| |||||||
| type | type of sphere projection to use. One of:
|
|
|
Callback function that is implemented by the callee.
Implements EventHandler. |
1.4.3