Difference between revisions of "API Mouse.GetPosition"
(XML import) |
(XML import) |
||
(9 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | <sidebar>API | + | <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 | | + | ====Class hierarchy==== |
− | :[[API Mouse| | + | [[API Mouse|Mouse]] |
− | + | :[[API Mouse|GetPosition]] | |
</div> | </div> | ||
__TOC__ | __TOC__ | ||
Line 11: | Line 11: | ||
==Parameters== | ==Parameters== | ||
''This function has no parameters'' | ''This function has no parameters'' | ||
+ | |||
==Return value== | ==Return value== | ||
− | [[Variable | + | [[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== | ||
− | '' | + | 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 24: | 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
Contents
Parameters
This function has no parameters
Return value
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.
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