// Filename: input/device/isotrak/Receiver.cpp
// Author: Jorge Bernadas (JB)
// Date of Creation: 11/02/2007
// Version: 1.0
//#include "base/General.h"
//#include "math/General-inl.h"
#include "Receiver.h"

BEGIN_TEG_NAMESPACE();
//BEGIN_ENGINE_NAMESPACE();

// initialize receiver in origin and pointing to (0,0,1)
Receiver::Receiver() : position_(0.0f, 0.0f, 0.0f),
                       orientation_(0.0f, 0.0f, 0.0f),
                       buttonPressed_(false) {
}

Receiver::~Receiver() {
}

Vec3f Receiver::direction() const {
  // calculate the direction using geographic spherical coordinates
  const float dx = sin(90 - orientation_.y) * cos(orientation_.x);
  const float dy = sin(90 - orientation_.y) * sin(orientation_.x);
  const float dz = cos(90 - orientation_.y);
  return Vec3f(dx, dy, dz);
}

//END_ENGINE_NAMESPACE();
END_TEG_NAMESPACE();