CSC8503_Advanced_Game_Technologies / CSC8503 / CSC8503Common / FixedHeightConstraint.cpp
FixedHeightConstraint.cpp
Raw
#include "FixedHeightConstraint.h"
#include "GameObject.h"
#include "../../Common/Vector3.h"
#include "../../Common/Maths.h"

using namespace NCL;
using namespace CSC8503;

FixedHeightConstraint::FixedHeightConstraint(GameObject* _object, const float heightValue)
{
	object = _object;
	height = heightValue;
}

void FixedHeightConstraint::UpdateConstraint(float dt)
{
	Vector3 position = object->GetTransform().GetPosition();
	position.y = height;
	object->GetTransform().SetPosition(position);
}