Vector3 Velocity { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Velocity property of the TrackedObject class in the Sandbox.VR namespace represents the local velocity of the tracked VR object. This property provides the speed and direction at which the object is moving in its local space, expressed as a Vector3.

Usage

To access the Velocity property, you need to have an instance of the TrackedObject class. You can then get or set the velocity of the object using this property. This is useful for determining how fast the object is moving or for applying a new velocity to the object.

Example

// Example of accessing the Velocity property

// Assume 'trackedObject' is an instance of TrackedObject
TrackedObject trackedObject = new TrackedObject();

// Get the current velocity of the tracked object
Vector3 currentVelocity = trackedObject.Velocity;

// Set a new velocity for the tracked object
trackedObject.Velocity = new Vector3(1.0f, 0.0f, 0.0f); // Moves the object along the x-axis