Page MenuHomeFeedback Tracker

getPosASL and eyePos return incorrect Z coordinates
Closed, ResolvedPublic

Description

getPosASL and eyePos return incorrect Z coordinates.

The error is proportionate to the distance between the z value being tested and the sea level.

{F21808}

Details

Legacy ID
1407694354
Severity
None
Resolution
No Bug
Reproducibility
Always
Category
Scripting
Steps To Reproduce

Download test mission and put in folder etc.

Start mission

Go into 3rd person to see better.

Press 0, 0, 0

Three lines are drawn between the player and man1.

Red = eyePos
Blue = getPosASL
Green = getPosATL

Move towards man1 (follow the lines).

As you move closer, note that the green line is drawn in the correct place.

The Red and Blue lines are way above the player (and man1).

Event Timeline

DasAttorney edited Additional Information. (Show Details)
DasAttorney set Category to Scripting.
DasAttorney set Reproducibility to Always.
DasAttorney set Severity to None.
DasAttorney set Resolution to No Bug.
DasAttorney set Legacy ID to 1407694354.May 7 2016, 4:24 PM

This doesn't sound like a bug. Both getPosASL and eyePos return PositionASL, drawLine3D expects PositionATL. If you feed it PositionASL you get your Z offset by the sea level. Use ASLtoATL to convert the positions.

Place both men in the sea and eyePos and ASL will work correctly. see updated description of this command https://community.bistudio.com/wiki/drawLine3D

Thanks for the replies gents.

Was unaware of the ATLtoASL and ASLtoATL commands.

You can close this as resolved if you like.