Page MenuHomeFeedback Tracker

getRelDir and setVectorDirAndUp break Camera Rotation and Alignment
Feedback, LowPublic


When using getRelDir before setVectorDirAndUp on a Player the Camera Rotation and Alignment Breaks.


Unable To Reproduce
Operating System
Windows 10 x64
Operating System Version
Steps To Reproduce
  1. Load The Test Mission
  2. Rest your Weapon on a steep hill
  3. Go into 3rd Person
  4. execute Code in Debug Console
JK_fnc_test = { 
    player getRelDir player;
    player setVectorDirAndUp [vectorDir player, [0, 0, 1]]; 
if (isNil "JK_Test") then {
    JK_Test = addMissionEventHandler ["EachFrame", {
        call JK_fnc_test; 
Additional Information

Related Issue:

Expected Camera Angle:
Caused Camera Angle:

A temporary workaround is calculating the relative direction your self with this snipped

private _relDir = (((player getDir target) - getDir player) + 360) % 360;

Event Timeline

jokoho482 created this task.Sep 2 2020, 1:25 PM
jokoho482 updated the task description. (Show Details)Sep 2 2020, 3:35 PM
jokoho482 edited Additional Information. (Show Details)Sep 2 2020, 3:37 PM

cannot reproduce

BIS_fnc_KK changed the task status from New to Need More Info.Sep 2 2020, 4:48 PM
jokoho482 edited Steps To Reproduce. (Show Details)Sep 2 2020, 5:27 PM

@BIS_fnc_KK did you go into 3rd Person? I forgot to add that to the Repro steps. in 3rd person, I can to 100% reproduce it on 3 different PCs

Obviously I went into 3rd person. Are you using mods? What Arma 3 version you have. Is this MP, SP, or both?

jokoho482 added a comment.EditedSep 2 2020, 8:37 PM

I am Running Total Vanilla, Arma 3 Performance Profiling branch, and reproducible in SP and MP(i currently only tested locally hosted)
I noticed that a few positions do not trigger not that extreme effect. on Stratis laying on exactly that position [4444.16,6439.13,-0.000411987] you have the extreme angle, but a few steps back you don't have that issue

I cannot reproduce the issue on the latest dev branch build. It is probably specific to the profiling branch.

I can Reproduce in the latest Dev-Branch Build.

I‘be sent your ticket to our QA let’s see if they can reproduce it

diwako added a subscriber: diwako.Sep 14 2020, 1:13 PM
jokoho482 edited Additional Information. (Show Details)
jokoho482 changed Operating System Version from 2004 to 21h1.

Cannot repro, the script doesnt affect the current view with or without getRelDir

BIS_fnc_KK lowered the priority of this task from Normal to Low.Jun 30 2021, 8:39 AM
BIS_fnc_KK changed Severity from Minor to None.
BIS_fnc_KK changed Reproducibility from Always to Unable To Reproduce.
dedmen added a subscriber: dedmen.EditedJun 30 2021, 12:15 PM

Reproduced first try, not sure what the issue with reproing was.
Also as expected executing

JK_fnc_test = { 

    player setVectorDirAndUp [vectorDir player, [0, 0, 1]]; 


Fixes the camera angle.

dedmen claimed this task.Jun 30 2021, 12:15 PM
dedmen changed the task status from Need More Info to Assigned.
dedmen set Ref Ticket to AIII-54397.
dedmen added a comment.EditedJun 30 2021, 12:53 PM

Oh wow thats a good bug.
Found the cause, wonder what else this has broken all over the place without being noticed...

For performance we cache some calculated data from the players position/orientation when its first requested.

And when you modify that position/orientation its supposed to delete the cached entries.
That reset was forgotten for setDirAndUp, so the cached values were considered "correct" even though they weren't after the direction was changed.

dedmen changed the task status from Assigned to Feedback.Jul 1 2021, 3:27 PM

Rev 147836
Profiling v9