API Mouse.GetPosition

From Flowcode Help
Jump to navigationJump to search

<sidebar>API Contents</sidebar> Gets the position of the mouse, intersecting with a component or the viewing plane

Class hierarchy

Mouse

GetPosition

Parameters

This function has no parameters


Return value

HANDLE

Returns the position of the mouse, intersecting with a component or the viewing plane


Detailed description

This returns a position object, with the Z axis being a ray from the eye plane (intersecting the mouse) into the screen, and the coordinates being the intersection point of a component under the mouse. If no component under the mouse the ray intersection is the cameras target plane.

Error creating thumbnail: sh: convert: command not found
The mouse projection

To calculate the mouse position a ray is projected into the screen. The first (i.e. nearest) solid object intersected by the mouse is considered to be the object under the mouse.

If the ray intersects the back plane before any other object, the distance along the ray from the eye is the same as the distance from the eye to the target.


Examples

Calling in a calculation

  • Declare a variable 'result' of type HANDLE
  • Add to a calculation icon:
    result = ::Mouse.GetPosition()

No additional examples