Difference between revisions of "API Panel.Position.MoveTo"
(XML import) |
(XML import) |
||
(16 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | <sidebar>API | + | <sidebar>API Contents</sidebar> |
Moves the object to the given coordinates relative to its parent | Moves the object to the given coordinates relative to its parent | ||
<div style="width:25%; float:right" class="toc"> | <div style="width:25%; float:right" class="toc"> | ||
− | ===Class hierarchy===[[API | | + | ====Class hierarchy==== |
− | :[[API Panel| | + | [[API Panel|Panel]] |
− | ::[[API Panel.Position| | + | :[[API Panel.Position|Position]] |
− | + | ::[[API Panel.Position|MoveTo]] | |
</div> | </div> | ||
__TOC__ | __TOC__ | ||
==Parameters== | ==Parameters== | ||
− | + | [[Variable Types|HANDLE]] ''Handle'' | |
:The position or component to update | :The position or component to update | ||
:''The default value for this parameter is: '''''this''' | :''The default value for this parameter is: '''''this''' | ||
− | + | [[Variable Types|FLOAT]] ''X'' | |
:Local coordinate X to update with | :Local coordinate X to update with | ||
− | + | [[Variable Types|FLOAT]] ''Y'' | |
:Local coordinate Y to update with | :Local coordinate Y to update with | ||
− | + | [[Variable Types|FLOAT]] ''Z'' | |
:Local coordinate Z to update with | :Local coordinate Z to update with | ||
+ | |||
==Return value== | ==Return value== | ||
''This call does not return a value'' | ''This call does not return a value'' | ||
+ | |||
==Detailed description== | ==Detailed description== | ||
− | + | This moves a position to a set of absolute coordinates in its parents coordinate space. That is, the center of the parent object is considered to be (0, 0, 0). | |
+ | |||
+ | |||
+ | This call is a compliment to [[API Panel.Position.MoveBy|MoveBy]]. | ||
+ | |||
==Examples== | ==Examples== | ||
===Calling in a calculation=== | ===Calling in a calculation=== | ||
* Add to a calculation icon: <pre class="brush:[cpp]">::Panel.Position.MoveTo(handle, x, y, z)</pre> | * Add to a calculation icon: <pre class="brush:[cpp]">::Panel.Position.MoveTo(handle, x, y, z)</pre> | ||
+ | |||
+ | |||
+ | ===Flowcode example file=== | ||
+ | Download {{Fcfile|SIMAPI_Panel_Position_MoveTo.fcfx|SIMAPI_Panel_Position_MoveTo}} and open it in Flowcode v6. In this example, there are three cubiods that represent Axis X,Y,Z. Note they are coloured exactly as the panel axis indicator which represents your viewing position. There is a sphere also on the panel. | ||
+ | |||
+ | The MoveTo(h,x,y,z) function moves the object specified to a new set of coordinates. In the example file, the program moves the sphere from it's original location of x10,y10,z0 to x100,y75,z0, waits a second and then moves the sphere back to it's original coordinates. | ||
+ | |||
+ | The screenshots below show the effect and also highlight the code used by the example. | ||
+ | |||
+ | [[File:SIMAPI_Panel_Position_MoveTo_Pic1.png]][[File:SIMAPI_Panel_Position_MoveTo_Pic2.png]] | ||
+ | [[File:SIMAPI_Panel_Position_MoveTo_Pic0.png|800px]] |
Latest revision as of 15:57, 16 January 2014
<sidebar>API Contents</sidebar> Moves the object to the given coordinates relative to its parent
Contents
Parameters
HANDLE Handle
- The position or component to update
- The default value for this parameter is: this
FLOAT X
- Local coordinate X to update with
FLOAT Y
- Local coordinate Y to update with
FLOAT Z
- Local coordinate Z to update with
Return value
This call does not return a value
Detailed description
This moves a position to a set of absolute coordinates in its parents coordinate space. That is, the center of the parent object is considered to be (0, 0, 0).
This call is a compliment to MoveBy.
Examples
Calling in a calculation
- Add to a calculation icon:
::Panel.Position.MoveTo(handle, x, y, z)
Flowcode example file
Download SIMAPI_Panel_Position_MoveTo and open it in Flowcode v6. In this example, there are three cubiods that represent Axis X,Y,Z. Note they are coloured exactly as the panel axis indicator which represents your viewing position. There is a sphere also on the panel.
The MoveTo(h,x,y,z) function moves the object specified to a new set of coordinates. In the example file, the program moves the sphere from it's original location of x10,y10,z0 to x100,y75,z0, waits a second and then moves the sphere back to it's original coordinates.
The screenshots below show the effect and also highlight the code used by the example.