Example #1
0
	void Transform::Translate(Vector a_Translation, Space a_RelativeTo)
	{
		switch (a_RelativeTo)
		{
		case Space::World:
			m_Position += a_Translation;
			break;
		case Space::Local:
			XMVECTOR translationVector(a_Translation.AsXMVECTOR());
			XMVECTOR rotationVector(m_Rotation.AsXMVECTOR());
			m_Position += Vector(XMVector3Rotate(translationVector, rotationVector));
			break;
		}
	}
Example #2
0
	void Transform::Rotate(Vector a_Rotation)
	{
		XMVECTOR rotationVector1(m_Rotation.AsXMVECTOR());
		XMVECTOR rotationVector2(a_Rotation.AsXMVECTOR());
		m_Rotation = Vector(XMQuaternionMultiply(rotationVector1, rotationVector2));
	}