Prechádzať zdrojové kódy

potential fix for rotation + translation order

Christoph Haag 6 rokov pred
rodič
commit
2be3730d62
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      src/openhmd.c

+ 2 - 2
src/openhmd.c

@@ -288,7 +288,7 @@ static int ohmd_device_getf_unp(ohmd_device* device, ohmd_float_value type, floa
 			mat4x4f orient, world_shift, result;
 			omat4x4f_init_look_at(&orient, &rot, &point);
 			omat4x4f_init_translate(&world_shift, -device->position.x +(device->properties.ipd / 2.0f), -device->position.y, -device->position.z);
-			omat4x4f_mult(&world_shift, &orient, &result);
+			omat4x4f_mult(&orient, &world_shift, &result);
 			omat4x4f_transpose(&result, (mat4x4f*)out);
 			return OHMD_S_OK;
 		}
@@ -299,7 +299,7 @@ static int ohmd_device_getf_unp(ohmd_device* device, ohmd_float_value type, floa
 			mat4x4f orient, world_shift, result;
 			omat4x4f_init_look_at(&orient, &rot, &point);
 			omat4x4f_init_translate(&world_shift, -device->position.x + -(device->properties.ipd / 2.0f), -device->position.y, -device->position.z);
-			omat4x4f_mult(&world_shift, &orient, &result);
+			omat4x4f_mult(&orient, &world_shift, &result);
 			omat4x4f_transpose(&result, (mat4x4f*)out);
 			return OHMD_S_OK;
 		}