TwinFan / XPMP2

Multiplayer library for X-Plane 11/12 with instancing, TCAS override, and sound
https://twinfan.github.io/XPMP2/
Other
24 stars 16 forks source link

TCAS Targets: Set `weight_on_wheels` dataRef when on ground #51

Closed TwinFan closed 1 year ago

TwinFan commented 1 year ago

Describe the bug XPMP2 does set a number of TCAS target-related dataRefs, but not

sim/cockpit2/tcas/targets/position/weight_on_wheels

This should be set to true when the plane is on the ground.

Currently, though, XPMP2 does not generically know when a plane is on the ground. This will require a new interface function Aircraft::SetOnGnd() for plugins to inform XPMP2 about a plane being on the ground.

As an additional service, this new function can be coupled with Aircraft::SetTouchDown(), which currently only directly controls the libxplanemp/misc/touch_down animation dataRef, which typically causes CSL objects to emit tire smoke. XPMP2 could offer to automatically control SetTouchDown, like in

Aircraft::SetOnGnd (bool bOnGnd, float fSetTochDownTime = NAN);

with fSetTouchDownTime being an optional parameter denoting for how long the touch_down animation dataRaf is set to true.

Todos

To Reproduce / Source Code Example Updating this dataRef is missing in AIUpdateTCASTargets().

Expected behavior sim/cockpit2/tcas/targets/position/weight_on_wheels should be set to true when plane is in the ground.

Version

Additional context First reported and locally implemented for xPilot in xpilot-project/xpilot#34.