fn vbs setPitchBank (VBS2)
From Bohemia Interactive Community
| Editors, please check Policy: Scripting Command Page Syntax. |
Click on the images for descriptions
Introduced in
- Game:
- Virtual Battlespace 2
- Version:
- 1.19
Description
- Description:
- Rotates an object, giving it the specified pitch and bank, in degrees.
Pitch is 0 when the object is level; 90 when pointing straight up; and -90 when pointing straight down.
Bank is 0 when level; 90 when the object is rolled to the right, -90 when rolled to the left, and 180 when rolled upside down.
Note that the object's yaw can be set with the setdir command, which should be issued before using this function, if required.
The pitch/bank can be leveled out (set to 0) by using the setdir command.
Syntax
- Syntax:
- [object, pitch, bank, (apply)] call fn_vbs_setPitchBank
- Parameters:
- object: Object - object to be rotated
- pitch: Number - degrees of pitch to give object
- bank: Number - degrees of bank to give object
- apply: Boolean - (optional, default: true) whether the pitch/bank should be applied to the object, or whether to just return the calculated vectors. (only available since v1.22)
- Return Value:
- Array - [vectorDir array (Vector3D), vectorUp array (Vector3D)]
(only since 1.22; before Nothing was returned)
Examples
- Example 1:
[player, 45, -45] call fn_vbs_setPitchBank
Additional Information
- Multiplayer:
- Behaviour unknown.
- See also:
- fn_vbs_getPitchBank_(VBS2); setVectorDirAndUp
Notes
Notes
Notes
-
This function is similar to setVectorDirAndUp, however the inputs (pitch / bank) are more natural to work with. There are certain situations where working with absolute positions and vectors are more useful, and in those cases, setVectorDirAndUp should be used instead. But in general, you should find this function to be more useful.

