29 #ifndef __CYLINDERSENSOR_H__
30 #define __CYLINDERSENSOR_H__
151 virtual void setValue(
const H3DFloat &b,
int _id = 0 ) {
154 Console(LogLevel::Warning) <<
"Warning: The value of field " << getName()
155 <<
" in CylinderSensor node( "
157 <<
" ) is outside valid range [-2pi, 2pi]."
158 <<
" Value set to -2pi" << endl;
160 else if( b > limit ) {
162 Console(LogLevel::Warning) <<
"Warning: The value of field " << getName()
163 <<
" in CylinderSensor node( "
165 <<
" ) is outside valid range [-2pi, 2pi]."
166 <<
" Value set to 2pi" << endl;
174 if( value < -limit ) {
176 Console(LogLevel::Warning) <<
"Warning: The value of field " << getName()
177 <<
" in CylinderSensor node( "
179 <<
" ) is outside valid range [-2pi, 2pi]."
180 <<
" Value set to -2pi" << endl;
182 else if( value > limit ) {
184 Console(LogLevel::Warning) <<
"Warning: The value of field " << getName()
185 <<
" in CylinderSensor node( "
187 <<
" ) is outside valid range [-2pi, 2pi]."
188 <<
" Value set to 2pi" << endl;
195 friend class CheckAngleLimits;
200 Inst< SFString > _description = 0,
201 Inst< SFFloat > _diskAngle = 0,
202 Inst< SFBool > _enabled = 0,
203 Inst< CheckAngleLimits > _maxAngle = 0,
204 Inst< SFNode > _metadata = 0,
205 Inst< CheckAngleLimits > _minAngle = 0,
206 Inst< SFFloat > _offset = 0,
207 Inst< SFBool > _isActive = 0,
208 Inst< SFBool > _isOver = 0,
209 Inst< SFRotation > _rotation_changed = 0,
210 Inst< SFVec3f > _trackPoint_changed = 0,
211 Inst< SFRotation > _axisRotation = 0 );
287 virtual void setDragOutputEvents(
bool _enabled,
294 Matrix4f *global_to_local = 0 );
298 Vec3f geometry_intersection;
301 Matrix4f geometry_global_to_local;
305 int intersectSegmentCylinder( Vec3f sa, Vec3f sb,
float &t );
310 int intersectLinePlane( Vec3f a, Vec3f b,
float &t, Vec3f &q );
314 Vec3f last_intersection;
331 Matrix4f geometry_global_to_local_original;
334 bool new_cylinder, use_caps, prev_new_cylinder;
Contains the SFFloat field class.
Contains the SFRotation field class.
Header file for X3DDragSensorNode, X3D scene-graph node.
The CheckAngleLimits field checks that the float is in the correct range.
Definition: CylinderSensor.h:147
virtual void update()
Make the field up to date given that an event has occured.
Definition: CylinderSensor.h:172
The CylinderSensor node maps pointer motion (e.g., a mouse or wand) into a rotation on an invisible c...
Definition: CylinderSensor.h:140
H3DUniquePtr< SFRotation > axisRotation
The local sensor coordinate system is created by applying the axisRotation field value to the local c...
Definition: CylinderSensor.h:274
H3DUniquePtr< SFFloat > offset
When the pointing device is deactivated and autoOffset is TRUE, offset is set to the last rotation an...
Definition: CylinderSensor.h:255
H3DUniquePtr< CheckAngleLimits > maxAngle
Used to clamp rotation values.
Definition: CylinderSensor.h:234
H3DUniquePtr< CheckAngleLimits > minAngle
Used to clamp rotation values.
Definition: CylinderSensor.h:245
H3DUniquePtr< SFRotation > rotation_changed
For each position of the bearing when isActive is true, a rotation_changed event is sent which corres...
Definition: CylinderSensor.h:265
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: CylinderSensor.h:277
H3DUniquePtr< SFFloat > diskAngle
Used when determining whether the sides of the invisible cylinder or the caps (disks) are used for ma...
Definition: CylinderSensor.h:223
The SFFloat field contains one single-precision floating point number.
Definition: SFFloat.h:41
virtual void setValue(const H3DFloat &v, int id=0)
Set the value of the field.
Definition: SField.h:215
virtual void update()
Make the field up to date given that an event has occured.
Definition: SField.h:181
This abstract node type is the base type for all drag-style pointing device sensors.
Definition: X3DDragSensorNode.h:42
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194
Used as input to intersection functions.
Definition: Node.h:114