1
0
mirror of synced 2024-11-12 01:20:48 +01:00

add depth perception

This commit is contained in:
doomertheboomer 2023-07-30 18:50:19 +07:00
parent 48e641ec3c
commit 066bf3eb0e

View File

@ -268,9 +268,9 @@ void pollKinect() {
//std::cout << "Right Leg: X = " << rightLegPos.x << ", Y = " << rightLegPos.y << ", Z = " << rightLegPos.z << std::endl;
feet[1].event.x = xGrad * leftLegPos.x + xOffset;
feet[1].event.y = 0.5;
feet[1].event.y = zGrad * leftLegPos.z + zOffset;
feet[2].event.x = xGrad * rightLegPos.x + xOffset;
feet[2].event.y = 0.5;
feet[2].event.y = zGrad * rightLegPos.z + zOffset;
// Fix feet height
float fixedLeft = leftLegPos.y - (yGrad * leftLegPos.z + yOffset);