SPON_viewVector v1.0.0
- Released: 2008-07-07
- SQF function in a single file.
- Includes simple test mission.
Description
Calculates the direction that the local player (camera) is looking in. That is, it always points at the centre of the screen, regardless of floating zone, weapon, scope, vehicle, freelook, rear-view mirror, etc.
The view direction is distinct from getDir, which is the direction of overall facing, or from weaponDirection, which is the way the weapon is pointing.
I needed this for myself and thought someone else might find it useful. It is functionality that I've wanted in the game for a long time, but I had an epiphany today and got it worked out! Haven't tested it thoroughly yet, but it seems to work perfectly.
Parameters:
None.
Returns:
Normal vector of current camera view [3 element array [X, Y, Z]].