Main Content

sim3d.io.SpaceMouse

Create space mouse device interface

Since R2025a

    Description

    Use the sim3d.io.SpaceMouse object to create an interface between a space mouse input device and the 3D environment. After you create a sim3d.io.SpaceMouse object, you can modify the aspects of the space mouse input device by setting property values.

    Creation

    Description

    spaceMouse = sim3d.io.SpaceMouse(id) creates a space mouse object capable of interfacing with a space mouse input device. id is the system ID for the space mouse device, specified as one of the listed values.

    • COM1

    • COM2

    • COM3

    • COM4

    • USB1

    • USB2

    • USB3

    • USB4

    Properties

    expand all

    Mouse sensitivity for translations, specified as a real positive scalar. Higher values correspond to higher sensitivity.

    Example: spaceMouse.PositionSensitivity = 2

    Data Types: double

    Mouse sensitivity for rotations, specified as a real positive scalar. Higher values correspond to higher sensitivity.

    Example: spaceMouse.RotationSensitivity = 2

    Data Types: double

    Option to fix the rotation at initial value, allowing you to change translation only, specified as 0 (false) if rotation is enabled or 1 (true) if it is disabled.

    Example: spaceMouse.DisableRotation = 1

    Data Types: logical

    Option to fix the translation at the initial value, allowing you to change rotation only, specified as 0 (false) if translation is enabled or 1 (true) if it is disabled.

    Example: spaceMouse.DisableTranslation = 1

    Data Types: logical

    Option to enable mouse movement, specified as 0 (false) if dominant mode is disabled or 1 (true) if it is enabled. If this property is true, the mouse accepts only the axis movement with larger magnitude and ignores the others. This mode can be helpful for beginners using a space mouse.

    Example: spaceMouse.DominantMode = 1

    Data Types: logical

    Position coordinates for the upper limit of the mouse, specified as a real vector. Use this property to set the maximum translation that can be applied by the space mouse in the 3D environment.

    Example: spaceMouse.UpperPositionLimit = [1500 1500 1500]

    Data Types: double

    Option to enable mouse position limits, specified as 0 (false) if mouse position limits, UpperPositionLimit and LowerPositionLimit are disabled or 1 (true) if they are enabled.

    Example: spaceMouse.LimitPosition = 1

    Data Types: logical

    Position coordinates for the lower limit of the mouse, specified as a real vector. Use this property to set the minimum translation that can be applied by the space mouse in the 3D environment.

    Example: spaceMouse.LowerPositionLimit = [-500 -500 -500]

    Data Types: double

    Option to normalize input rotation angle, specified as 0 (false) if input rotation angle normalization is disabled or 1 (true) if it is enabled. Use this property to determines whether the integrated rotation angles should wrap on a full circle (360°). The software ignores this property when you set Output Type to Speed.

    Example: spaceMouse.NormalizeOutputAngle = 1

    Data Types: logical

    Initial condition for integrated translations, specified as a real positive vector. The software ignores this property when you set Output Type to Speed.

    Example: spaceMouse.InitialPosition = [1 1 1]

    Data Types: double

    Initial condition for integrated rotations, specified as a real positive vector. The software ignores this property when you set Output Type to Speed.

    Example: spaceMouse.InitialRotation = [1 1 1]

    Data Types: double

    Object Functions

    buttonRead status of space mouse
    positionRead position of space mouse
    speedRead speed of space mouse axis number
    viewpointRead space mouse coordinates in viewpoint format

    Version History

    Introduced in R2025a