summaryrefslogtreecommitdiffhomepage
path: root/x-plane-plugin/plugin.c
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-10-30 21:45:52 +0100
committerStanislaw Halik <sthalik@misaki.pl>2013-10-30 21:45:52 +0100
commit598ccf7316a44b5a31eb3c0c1850123985c1c5a6 (patch)
treeab1f8f92515fa54700641990cb15f1b180ad3ff7 /x-plane-plugin/plugin.c
parentdea1031c422c1402bd05765c33e2dd4bdaf4f6ac (diff)
use proper origin
Signed-off-by: Stanislaw Halik <sthalik@misaki.pl>
Diffstat (limited to 'x-plane-plugin/plugin.c')
-rw-r--r--x-plane-plugin/plugin.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/x-plane-plugin/plugin.c b/x-plane-plugin/plugin.c
index ec0e1871..2c43b98d 100644
--- a/x-plane-plugin/plugin.c
+++ b/x-plane-plugin/plugin.c
@@ -95,9 +95,9 @@ int write_head_position(
{
if (lck_posix != NULL && shm_posix != NULL) {
PortableLockedShm_lock(lck_posix);
- XPLMSetDataf(view_x, shm_posix->data[TX] * 1e-3);
- XPLMSetDataf(view_y, shm_posix->data[TY] * 1e-3);
- XPLMSetDataf(view_z, shm_posix->data[TZ] * 1e-3);
+ XPLMSetDataf(view_x, shm_posix->data[TX] * 1e-3 + offset_x);
+ XPLMSetDataf(view_y, shm_posix->data[TY] * 1e-3 + offset_y);
+ XPLMSetDataf(view_z, shm_posix->data[TZ] * 1e-3 + offset_z);
XPLMSetDataf(view_heading, shm_posix->data[Yaw] * 180 / 3.141592654);
XPLMSetDataf(view_pitch, shm_posix->data[Pitch] * 180 / 3.141592654);
PortableLockedShm_unlock(lck_posix);
@@ -106,9 +106,9 @@ int write_head_position(
}
PLUGIN_API int XPluginStart ( char * outName, char * outSignature, char * outDescription ) {
- view_x = XPLMFindDataRef("sim/graphics/view/pilots_head_x");
- view_y = XPLMFindDataRef("sim/graphics/view/pilots_head_y");
- view_z = XPLMFindDataRef("sim/graphics/view/pilots_head_z");
+ view_x = XPLMFindDataRef("sim/aircraft/view/acf_peX");
+ view_y = XPLMFindDataRef("sim/aircraft/view/acf_peY");
+ view_z = XPLMFindDataRef("sim/aircraft/view/acf_peZ");
view_heading = XPLMFindDataRef("sim/graphics/view/pilots_head_psi");
view_pitch = XPLMFindDataRef("sim/graphics/view/pilots_head_the");
if (view_x && view_y && view_z && view_heading && view_pitch) {