]>
git.bts.cx Git - benzene.git/blob - src/bz/math/vector.h
1 #ifndef BZ_MATH_VECTOR_H
2 #define BZ_MATH_VECTOR_H
12 typedef struct BZVector BZVector
;
14 static inline BZVector
*bzVectorSet(BZVector
*vectorOut
, float x
, float y
) {
20 extern void bzVectorCopy(BZVector
*vectorOut
, const BZVector
*vector
);
22 static inline BZVector
bzVectorMake(float x
, float y
) {
30 extern void bzVectorMakeAngle(BZVector
*vectorOut
, float angle
);
32 extern void bzVectorInverse(BZVector
*vectorOut
, const BZVector
*vector
);
33 extern void bzVectorTangent(BZVector
*vectorOut
, const BZVector
*vector
);
35 extern void bzVectorAdd(BZVector
*vectorOut
, const BZVector
*vector1
, const BZVector
*vector2
);
36 extern void bzVectorSubtract(BZVector
*vectorOut
, const BZVector
*vector1
, const BZVector
*vector2
);
38 extern void bzVectorScale(BZVector
*vectorOut
, const BZVector
*vector
, float scale
);
39 extern void bzVectorNormalized(BZVector
*vectorOut
, const BZVector
*vector
);
41 extern float bzVectorMagnitude(const BZVector
*vector
);
42 extern float bzVectorMagnitudeSquared(const BZVector
*vector
);
43 extern float bzVectorDot(const BZVector
*vector1
, const BZVector
*vector2
);
45 extern float bzVectorCross(const BZVector
*vector1
, const BZVector
*vector2
);
47 extern void bzVectorLerp(BZVector
*vectorOut
, const BZVector
*vector1
, const BZVector
*vector2
, float t
);