// Author: Juan Carlos De Abreu (jcabreur@gmail.com)

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

BEGIN_TEG_NAMESPACE();

ScaleNode::ScaleNode() : ITransformationNode(SCALE_NODE, 1, 1, 1) {}

ScaleNode::ScaleNode(float x, float y, float z)
    : ITransformationNode(SCALE_NODE, x, y, z) {}

ScaleNode::~ScaleNode() {}

void ScaleNode::apply() {
  // Do the scale transformation with the graphics API active.
  glScalef(x_, y_, z_);
}

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

END_TEG_NAMESPACE();
