Vector3 Velocity { get; set; }

robot_2Generated
code_blocksInput

Description

The Velocity property of the TrackedObject class provides the local velocity of the VR object. This property is represented as a Vector3, which includes the velocity components along the X, Y, and Z axes. It is useful for determining the speed and direction of the tracked object within the local coordinate space.

Usage

To access the Velocity property, you need to have an instance of the TrackedObject class. You can then read the velocity to understand how fast and in which direction the object is moving locally.

Example

// Assuming 'trackedObject' is an instance of TrackedObject
Vector3 currentVelocity = trackedObject.Velocity;

// Output the velocity components
float velocityX = currentVelocity.x;
float velocityY = currentVelocity.y;
float velocityZ = currentVelocity.z;

// Use the velocity for further calculations or logic
if (currentVelocity.Length > 1.0f)
{
    // Perform actions based on the velocity
}