setCenterOfMass: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|PARAMETER2=1" to "|PARAMETER21=")
(second arg is array)
(One intermediate revision by one other user not shown)
Line 11: Line 11:
____________________________________________________________________________________________
____________________________________________________________________________________________


|myObject '''setCenterOfMass''' [com, time]|SYNTAX=
| myObject [[setCenterOfMass]] [centerOfMass, time] |SYNTAX=


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


|p2= com: [[Array]] - [x,y,z] offset relative to the model centre|PARAMETER2=  
|p2= [centerOfMass, time]: [[Array]] |PARAMETER2=  


|p3= time: [[Number]] |PARAMETER3=  
|p3= centerOfMass: [[Array]] - [x,y,z] offset relative to the model centre |PARAMETER3=
 
|p4= time: [[Number]] - transition time, 0 for instant center of mass transfer |PARAMETER4=


| [[Nothing]] |RETURNVALUE=  
| [[Nothing]] |RETURNVALUE=  
____________________________________________________________________________________________
____________________________________________________________________________________________


|s2= myObject '''setCenterOfMass''' com |=  
|s2= myObject [[setCenterOfMass]] centerOfMass |SYNTAX2=


|p21= myObject: [[Object]] |PARAMETER21=  
|p21= myObject: [[Object]] |PARAMETER21=


|p22= com: [[Array]] - [x,y,z] offset relative to the model centre |PARAMETER2=2
|p22= centerOfMass: [[Array]] - [x,y,z] offset relative to the model centre |PARAMETER22=


|r2= [[Nothing]]|=
|r2= [[Nothing]] |RETURNVALUE2=
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code>myObject [[setCenterOfMass]] <nowiki>[[</nowiki>0,-1,0],0.5<nowiki>]</nowiki>;</code>|EXAMPLE1=  
|x1= <code>myObject [[setCenterOfMass]] [<nowiki/>[0,-1,0], 0.5];</code> |EXAMPLE1=


|x2= <code>myObject [[setCenterOfMass]] [0,-1,0];</code>|EXAMPLE2=  
|x2= <code>myObject [[setCenterOfMass]] [0,-1,0];</code>|EXAMPLE2=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[getCenterOfMass]], [[setMass]], [[getMass]] |SEEALSO=  
| [[getCenterOfMass]], [[setMass]], [[getMass]] |SEEALSO=
 
|  |MPBEHAVIOUR=
____________________________________________________________________________________________
}}
}}


Line 74: Line 73:


<h3 style='display:none'>Bottom Section</h3>
<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 Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Revision as of 00:57, 7 October 2019

Hover & click on the images for description

Description

Description:
Changes the center of mass of an object smoothly during the given time (in seconds). A time of zero (or using the alternative syntax) means an immediate change.
Groups:
Uncategorised

Syntax

Syntax:
myObject setCenterOfMass [centerOfMass, time]
Parameters:
myObject: Object
[centerOfMass, time]: Array
centerOfMass: Array - [x,y,z] offset relative to the model centre
time: Number - transition time, 0 for instant center of mass transfer
Return Value:
Nothing

Alternative Syntax

Syntax:
myObject setCenterOfMass centerOfMass
Parameters:
myObject: Object
centerOfMass: Array - [x,y,z] offset relative to the model centre
Return Value:
Nothing

Examples

Example 1:
myObject setCenterOfMass [[0,-1,0], 0.5];
Example 2:
myObject setCenterOfMass [0,-1,0];

Additional Information

See also:
getCenterOfMasssetMassgetMass

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

Notes

Posted on 20 Jun, 2014 - 12:50
ffur2007slx2_5
(ArmA3 1.22) A quick reference:
category setMass setCenterOfMass
unit The larger the mass is, the easier a unit will physically fatigued N/A
aircraft The larger the mass is, the more sensitive an aircraft will react to joystick, vice versa. Aircraft slant due to center change accordingly, and the position of the camera view will be altered relatively at the same time. (3rd person view)
vehicle The larger the mass is, the slower a vehicle drives (Ships will sink), vice versa. (Land vehicle performs like a bouncing ball while ships accelerated pretty speedy.) Vehicle slant due to center change accordingly.

Bottom Section