setVectorUp: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<dl class="command_description"> <dd class="notedate">" to "<dl class="command_description"> <dt></dt> <dd class="notedate">")
m (Text replacement - "| Nothing |x1=" to "|r1= Nothing |x1=")
Line 20: Line 20:
|p2= [x, y, z]: [[Array]]
|p2= [x, y, z]: [[Array]]


| [[Nothing]]
|r1= [[Nothing]]


|x1= Turn object upside down:
|x1= Turn object upside down:

Revision as of 11:19, 10 June 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
Math - Vectors

Syntax

Syntax:
Syntax needed
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
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 is 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