I can't get the RigidBody-Sample application to work. I've modified the main part to accurately measure FPS, so that it looks like the following:
Code: Select all
int mFrameCounter=0;
NPRESULT result;
LARGE_INTEGER ticksPerSec, ticks, prevTicks;
QueryPerformanceFrequency(&ticksPerSec);
QueryPerformanceCounter(&prevTicks);
while(!_kbhit())
{
result = RB_GetLatestFrame();
if(result == NPRESULT_SUCCESS)
{
QueryPerformanceCounter(&ticks);
double fps = (double)ticksPerSec.QuadPart / (ticks.QuadPart - prevTicks.QuadPart);
mFrameCounter++;
int markers = RB_FrameMarkerCount();
int bodies = 0;
for(int i=0; i<RB_GetRigidBodyCount(); i++)
if(RB_IsRigidBodyTracked(i))
bodies++;
if((mFrameCounter%32)==0)
printf("Frame %5d %.1ffps Markers %3d Tracked RB's %2d\n", mFrameCounter, fps, markers, bodies);
prevTicks = ticks;
} else {
printf("Error %d: %s\n", result, RB_GetResultString(result));
}
Sleep(1);
}
Code: Select all
Error 11: Invalid license
Yet, the Rigid Body Tool works fine and is able to track rigid bodies without licensing problems. Apparently this sample app does something differently.
How do I fix this?