// __author__ = Juan Carlos De Abreu (jcabreur@gmail.com)

#include "translate_node.h"
#include "../../../Includes/OpenGL.h"

BEGIN_TEG_NAMESPACE();

TranslateNode::TranslateNode() : ITransformationNode(TRANSLATE_NODE, 0, 0, 0) { }

TranslateNode::TranslateNode(float x, float y, float z)
    : ITransformationNode(TRANSLATE_NODE, x, y, z) { }

TranslateNode::~TranslateNode() { }

void TranslateNode::apply() {
  // Do the translate transformation with the graphics API active.
  glTranslatef(x_, y_, z_);
}

SmartPointer<ISceneNode> TranslateNode::copy() {
  // Create a new instance of TranslateNode with the same values.
  return SmartPointer<ISceneNode>(new TranslateNode(x_, y_, z_));
}

END_TEG_NAMESPACE();
