| Virtual Reality Toolbox™ |  |
vrspacemouse - Create space mouse object
Syntax
mouse = vrspacemouse(id)
Description
mouse = vrspacemouse(id) creates a space
mouse object capable of interfacing
with a space mouse input device. The id parameter
is a string that specifies the space mouse connection: COM1, COM2, COM3, COM4, USB1, USB2, USB3,
or USB4.
The vrspacemouse object has several properties
that influence the behavior of the space mouse input device. The properties
can be read or modified using dot notation (e.g., mouse.DominantMode
= true;).
Properties
Valid properties are (property names are case-sensitive):
| Property | Description |
| PositionSensitivity | Mouse sensitivity for translations. Higher values correspond
to higher sensitivity. |
| RotationSensitivity | Mouse sensitivity for rotations. Higher values correspond to
higher sensitivity. |
| DisableRotation | Fixes the rotations at initial values, allowing you to change
positions only. |
| DisableTranslation | Fixes the positions at the initial values, allowing you to
change rotations only. |
| DominantMode | If this property is true, the mouse accepts only the prevailing
movement and rotation and ignores the others. This mode is very useful
for beginners using a space mouse. |
| UpperPositionLimit | Position coordinates for the upper limit of the mouse. |
| LimitPosition | Enables mouse position
limits. If false, the object ignores the UpperPositionLimit and LowerPositionLimit properties. |
| LowerPositionLimit | Position coordinates for the lower limit of the mouse. |
| NormalizeOutputAngle | Determines whether the integrated rotation angles should wrap
on a full circle (360°). This is not used when you read the Output
Type as Speed. |
| InitialPosition | Initial condition for integrated translations. This is not
used when you set the Output Type to Speed.
|
| InitialRotation | Initial condition for integrated rotations. This is not used
when you set the Output Type to Speed. |
Methods
| Method | Description |
| button | b = button(mouse, n) reads the status of
space mouse button number n. Button status is returned
as logical 0 if not pressed and logical 1 if pressed. n can
be a vector to return multiple buttons. |
| close | close(mouse) closes and invalidates the
space mouse object. The object cannot be used once it is closed. |
| position | p = position(mouse, n) reads the position
of space mouse axis number n. n can
be a vector to return positions of multiple axes. Translations and
rotations are integrated. Outputs are the position and orientation
in the form of roll/pitch/yaw angles. |
| speed | s = speed(mouse, n) reads the speed of space
mouse axis number n. n can be
a vector to return the speeds of multiple axes. No transformations
are done. Outputs are the translation and rotation speeds. |
| viewpoint | p = viewpoint(mouse) reads the space mouse
coordinates in VRML viewpoint format. Translations and rotations are
integrated. Outputs are the position and orientation in the form of
an axis and an angle. You can use these values as viewpoint coordinates
in VRML. |
 | vrsetpref | | vrview |  |