fake controller: apply offset

This commit is contained in:
Ben Campbell 2017-10-29 10:42:20 +13:00
parent 1127abeaf0
commit 9d75de96a2
1 changed files with 10 additions and 3 deletions

View File

@ -271,8 +271,8 @@ static HeadsetType fakeGetType() {
}
static HeadsetOrigin fakeGetOriginType() {
return ORIGIN_HEAD; // seated
//return ORIGIN_FLOOR; // standing
//return ORIGIN_HEAD; // seated
return ORIGIN_FLOOR; // standing
}
static int fakeIsMirrored() {
@ -366,7 +366,14 @@ static ControllerHand fakeControllerGetHand(Controller* controller) {
static void fakeControllerGetPosition(Controller* controller, float* x, float* y, float* z) {
// for now, locked to headset
fakeGetPosition(x,y,z);
float offset[3];
vec3_set(offset, 0, 0,-1.0f);
mat4_transform(state.transform, offset);
*x = offset[0];
*y = offset[1];
*z = offset[2];
}
static void fakeControllerGetOrientation(Controller* controller, float* angle, float* x, float* y, float* z) {