Difference between revisions of "API Mouse.GetPosition"

From Flowcode Help
Jump to navigationJump to search
(XML import of updated API docs)
Line 22: Line 22:
  
 
==Detailed description==
 
==Detailed description==
''<span style="color:red;">No additional information</span>''
+
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.
 +
 
 +
[[File:SIMAPI Mouse.GetPosition Projection.svg|thumb|none|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.
  
  

Revision as of 22:03, 2 August 2013


<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