示例#1
0
void Flock::updateData()
{
    if ( isActive() )
    {
        swapPositionBuffers();
    }
}
void SimSetablePosition::setData(const std::vector<PositionData>& posDataVec)
{
   mPos.setTime();   // Set the time
   addPositionSample(posDataVec);   

   swapPositionBuffers(); // Swap the buffers
}
示例#3
0
void IntersenseAPI::updateData()
{
   if (isActive())
   {
      swapDigitalBuffers();
      swapAnalogBuffers();
      swapPositionBuffers();
   }
}
示例#4
0
void DTrack::updateData()
{

	// swap buffered data:

	if(thrRunning){
		swapPositionBuffers();
		swapDigitalBuffers();
		swapAnalogBuffers();
	}
}
示例#5
0
void Vrpn::updateData()
{
   // Sample the data from the device.
   // NOTE: This is done here because the readLoop is asyncronous and
   //       if we place it there we get very large buffer sizes.
   sample();
   
   // Swap it
   swapPositionBuffers();
   swapDigitalBuffers();
   swapAnalogBuffers();
}
void SimSetablePosition::setData(const PositionData& posData)
{
   std::vector<PositionData> pos_data_vec;
   pos_data_vec.push_back(posData);

   mPos.setTime();   // Set the time
   addPositionSample(pos_data_vec);   

   swapPositionBuffers(); // Swap the buffers

   //vprDEBUG(gadgetDBG_INPUT_MGR, vprDBG_DETAILED_LVL)
   //   << "[SimSetablePosition::setData()] "
   //   << *(const_cast<PositionData*>(&pos_data)->getPosition()) << std::endl
   //   << vprDEBUG_FLUSH;
}
 /**
  * Updates to the sampled data.
  *
  * @pre None.
  * @post Most recent value is copied over to temp area
  */
 void TrackdSensor::updateData()
 {
    vprASSERT(mTrackdSensors != NULL && "Make sure that trackd sensors has been initialized");
    vprASSERT((unsigned)mTrackdSensors->numSensors() <= mCurSensorValues.size());

    for(int i=0;i<mTrackdSensors->numSensors();i++)
    {
       mCurSensorValues[i].mPosData = mTrackdSensors->getSensorPos(i);
       mCurSensorValues[i].setTime();
    }

    // Update the data buffer
    addPositionSample(mCurSensorValues);
    swapPositionBuffers();
 }
示例#8
0
// Update to the sampled data.
void MotionStar::updateData()
{
   // If the device is not active, we cannot update the data.
   if ( isActive() == false )
   {
      vprDEBUG(vprDBG_ALL, vprDBG_CRITICAL_LVL)
         << clrSetNORM(clrRED) << "MotionStar ("
         << getAddressName()
         << ") not active in updateData()\n" << clrRESET
         << vprDEBUG_FLUSH;
   }
   // Otherwise, go through with the update.
   else
   {
      swapPositionBuffers();
   }
}
示例#9
0
bool P5GloveWrapper::sample()
{
    P5GloveStandalone::Record rec;
    bool sample_read = mGlove->readRecordsFromHardware(rec);

    if ( sample_read )
    {
// Furst, we set the flexion of the gloves
        mAnalogP5[0] = rec.thumb;     // Thumb (0.0 - 1.0)
        mAnalogP5[1] = rec.index;     // Index
        mAnalogP5[2] = rec.middle;    // Middle
        mAnalogP5[3] = rec.ring;     // Ring
        mAnalogP5[4] = rec.pinky;    // Pinky
        addAnalogSample(mAnalogP5);
        swapAnalogBuffers();

// Then, we define the buttons of the glove
        mDigitalP5[0] = static_cast<DigitalState::State>(rec.buttonA);
        mDigitalP5[1] = static_cast<DigitalState::State>(rec.buttonB);
        mDigitalP5[2] = static_cast<DigitalState::State>(rec.buttonC);
        addDigitalSample(mDigitalP5);
        swapDigitalBuffers();

// Finally, we set the position of the glove ...
        const gmtl::AxisAnglef rotation(rec.rotationAngle, rec.rotationAxis[0],
                                        rec.rotationAxis[1],
                                        rec.rotationAxis[2]);
        const gmtl::Vec3f translation(static_cast<float>(rec.position[0]),
                                      static_cast<float>(rec.position[1]),
                                      static_cast<float>(rec.position[2]));
        gmtl::Matrix44f position = gmtl::makeTrans<gmtl::Matrix44f>(translation);
        position = position * gmtl::make<gmtl::Matrix44f>(rotation);
        mPositionP5[0].setValue(position);
        addPositionSample(mPositionP5);
        swapPositionBuffers();
    }

    return true;
}
示例#10
0
void ThreeDMouse::updateData()
{
   swapPositionBuffers();
}
示例#11
0
void P5GloveWrapper::updateData()
{
    swapAnalogBuffers();
    swapDigitalBuffers();
    swapPositionBuffers();
}