Description
The GetMouseDelta
method calculates the change in mouse position on a specified plane. This is useful for determining how much the mouse has moved in a 3D space relative to a given plane, which can be particularly useful in scenarios involving 3D modeling or manipulation of objects in a virtual environment.
Usage
To use the GetMouseDelta
method, provide the position on the plane and the normal vector of the plane. The method will return a Vector3
representing the delta of the mouse movement on that plane.
Parameters:
position
(Vector3
): The position on the plane where the mouse movement is being calculated.
planeNormal
(Vector3
): The normal vector of the plane, which defines the plane's orientation in space.
Returns: A Vector3
representing the change in mouse position on the specified plane.
Example
// Example usage of GetMouseDelta
Vector3 position = new Vector3(0, 0, 0); // Position on the plane
Vector3 planeNormal = new Vector3(0, 1, 0); // Normal vector of the plane
Vector3 mouseDelta = Gizmo.GetMouseDelta(position, planeNormal);
// Use the mouseDelta for further processing, such as moving an object
// in the direction of the mouse movement on the plane.