mirror of https://github.com/bjornbytes/lovr.git
lovr.headset.getTrackingSize;
This commit is contained in:
parent
3444d6cb77
commit
d98cd40f49
|
@ -23,6 +23,10 @@ void lovrHeadsetSetClipDistance(float near, float far) {
|
|||
headset->interface->setClipDistance(headset, near, far);
|
||||
}
|
||||
|
||||
void lovrHeadsetGetTrackingSize(float* width, float* depth) {
|
||||
headset->interface->getTrackingSize(headset, width, depth);
|
||||
}
|
||||
|
||||
void lovrHeadsetGetPosition(float* x, float* y, float* z) {
|
||||
headset->interface->getPosition(headset, x, y, z);
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ typedef struct {
|
|||
const char* (*getType)(void* headset);
|
||||
void (*getClipDistance)(void* headset, float* near, float* far);
|
||||
void (*setClipDistance)(void* headset, float near, float far);
|
||||
void (*getTrackingSize)(void* headset, float* width, float* depth);
|
||||
void (*getPosition)(void* headset, float* x, float* y, float* z);
|
||||
void (*getOrientation)(void* headset, float* x, float* y, float* z, float* w);
|
||||
void (*getVelocity)(void* headset, float* x, float* y, float* z);
|
||||
|
@ -25,6 +26,7 @@ int lovrHeadsetIsPresent();
|
|||
const char* lovrHeadsetGetType();
|
||||
void lovrHeadsetGetClipDistance(float* near, float* far);
|
||||
void lovrHeadsetSetClipDistance(float near, float far);
|
||||
void lovrHeadsetGetTrackingSize(float* width, float* depth);
|
||||
void lovrHeadsetGetPosition(float* x, float* y, float* z);
|
||||
void lovrHeadsetGetOrientation(float* x, float* y, float* z, float* w);
|
||||
void lovrHeadsetGetVelocity(float* x, float* y, float* z);
|
||||
|
|
|
@ -147,6 +147,12 @@ void viveSetClipDistance(void* headset, float near, float far) {
|
|||
state->clipFar = far;
|
||||
}
|
||||
|
||||
void viveGetTrackingSize(void* headset, float* width, float* depth) {
|
||||
Headset* this = (Headset*) headset;
|
||||
ViveState* state = this->state;
|
||||
state->vrChaperone->GetPlayAreaSize(width, depth);
|
||||
}
|
||||
|
||||
void viveGetPosition(void* headset, float* x, float* y, float* z) {
|
||||
Headset* this = (Headset*) headset;
|
||||
ViveState* state = this->state;
|
||||
|
|
|
@ -7,6 +7,7 @@ int viveIsPresent(void* headset);
|
|||
const char* viveGetType(void* headset);
|
||||
void viveGetClipDistance(void* headset, float* near, float* far);
|
||||
void viveSetClipDistance(void* headset, float near, float far);
|
||||
void viveGetTrackingSize(void* headset, float* width, float* depth);
|
||||
void viveGetPosition(void* headset, float* x, float* y, float* z);
|
||||
void viveGetOrientation(void* headset, float* x, float* y, float* z, float* w);
|
||||
void viveGetVelocity(void* headset, float* x, float* y, float* z);
|
||||
|
|
|
@ -14,6 +14,7 @@ const luaL_Reg lovrHeadset[] = {
|
|||
{ "getType", l_lovrHeadsetGetType },
|
||||
{ "getClipDistance", l_lovrHeadsetGetClipDistance },
|
||||
{ "setClipDistance", l_lovrHeadsetSetClipDistance },
|
||||
{ "getTrackingSize", l_lovrHeadsetGetTrackingSize },
|
||||
{ "getPosition", l_lovrHeadsetGetPosition },
|
||||
{ "getOrientation", l_lovrHeadsetGetPosition },
|
||||
{ "getVelocity", l_lovrHeadsetGetVelocity },
|
||||
|
@ -54,6 +55,14 @@ int l_lovrHeadsetSetClipDistance(lua_State* L) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int l_lovrHeadsetGetTrackingSize(lua_State* L) {
|
||||
float width, depth;
|
||||
lovrHeadsetGetClipDistance(&width, &depth);
|
||||
lua_pushnumber(L, width);
|
||||
lua_pushnumber(L, depth);
|
||||
return 2;
|
||||
}
|
||||
|
||||
int l_lovrHeadsetGetPosition(lua_State* L) {
|
||||
float x, y, z;
|
||||
lovrHeadsetGetPosition(&x, &y, &z);
|
||||
|
|
|
@ -8,6 +8,7 @@ int l_lovrHeadsetIsPresent(lua_State* L);
|
|||
int l_lovrHeadsetGetType(lua_State* L);
|
||||
int l_lovrHeadsetGetClipDistance(lua_State* L);
|
||||
int l_lovrHeadsetSetClipDistance(lua_State* L);
|
||||
int l_lovrHeadsetGetTrackingSize(lua_State* L);
|
||||
int l_lovrHeadsetGetPosition(lua_State* L);
|
||||
int l_lovrHeadsetGetOrientation(lua_State* L);
|
||||
int l_lovrHeadsetGetVelocity(lua_State* L);
|
||||
|
|
Loading…
Reference in New Issue