30 eyeRenderTexture(nullptr),
74 #define DEBUG_SQUARES 0
77 for (
int i = 0; i < 10; ++i) {
78 unsigned char* pix = img.getPixelAddress(img.width()-15-(i*30),img.height()-15);
83 if (pix[0] <= 5 && pix[1] >= 250 && pix[2] <= 5) {
89 if (pix[0] >= 250 && pix[1] <= 5 && pix[2] <= 5) {
99 #endif // DEBUG_SQUARES
102 size_t w = img.width();
103 size_t h = img.height();
104 size_t rs = img.getRowSize();
105 unsigned char *data = img.getRawImage();
115 for (
size_t i = 0; i < h; ++i) {
117 unsigned char* dataStart = data + (i*rs);
118 memcpy(textureStart, dataStart, rs);
126 unsigned char* dataStart = data + (y+i)*rs + x*3;
143 int ret = std::sscanf(b.
toString().c_str(),
"%d %lg %lg %lg %lg\n", &seqNum, &ts, &r, &p, &yy);
145 roll += OVR::DegreeToRad(
static_cast<float>(r));
146 pitch += OVR::DegreeToRad(
static_cast<float>(p));
147 yaw += OVR::DegreeToRad(
static_cast<float>(yy));
150 eyeRenderTexture->
eyePose.Orientation.w = (float)(- cos(roll/2) * cos(pitch/2) * cos(yaw/2) - sin(roll/2) * sin(pitch/2) * sin(yaw/2));
151 eyeRenderTexture->
eyePose.Orientation.x = (float)(- cos(roll/2) * sin(pitch/2) * cos(yaw/2) - sin(roll/2) * cos(pitch/2) * sin(yaw/2));
152 eyeRenderTexture->
eyePose.Orientation.y = (float)(- cos(roll/2) * cos(pitch/2) * sin(yaw/2) + sin(roll/2) * sin(pitch/2) * cos(yaw/2));
153 eyeRenderTexture->
eyePose.Orientation.z = (float)(- sin(roll/2) * cos(pitch/2) * cos(yaw/2) + cos(roll/2) * sin(pitch/2) * sin(yaw/2));