Ejemplo n.º 1
0
//===========================================================================
int COptoTrack::ParseBuffer(int iSensorIdx,
                            int nFrames,
                            void * pvSrcBuffer,
                            double * pdTimeStamps, 
                            tdXYZ * pdCoordinates,
                            tdXYZ * pdVelocities  ){

  tOptoFrame * ptFrame;
  int iFrame, iSensor, iTrans;


  ptFrame = (tOptoFrame *) pvSrcBuffer;
  for( iFrame = 0; iFrame < nFrames; iFrame++ ) {
    for (iSensor = 0; iSensor < m_nSensorsToWrite; iSensor++){

      if(iSensor == iSensorIdx){
        m_CalcTime(ptFrame->iFrameIdx, pdTimeStamps++);
        iTrans = m_atSensorState[iSensor].iTransformIdx;
        m_TransformCoordinates( iTrans, &ptFrame->tfCoord, pdCoordinates++); // coordinates
        ZeroMemory(pdVelocities++, sizeof(tdXYZ));
      }
      ptFrame++;
    }
  }

  return 0;
}
Ejemplo n.º 2
0
//===========================================================================
int COptoTrack::ParseBuffer(int nFrames,
                            void * pvSrcBuffer,
                            double * pdTimeStamps, 
                            tdXYZ * pdCoordinates,
                            tdXYZ * pdVelocities  ){

  tOptoFrame * ptFrame;
  int iFrame, iSensor, iTrans;


  ptFrame = (tOptoFrame *) pvSrcBuffer;
  for( iFrame = 0; iFrame < nFrames; iFrame++ ) {
    m_CalcTime(ptFrame->iFrameIdx, pdTimeStamps++);
    for (iSensor = 0; iSensor < m_nSensorsToWrite; iSensor++){
      iTrans = m_atSensorState[iSensor].iTransformIdx;
      m_TransformCoordinates( iTrans, &ptFrame->tfCoord, pdCoordinates++);  // coordinates 
      // Skip angles, we don't have them in Optotrack
      ZeroMemory(pdCoordinates++, sizeof(tdXYZ));  
      // Skip velocities, not implemented yet
      ZeroMemory(pdVelocities++, sizeof(tdXYZ));
      ptFrame++;
    }
  }

  return 0;
}