A SERVICE OF

logo

csSphereSensor
129
Figure 11-2 Placing csSphereSensor in a Scene Graph
A csSphereSensor is activated when the pointer device is depressed over its associated
geometry. However, its output events, rotation and trackPoint, can be connected to any
eld in a scene graph. The effects of csSphereSensor, therefore, are not limited to its
associated geometry.
Rotating Geometry Using csSphereSensor
To enable csSphereSensor to rotate geometry spherically, you must complete the
following two tasks:
1. Connect a csSphereSensor node to a csTransform node, as follows:
csSphereSensor *sphereSensor = new csSphereSensor;
csTransform *transform = new csTransform;
sphereSensor->connect(csSphereSensor::ROTATION, transform,
csTransform::ROTATION);
Rotation events are generated by csSphereSensor.
2. Add the csSphereSensor node as a child to the parent node of the transformation
node associated with the geometry to rotate, as shown in Figure 11-2.
csShape
csShape
csTransform
csGroup
csSphereSensor