#include "CPhysicsUpVector.h"

/// Empty constructor for the joint.
CPhysicsUpVector::CPhysicsUpVector()
{

}

/// The destructor is also empty as the joint destruction
//! is handled by the IPhysicsJoint base class.
CPhysicsUpVector::~CPhysicsUpVector()
{

}

/// This function initializes the up vector joint.
void CPhysicsUpVector::init(NewtonWorld* world, SPhysicsUpVector* upVector)
{
	m_world = world;

	m_joint = NewtonConstraintCreateUpVector(m_world, &upVector->pin.X, upVector->body->getBody());
}

/// This function sets the pin of the up vector joint.
void CPhysicsUpVector::setPin(vector3df pin)
{
	NewtonUpVectorSetPin(m_joint, &pin.X);
}

/// This function returns the pin of the up vector joint.
vector3df CPhysicsUpVector::getPin()
{
	vector3df pin;
	NewtonUpVectorGetPin(m_joint, &pin.X);
	return pin;
}