initial commit

This commit is contained in:
cirdan
2008-01-16 11:45:17 +00:00
commit 8f17a3a819
1068 changed files with 384278 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
#ifndef BLUECORE_TRANSFORMATION_H
#define BLUECORE_TRANSFORMATION_H
#include "Quaternion.h"
#include "Vector.h"
namespace BlueCore
{
template<class T> class TransformationTemplate
{
public:
QuaternionTemplate<T> rotation;
Vector3Template<T> translation;
TransformationTemplate()
{
}
template<class S> TransformationTemplate(
const QuaternionTemplate<S> &rot) :
rotation(rot)
{
}
template<class S> TransformationTemplate(
const Vector3Template<S> &trans) :
translation(trans)
{
}
template<class R, class S> TransformationTemplate(
const QuaternionTemplate<S> &rot,
const Vector3Template<S> &trans) :
rotation(rot), translation(trans)
{
}
template<class S> Vector3Template<T> transform(const Vector3Template<S> &v)
{
return rotation.apply(v) + translation;
}
};
typedef TransformationTemplate<float> TransformationFloat;
typedef TransformationTemplate<double> TransformationDouble;
typedef TransformationTemplate<Scalar> Transformation;
} // namespace BlueCore
#endif /*TRANSFORMATION_H_*/