43 start = this->mapToSphere(point);
53 const Vector end = this->mapToSphere(point);
60 q[3] =
dot(start, end);
76 const Vector p(2.f *
float(point.
x) / size.
x - 1.f, 1.f - 2.f *
float(point.
y) / size.
y, 0._f);
79 if (lengthSqr > 1.f) {
Three-dimensional affine matrix.
INLINE bool isReal(const AntisymmetricTensor &t)
#define SPH_ASSERT(x,...)
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
INLINE T sqrt(const T f)
Return a squared root of a value.
#define NAMESPACE_SPH_END
INLINE Float getSqrLength(const Vector &v)
INLINE BasicVector< float > cross(const BasicVector< float > &v1, const BasicVector< float > &v2)
Cross product between two vectors.
BasicVector< Float > Vector
INLINE float dot(const BasicVector< float > &v1, const BasicVector< float > &v2)
Make sure the vector is trivially constructible and destructible, needed for fast initialization of a...
static AffineMatrix identity()
INLINE AffineMatrix & translate(const Vector &t)
Helper object providing rotation matrix based on mouse drag.
ArcBall(const Pixel size)
void resize(const Pixel newSize)
void click(const Pixel point)
Called on mouse click, starting the rotation.
AffineMatrix drag(const Pixel point, const Vector &pivot)
Called when mouse moves, rotating the object.
Quaternion representing an axis of rotation and a (half of) rotation angle.
AffineMatrix convert() const
Converts the quaternion into a rotation matrix.
Simple 2D vector with integer coordinates. Provides conversion from and to wxPoint.