setVectorUp: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(add. ArmA2 classification)
m (template:command argument fix)
(13 intermediate revisions by 5 users not shown)
Line 10: Line 10:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Set object's up vector. Direction vector will remain unchanged. |= Description
| Set object's up vector. Direction of the object remain unchanged. Default object's [[vectorUp]] is [0,0,1].
 
In Multiplayer, [[setVectorUp]] must be executed on the machine where the object it applied to is [[local]]. |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| object '''setVectorUp''' [x, z, y] |= Syntax
| object '''setVectorUp''' [x, y, z] |SYNTAX=


|p1= object: [[Object]] |= Parameter 1
|p1= object: [[Object]] |PARAMETER1=


|p2= [x, z, y]: [[Array]] |= Parameter 2
|p2= [x, y, z]: [[Array]] |PARAMETER2=


| [[Nothing]] |= Return value
| [[Nothing]] |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________


|[[vectorUp]], [[setVectorDir]], [[vectorDir]], [[setVectorDirAndUp]] |= See also
|x1= Turn object upside down:
<code>_obj [[setVectorUp]] [0,0,-1];</code>|EXAMPLE1=
|x2= Align object with the terrain underneath:
<code>_obj [[setVectorUp]] [[surfaceNormal]] [[position]] _obj;</code>|EXAMPLE2=
 
|[[vectorDir]], [[vectorUp]], [[setVectorDir]], [[setVectorDirAndUp]], [[vectorDiff]], [[vectorAdd]], [[vectorMultiply]], [[vectorCrossProduct]], [[vectorDistance]], [[vectorMagnitudeSqr]], [[vectorDistanceSqr]], [[vectorCos]], [[vectorMagnitude]], [[vectorDotProduct]], [[vectorNormalized]], [[vectorFromTo]]|SEEALSO=


}}
}}
Line 29: Line 36:
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
 
<dd class="notedate">Posted 21:07, 3 March 2009 (CET)
<dt class="note">'''[[User:General Barron|General Barron]]'''<dd class="note">
setVectorUp can only influence an object's bank. It can not influence pitch. Example:
setVectorUp can only influence an object's bank. It can not influence pitch. Example:
     player setVectorUp [0,1,0]
     player setVectorUp [0,1,0]
     If the player is facing 0 degrees (north), then this will do NOTHING.
     If the player is facing 0 degrees (north), then this will do NOTHING.
     If the player is facing 90 degrees (east), then this will make him bank 90 degrees to his left.
     If the player is facing 90 degrees (east), then this will make him bank 90 degrees to his left.
--[[User:General Barron|General Barron]] 21:07, 3 March 2009 (CET)
</dd></dt></dd>
 
<dd class="notedate">Posted on March 22, 2007 - 05:07
<dt class="note">'''[[User:Kronzky|Kronzky]]'''<dd class="note">
An in-depth discussion on the concept of vectors is available [http://forums.bistudio.com/showthread.php?t=50914 here].
</dd></dt></dd>
 
<dd class="notedate">Posted on March 16, 2008 - 09:49
<dt class="note">'''[[User:Str|Str]]'''<dd class="note">Command can be also used to rotate camera in all three axis (which also mean it's possible to set camera bank).
</dd></dt></dd>
 
<dd class="notedate">Posted on October 3, 2013
<dt class="note">'''[[User:Killzone_Kid|Killzone_Kid]]'''<dd class="note">
It is possible to change both pitch and bank of an object ([[surfaceNormal]] application for instance). Assuming an ammo box in the following example is facing North (default direction is 0):<code>_ammobox [[setVectorUp]] [0,1,0]; //box is pitched 90 degrees forward
_ammobox [[setVectorUp]] [1,0,0]; //box is banked 90 degrees to the right</code>
However the above will stop working as soon as you attach the box to something. The following trick however will work in this case:
<code>_ammobox [[attachTo]] <nowiki>[</nowiki>[[player]], [0,2,1]];
_ammobox [[setVectorUp]] [0,0.99,0.01]; //box is pitched ~90 degrees forward
_ammobox [[setVectorUp]] [0.99,0,0.01]; //box is banked ~90 degrees to the right</code>
</dd></dt></dd>


<dd class="notedate">Posted on March 22, 2007 - 05:07</dd>
<dt class="note">'''[[User:Kronzky|Kronzky]]'''</dt><dd class="note">
An in-depth discussion on the concept of vectors is available [http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?act=ST;f=71;t=55727;hl=setvectorup here].
</dd>
<dd class="notedate">Posted on March 16, 2008 - 09:49</dd>
<dt class="note">'''[[User:Str|Str]]'''</dt><dd class="note">Command can be also used to rotate camera in all three axis (which also mean it's possible to set camera bank).</dd>
<!-- Note Section END -->
<!-- Note Section END -->
</dl>
</dl>
Line 50: Line 71:
[[Category:Scripting Commands ArmA|SETVECTORUP]]
[[Category:Scripting Commands ArmA|SETVECTORUP]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]

Revision as of 15:48, 7 April 2019

-wrong parameter ("Arma") defined!-1.00
Hover & click on the images for description

Description

Description:
Set object's up vector. Direction of the object remain unchanged. Default object's vectorUp is [0,0,1]. In Multiplayer, setVectorUp must be executed on the machine where the object it applied to is local.
Groups:
Uncategorised

Syntax

Syntax:
object setVectorUp [x, y, z]
Parameters:
object: Object
[x, y, z]: Array
Return Value:
Nothing

Examples

Example 1:
Turn object upside down: _obj setVectorUp [0,0,-1];
Example 2:
Align object with the terrain underneath: _obj setVectorUp surfaceNormal position _obj;

Additional Information

See also:
vectorDirvectorUpsetVectorDirsetVectorDirAndUpvectorDiffvectorAddvectorMultiplyvectorCrossProductvectorDistancevectorMagnitudeSqrvectorDistanceSqrvectorCosvectorMagnitudevectorDotProductvectorNormalizedvectorFromTo

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 21:07, 3 March 2009 (CET)
General Barron
setVectorUp can only influence an object's bank. It can not influence pitch. Example: player setVectorUp [0,1,0] If the player is facing 0 degrees (north), then this will do NOTHING. If the player is facing 90 degrees (east), then this will make him bank 90 degrees to his left.
Posted on March 22, 2007 - 05:07
Kronzky
An in-depth discussion on the concept of vectors is available here.
Posted on March 16, 2008 - 09:49
Str
Command can be also used to rotate camera in all three axis (which also mean it's possible to set camera bank).
Posted on October 3, 2013
Killzone_Kid
It is possible to change both pitch and bank of an object (surfaceNormal application for instance). Assuming an ammo box in the following example is facing North (default direction is 0):_ammobox setVectorUp [0,1,0]; //box is pitched 90 degrees forward _ammobox setVectorUp [1,0,0]; //box is banked 90 degrees to the right However the above will stop working as soon as you attach the box to something. The following trick however will work in this case: _ammobox attachTo [player, [0,2,1]]; _ammobox setVectorUp [0,0.99,0.01]; //box is pitched ~90 degrees forward _ammobox setVectorUp [0.99,0,0.01]; //box is banked ~90 degrees to the right

Bottom Section