velocityModelSpace: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
(Add m/s info)
 
(37 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma3 |= Game name
|game1= arma3
|version1= 0.50


|0.50|= Game version
|gr1= Object Manipulation
____________________________________________________________________________________________


| Returns the velocity (speed vector) of the vehicle as an array with format [x, y, z]. Vector is in model space. |= Description
|descr= Returns the velocity (speed vector) of the vehicle as an array with format [x, y, z] in metre per second. Vector is in model space.
____________________________________________________________________________________________


| '''velocityModelSpace''' vehicle |= Syntax
|s1= [[velocityModelSpace]] vehicle


|p1= vehicle: [[Object]] |PARAMETER1=
|p1= vehicle: [[Object]]


| [[Array]] |RETURNVALUE=
|r1= [[Array]]


|x1= <sqf>velocityModelSpace _chopper; // returns [X (left(-) right(+)), Y (backward(-) forward(+)), Z (down(-) up(+))]</sqf>


|x1= <code>[[velocityModelSpace]] _chopper;
|seealso= [[setVelocityModelSpace]] [[velocity]] [[speed]] [[setVelocity]] [[setVelocityTransformation]]
[[comment]] "Returns [X (left(-) right(+)), Y (backward(-) forward(+)), Z (down(-) up(+))]";
</code>|EXAMPLE1=
 
____________________________________________________________________________________________
 
| [[setVelocityModelSpace]], [[velocity]], [[speed]], [[setVelocity]], [[setVelocityTransformation]] |SEEALSO=
 
|  |MPBEHAVIOUR=
____________________________________________________________________________________________
}}
}}


<h3 style='display:none'>Notes</h3>
{{Note
<dl class='command_description'>
|user= Pierre MGI
<!-- Note Section BEGIN -->
|timestamp= 20141211025500
 
|text= This function is useful for helicopters as it returns Z vector like an indicator of thrust/load ratio. More or less climb (+) or descent (-) tendency but:
<!-- Note Section END -->
As X,Y,Z vectors are relative to vehicle attitude, this function doesn't return a climb or descend rate (as the attitude of the vehicle can be far from horizontal).
</dl>
You can get negative Z vector, in jets, while climbing fast, peeling off in the sky!
 
<h3 style='display:none'>Bottom Section</h3>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on December 11, 2014 - 02:55 (UTC)</dd>
<dt class="note">[[User:Pierre MGI|Pierre MGI]]</dt>
<dd class="note">
This function is useful for helicopters as it returns Z vector like an indicator of thrust/load ratio. More or less climb (+) or descent (-) tendency but:
As X,Y,Z vectors are relative to vehicle attitude, this function doesn't return a climb or descend rate (as the attitude of the vehicle can be far from horizontal). You can get negative Z vector, in jets, while climbing fast, peeling off in the sky!
More or less, you can use as a Z accelerometer factor but invert the sign: +G acceleration (negative vector below the jet) is -Z here.
More or less, you can use as a Z accelerometer factor but invert the sign: +G acceleration (negative vector below the jet) is -Z here.
If not "physically" correct, the behavior is sufficient enough for Arma flight model.
If not "physically" correct, the behavior is sufficient enough for {{arma}} flight model.
</dd>
}}
</dl>


<!-- CONTINUE Notes -->
{{Note
<dl class="command_description">
|user= K.J.
<dd class="notedate">Posted on June 21, 2015 - 02:36 (UTC)</dd>
|timestamp= 20150621023600
<dt class="note">[[User:K.J.|K.J.]]</dt>
|text= Previous note is physically incorrect. Velocity can not be used to give information about Thrust/Load ratio or G-Forces/acceleration.
<dd class="note">
To get acceleration you have to create the derivative of velocity after time dv/dt -> the difference of velocity between 2 timesteps divided by the time that passed between the 2 steps.
Previous note is physically incorrect. Velocity can not be used to give information about Thrust/Load ratio or G-Forces/acceleration. To get acceleration you have to create the derivative of velocity after time dv/dt -> the difference of velocity between 2 timesteps divided by the time that passed between the 2 steps.
}}
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 17:55, 18 September 2023

Hover & click on the images for description

Description

Description:
Returns the velocity (speed vector) of the vehicle as an array with format [x, y, z] in metre per second. Vector is in model space.
Groups:
Object Manipulation

Syntax

Syntax:
velocityModelSpace vehicle
Parameters:
vehicle: Object
Return Value:
Array

Examples

Example 1:
velocityModelSpace _chopper; // returns [X (left(-) right(+)), Y (backward(-) forward(+)), Z (down(-) up(+))]

Additional Information

See also:
setVelocityModelSpace velocity speed setVelocity setVelocityTransformation

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Pierre MGI - c
Posted on Dec 11, 2014 - 02:55 (UTC)
This function is useful for helicopters as it returns Z vector like an indicator of thrust/load ratio. More or less climb (+) or descent (-) tendency but: As X,Y,Z vectors are relative to vehicle attitude, this function doesn't return a climb or descend rate (as the attitude of the vehicle can be far from horizontal). You can get negative Z vector, in jets, while climbing fast, peeling off in the sky! More or less, you can use as a Z accelerometer factor but invert the sign: +G acceleration (negative vector below the jet) is -Z here. If not "physically" correct, the behavior is sufficient enough for Arma flight model.
K.J. - c
Posted on Jun 21, 2015 - 02:36 (UTC)
Previous note is physically incorrect. Velocity can not be used to give information about Thrust/Load ratio or G-Forces/acceleration. To get acceleration you have to create the derivative of velocity after time dv/dt -> the difference of velocity between 2 timesteps divided by the time that passed between the 2 steps.