Difference between revisions of "API Panel.Position.RotateY"

From Flowcode Help
Jump to navigationJump to search
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
<sidebar>API contents</sidebar>
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
Rotates the object around the Y axis
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RotateY'''
 
+
|-
<div style="width:25%; float:right" class="toc">
+
| colspan="2" | Rotates the object around the Y axis&nbsp;
====Class hierarchy====
+
|-
[[API Panel|Panel]]
+
|-
:[[API Panel.Position|Position]]
+
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
::[[API Panel.Position|RotateY]]
+
| width="90%" | Handle
</div>
+
|-
__TOC__
+
| colspan="2" | The position or component to update&nbsp;
 
+
|-
==Parameters==
+
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
[[Variable types|HANDLE]] ''Handle''
+
| width="90%" | PivotHandle
:The position or component to update
+
|-
:''The default value for this parameter is: '''''this'''
+
| colspan="2" | An optional position to treat as the origin to rotate around&nbsp;
 
+
|-
[[Variable types|HANDLE]] ''PivotHandle''
+
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
:An optional position to treat as the origin to rotate around
+
| width="90%" | Degrees
 
+
|-
[[Variable types|FLOAT]] ''Degrees''
+
| colspan="2" | Number of degrees to rotate by&nbsp;
:Number of degrees to rotate by
+
|-
 
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - NONE
 
+
| width="90%" style="border-top: 2px solid #000;" | ''Return''
==Return value==
+
|}
''This call does not return a value''
 
  
  
 
==Detailed description==
 
==Detailed description==
 
[[file:SIMAPI_Panel_Position_RotateY_Pic1.png|375px|right]]
 
[[file:SIMAPI_Panel_Position_RotateY_Pic1.png|375px|right]]
The rotation call allows an object to be [[Object rotation|rotated]] around any point in the target objects local Y axis. This has the effect of altering the '''yaw''' of the object - in terms of an aeroplane this makes the plane turn from side to side.
+
The rotation call allows an object to be [[Object Rotation|rotated]] around any point in the target objects local Y axis. This has the effect of altering the '''yaw''' of the object - in terms of an aeroplane this makes the plane turn from side to side.
  
The handle must be a valid handle to a component, or a quoted (string) name of an object that can be selected on the panel.
+
The handle must be a valid handle to a component or position, or a quoted (string) name of an object that can be selected on the panel.
  
The '''Pivot''' is an optional position to rotate around. The object will adjust its angle as though it is sliding around the edge of a circle, so at 180 degrees the object will appear 'upside-down' in the same way as a human walking around the globe from the north to south pole.
+
The ''PivotHandle'' is an optional position to rotate around. The object will adjust its angle as though it is sliding around the edge of a circle, so at 180 degrees the object will appear 'upside-down' in the same way as a human walking around the globe from the north to south pole.
  
If the Pivot is zero the object rotates around its own center.
+
If the ''PivotHandle'' is zero the object rotates around its own center.
  
The image to the right shows a cube with it's axis positions identified. Note in this context the x,y,z axis is illustrated just to highlight the explanation of technique, it is not representative of the axis position in Flowcode v6.  
+
The image to the right shows a cube with it's axis positions identified.
  
 
Calling the simulation api '''Panel.Position.RotateY(MyCube,MyCube,1)''' will rotate the object in one-degree steps along it's Y-axis as shown by the green rotation arc. To rotate the cube in a counter direction simply specify a negative number for the degrees parameter.  
 
Calling the simulation api '''Panel.Position.RotateY(MyCube,MyCube,1)''' will rotate the object in one-degree steps along it's Y-axis as shown by the green rotation arc. To rotate the cube in a counter direction simply specify a negative number for the degrees parameter.  
Line 49: Line 48:
 
===See also===
 
===See also===
  
[[Object rotation]]
+
[[Object Rotation]]
  
[[Local and world space]]
+
[[Local and World Space]]
  
 
==Examples==
 
==Examples==
Line 58: Line 57:
  
 
===Flowcode example file===
 
===Flowcode example file===
Download [[File:SIMAPI_Panel_Position_RotateY_v1.fcf]] and open it in Flowcode v6.
+
Download {{Fcfile|SIMAPI_Panel_Position_RotateY_v1.fcfx|SIMAPI_Panel_Position_RotateY_v1}} and open it in Flowcode v6.
  
The sample file [[File:SIMAPI Panel Position RotateXYZ.fcf]] rotates a grouped object around its X, Y, and Z axis.
+
The sample file {{Fcfile|SIMAPI Panel Position RotateXYZ.fcfx|SIMAPI Panel Position RotateXYZ}} rotates a grouped object around its X, Y, and Z axis.

Latest revision as of 11:41, 16 January 2023

Fc9-comp-macro.png RotateY
Rotates the object around the Y axis 
Fc9-h32-icon.png - HANDLE Handle
The position or component to update 
Fc9-h32-icon.png - HANDLE PivotHandle
An optional position to treat as the origin to rotate around 
Fc9-f32-icon.png - FLOAT Degrees
Number of degrees to rotate by 
Fc9-void-icon.png - NONE Return


Detailed description

SIMAPI Panel Position RotateY Pic1.png

The rotation call allows an object to be rotated around any point in the target objects local Y axis. This has the effect of altering the yaw of the object - in terms of an aeroplane this makes the plane turn from side to side.

The handle must be a valid handle to a component or position, or a quoted (string) name of an object that can be selected on the panel.

The PivotHandle is an optional position to rotate around. The object will adjust its angle as though it is sliding around the edge of a circle, so at 180 degrees the object will appear 'upside-down' in the same way as a human walking around the globe from the north to south pole.

If the PivotHandle is zero the object rotates around its own center.

The image to the right shows a cube with it's axis positions identified.

Calling the simulation api Panel.Position.RotateY(MyCube,MyCube,1) will rotate the object in one-degree steps along it's Y-axis as shown by the green rotation arc. To rotate the cube in a counter direction simply specify a negative number for the degrees parameter.

The screenshot from Flowcode v6 below shows a cuboid with it's internal axis shown (green is the Y-axis line), and also a circle that cuts right through the cuboid's Y-axis (see example section below for links to the file) When the program runs the cuboid rotates along it's Y axis.

SIMAPI Panel Position RotateY Pic2.png


See also

Object Rotation

Local and World Space

Examples

Calling in a calculation

  • Add to a calculation icon:
    ::Panel.Position.RotateY(handle, pivothandle, degrees)

Flowcode example file

Download FC6 Icon.png SIMAPI_Panel_Position_RotateY_v1 and open it in Flowcode v6.

The sample file FC6 Icon.png SIMAPI Panel Position RotateXYZ rotates a grouped object around its X, Y, and Z axis.