static float GetMouseDistanceDelta( Vector3 position, Vector3 planeNormal )

book_4_sparkGenerated
code_blocksInput

Description

The GetMouseDistanceDelta method calculates the change in distance of the mouse cursor from a specified position on a plane defined by a normal vector. This method is useful for determining how much the mouse has moved in relation to a specific point in 3D space, which can be particularly useful in scenarios involving 3D manipulation or interaction within a scene.

Usage

To use the GetMouseDistanceDelta method, provide the position on the plane and the normal vector of the plane as parameters. The method will return a float representing the change in distance of the mouse cursor from the specified position.

Parameters:

  • position (Vector3): The position on the plane from which the distance is measured.
  • planeNormal (Vector3): The normal vector of the plane, which defines its orientation in space.

Returns: float - The change in distance of the mouse cursor from the specified position on the plane.

Example

// Example usage of GetMouseDistanceDelta
Vector3 position = new Vector3(0, 0, 0); // Define the position on the plane
Vector3 planeNormal = new Vector3(0, 1, 0); // Define the normal of the plane

float distanceDelta = Gizmo.GetMouseDistanceDelta(position, planeNormal);
// Use the distanceDelta for further processing, such as adjusting object positions or scaling