Beispiel #1
0
void BasicSimulator::updateProjectionData(const float positionScale,
                                          ProjectionPtr leftProj,
                                          ProjectionPtr rightProj)
{
   updateInternalData(positionScale);

   gmtl::Matrix44f camera_pos = getCameraPos();
   gmtl::Vec3f camera_trans = gmtl::makeTrans<gmtl::Vec3f>(camera_pos);

   //mCameraProj->calcViewMatrix(camera_pos);

   // -- Calculate camera (eye) Positions -- //
   vprDEBUG(vprDBG_ALL, vprDBG_HEX_LVL)
      << "[vrj::BasicSimulator::updateProjectionData()] Getting cam position"
      << std::endl << vprDEBUG_FLUSH;
   vprDEBUG(vprDBG_ALL, vprDBG_HEX_LVL) << "CamPos:" << camera_trans
                                        << std::endl << vprDEBUG_FLUSH;

   // Compute location of left and right eyes
   float interocular_dist = mSimViewport->getUser()->getInterocularDistance();
   interocular_dist *= positionScale;               // Scale into correct units
   float eye_offset = interocular_dist / 2.0f;      // Distance to move eye

   // NOTE: Eye coord system is -z forward, x-right, y-up
   const gmtl::Point3f left_eye_pos(
      camera_pos * gmtl::Point3f(-eye_offset, 0.0f, 0.0f)
   );
   const gmtl::Point3f right_eye_pos(
      camera_pos * gmtl::Point3f(eye_offset, 0.0f, 0.0f)
   );

   leftProj->calcViewMatrix(left_eye_pos, positionScale);
   rightProj->calcViewMatrix(right_eye_pos, positionScale);
}
Beispiel #2
0
  void UnitImpl::die()
  {
    index              = 0xFFFF;
    userSelected       = false;
    isAlive            = false;
    wasAlive           = false;
    wasCompleted       = false;
    wasAccessible      = false;
    wasVisible         = false;
    nukeDetected       = false;
    lastType           = UnitTypes::Unknown;
    lastPlayer         = nullptr;
    this->clientInfo.clear();
    this->interfaceEvents.clear();

    updateInternalData();

    //set pointers to null so we don't read information from unit table anymore
    getOriginalRawData = nullptr;

    updateData();
  }