3#ifndef INCLUDE_DEPRECATED_LEGACY_VECTOR_MATH
4 #error LegacyVectorMath.h is deprecated. Please dont use unless necessary
71COMMON_API void rayBoxProject(std::vector<double> rayStart, std::vector<double> rayDir,
const double boxExts[6],
double results[2]);
94COMMON_API void squad(
float quat1[4],
float quat2[4],
float s1[4],
float s2[4],
float t,
float result[4]);
100inline void vset(
float *a,
const float x,
const float y,
const float z)
106inline void vset(
double *a,
const double x,
const double y,
const double z)
112inline float vdot(
const float *a,
const float *b) {
return (a[0] * b[0] + a[1] * b[1] + a[2] * b[2]); }
113inline float vdot(
const float *a,
const double *b) {
return (a[0] * b[0] + a[1] * b[1] + a[2] * b[2]); }
114inline double vdot(
const double *a,
const double *b) {
return (a[0] * b[0] + a[1] * b[1] + a[2] * b[2]); }
116inline double vlength(
const double *a) {
return sqrt(
vdot(a, a)); }
117inline double vlength(
const std::vector<double> a) {
return sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2]); }
118inline float vdist(
const float *a,
const float *b) {
return (sqrt((a[0] - b[0]) * (a[0] - b[0]) + (a[1] - b[1]) * (a[1] - b[1]) + (a[2] - b[2]) * (a[2] - b[2]))); }
119inline double vdist(
const double *a,
const double *b) {
return (sqrt((a[0] - b[0]) * (a[0] - b[0]) + (a[1] - b[1]) * (a[1] - b[1]) + (a[2] - b[2]) * (a[2] - b[2]))); }
123inline void vcopy(
const float *a,
float *b)
129inline void vcopy(
const double *a,
double *b)
135inline void vsub(
const double *a,
const float *b,
float *c)
141inline void vsub(
const float *a,
const float *b,
float *c)
147inline void vsub(
const double *a,
const double *b,
double *c)
153inline void vsub(
const double *a,
const std::vector<double> b,
double *c)
159inline void vsub(
const std::vector<double> &a,
const std::vector<double> &b,
double *c)
165inline void vadd(
const float *a,
const float *b,
float *c)
171inline void vadd(
const double *a,
const double *b,
double *c)
177inline void vzero(
float *a) { a[0] = a[1] = a[2] = 0.f; }
178inline void vzero(
double *a) { a[0] = a[1] = a[2] = 0.; }
179inline void qset(
float *a,
float x,
float y,
float z,
float w)
186inline void qcopy(
const float *a,
float *b)
193inline void qcopy(
const double *a,
double *b)
202 a[0] = a[1] = a[2] = 0;
207 a[0] = a[1] = a[2] = 0.;
210inline void qadd(
const float *a,
const float *b,
float *c) {
vadd(a, b, c), c[3] = a[3] + b[3]; }
211inline float qlength(
const float q[4]) {
return sqrt(q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3]); }
220double det2x2(
double a,
double b,
double c,
double d);
221double det3x3(
double a1,
double a2,
double a3,
double b1,
double b2,
double b3,
double c1,
double c2,
double c3);
COMMON_API size_t nextPowerOf2(size_t n)
COMMON_API void squad(float quat1[4], float quat2[4], float s1[4], float s2[4], float t, float result[4])
COMMON_API void quat2View(float quat[4], float vdir[3], float upvec[3])
double det2x2(double a, double b, double c, double d)
float vdot(const float *a, const float *b)
COMMON_API void vtransform(const float *v, float *mat, float *vt)
COMMON_API void CalcRotation(float *q, float newX, float newY, float oldX, float oldY, float ballsize)
COMMON_API void getRotAngles(double *theta, double *phi, double *psi, const double *matrix)
void vcopy(const float *a, float *b)
COMMON_API void qmult(const float *q1, const float *q2, float *dest)
COMMON_API void rayBoxProject(std::vector< double > rayStart, std::vector< double > rayDir, const double boxExts[6], double results[2])
COMMON_API void getAxisRotation(int axis, double rotation, double *matrix)
void adjoint(const float *in, float *out)
COMMON_API void vtransform3(const float *v, float *mat, float *vt)
COMMON_API bool pointOnRight(double *pt1, double *pt2, const double *testPt)
COMMON_API void qnormal(float *q)
int matrix4x4_inverse(const float *in, float *out)
COMMON_API int minvert(const float *mat, float *result)
COMMON_API void vtransform4(const float *v, float *mat, float *vt)
COMMON_API void vreflect(const float *in, const float *mirror, float *out)
COMMON_API void qinv(const float q1[4], float q2[4])
void vset(float *a, const float x, const float y, const float z)
COMMON_API bool powerOf2(size_t n)
COMMON_API void makeModelviewMatrix(float *vpos, float *vdir, float *upvec, float *matrix)
void vadd(const float *a, const float *b, float *c)
COMMON_API void rotmatrix2q(float *m, float *q)
COMMON_API void mmult33(const double *m1, const double *m2, double *result)
COMMON_API float ProjectToSphere(float r, float x, float y)
double det3x3(double a1, double a2, double a3, double b1, double b2, double b3, double c1, double c2, double c3)
COMMON_API void mcopy(float *m1, float *m2)
void qadd(const float *a, const float *b, float *c)
COMMON_API int rayBoxIntersect(const float rayStart[3], const float rayDir[3], const float boxExts[6], float results[2])
COMMON_API void computeGradientData(int dim[3], int numChan, unsigned char *volume, unsigned char *gradient)
COMMON_API void vcross(const float *v1, const float *v2, float *cross)
double det4x4(const float m[16])
float qlength(const float q[4])
void qcopy(const float *a, float *b)
COMMON_API void vtransform3t(const float *v, float *mat, float *vt)
float vdist(const float *a, const float *b)
COMMON_API void getRotationMatrix(double theta, double phi, double psi, double *matrix)
COMMON_API void views2ImagQuats(float vdir1[3], float upvec1[3], float vdir2[3], float upvec2[3], float q1[3], float q2[3])
COMMON_API void rvec2q(const float rvec[3], float radians, float q[4])
COMMON_API void qmatrix(const float *q, float *m)
COMMON_API void vmult(const float *v, float s, float *w)
COMMON_API void view2Quat(float vdir[3], float upvec[3], float q[4])
COMMON_API void slerp(float quat1[4], float quat2[4], float t, float result[4])
void qset(float *a, float x, float y, float z, float w)
COMMON_API void mmultt33(const double *m1Trans, const double *m2, double *result)
COMMON_API void qlog(float quat[4], float lquat[4])
COMMON_API void makeTransMatrix(float *transVec, float *matrix)
COMMON_API float ScalePoint(long pt, long origin, long size)
COMMON_API void qconj(float quat[4], float conj[4])
void matrix4x4_vec3_mult(const float m[16], const float a[4], float b[4])
COMMON_API void imagQuat2View(const float q[3], float vdir[3], float upvec[3])
COMMON_API float getScale(float *rotmatrix)
float vlength(const float *a)
COMMON_API void makeModelviewMatrixD(double *vpos, double *vdir, double *upvec, double *matrix)
COMMON_API void vscale(float *v, float s)
COMMON_API void mmult(float *m1, float *m2, float *prod)
COMMON_API void makeScaleMatrix(const double *scaleVec, double *matrix)
COMMON_API void vhalf(const float *v1, const float *v2, float *half)
void vsub(const double *a, const float *b, float *c)