Difference between revisions of "API Mouse.GetPosition"

From Flowcode Help
Jump to navigationJump to search
(XML import)
(XML import)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<sidebar>API contents</sidebar>
+
<sidebar>API Contents</sidebar>
 
Gets the position of the mouse, intersecting with a component or the viewing plane
 
Gets the position of the mouse, intersecting with a component or the viewing plane
  
 
<div style="width:25%; float:right" class="toc">
 
<div style="width:25%; float:right" class="toc">
===Class hierarchy===[[API Mouse|Mouse]]
+
====Class hierarchy====
 +
[[API Mouse|Mouse]]
 
:[[API Mouse|GetPosition]]
 
:[[API Mouse|GetPosition]]
 
</div>
 
</div>
Line 10: Line 11:
 
==Parameters==
 
==Parameters==
 
''This function has no parameters''
 
''This function has no parameters''
 +
  
 
==Return value==
 
==Return value==
[[Variable types|HANDLE]]
+
[[Variable Types|HANDLE]]
  
 
Returns the position of the mouse, intersecting with a component or the viewing plane
 
Returns the position of the mouse, intersecting with a component or the viewing plane
 +
  
 
==Detailed description==
 
==Detailed description==
''No additional information''
+
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.
 +
 
  
 
==Examples==
 
==Examples==
Line 23: Line 32:
 
* Declare a variable 'result' of type HANDLE
 
* Declare a variable 'result' of type HANDLE
 
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Mouse.GetPosition()</pre>
 
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Mouse.GetPosition()</pre>
 +
 +
''<span style="color:red;">No additional examples</span>''

Latest revision as of 15:57, 16 January 2014

<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