#include <assert.h>
Go to the source code of this file.
Data Structures | |
struct | kmVec3 |
Defines | |
#define | kmScalar float |
Functions | |
kmVec3 * | kmVec3Fill (kmVec3 *pOut, kmScalar x, kmScalar y, kmScalar z) |
kmScalar | kmVec3Length (const kmVec3 *pIn) |
kmScalar | kmVec3LengthSq (const kmVec3 *pIn) |
kmVec3 * | kmVec3Normalize (kmVec3 *pOut, const kmVec3 *pIn) |
kmVec3 * | kmVec3Cross (kmVec3 *pOut, const kmVec3 *pV1, const kmVec3 *pV2) |
kmScalar | kmVec3Dot (const kmVec3 *pV1, const kmVec3 *pV2) |
kmVec3 * | kmVec3Add (kmVec3 *pOut, const kmVec3 *pV1, const kmVec3 *pV2) |
kmVec3 * | kmVec3Subtract (kmVec3 *pOut, const kmVec3 *pV1, const kmVec3 *pV2) |
kmVec3 * | kmVec3Transform (kmVec3 *pOut, const kmVec3 *pV1, const struct kmMat4 *pM) |
kmVec3 * | kmVec3TransformNormal (kmVec3 *pOut, const kmVec3 *pV, const struct kmMat4 *pM) |
kmVec3 * | kmVec3TransformCoord (kmVec3 *pOut, const kmVec3 *pV, const struct kmMat4 *pM) |
kmVec3 * | kmVec3Scale (kmVec3 *pOut, const kmVec3 *pIn, const kmScalar s) |
int | kmVec3AreEqual (const kmVec3 *p1, const kmVec3 *p2) |
kmVec3 * | kmVec3InverseTransform (kmVec3 *pOut, const kmVec3 *pV, const struct kmMat4 *pM) |
kmVec3 * | kmVec3InverseTransformNormal (kmVec3 *pOut, const kmVec3 *pVect, const struct kmMat4 *pM) |
kmVec3 * | kmVec3Assign (kmVec3 *pOut, const kmVec3 *pIn) |
kmVec3 * | kmVec3Zero (kmVec3 *pOut) |
Assigns pIn to pOut. Returns pOut. If pIn and pOut are the same then nothing happens but pOut is still returned
Definition at line 283 of file vec3.c.
References kmVec3::x, kmVec3::y, and kmVec3::z.
Referenced by kmMat4LookAt(), and kmQuaternionRotationBetweenVec3().
Returns the vector passed in set to unit length
Returns a vector perpendicular to 2 other vectors. The result is stored in pOut.
Definition at line 91 of file vec3.c.
References kmVec3::x, kmVec3::y, and kmVec3::z.
Referenced by kmMat4LookAt(), kmPlaneFromPoints(), kmQuaternionMultiplyVec3(), and kmQuaternionRotationBetweenVec3().
Returns a vector perpendicular to 2 other vectors
Returns the cosine of the angle between 2 vectors
Definition at line 110 of file vec3.c.
References kmVec3::x, kmVec3::y, and kmVec3::z.
Referenced by kmPlaneFromPointNormal(), kmPlaneFromPoints(), and kmQuaternionRotationBetweenVec3().
Fill a kmVec3 structure using 3 floating point values The result is store in pOut, returns pOut
Definition at line 42 of file vec3.c.
References kmVec3::x, kmVec3::y, and kmVec3::z.
Referenced by kmGLRotatef(), kazmathxx::Vec3::operator*(), kazmathxx::Vec3::operator+(), kazmathxx::Vec3::operator-(), and kazmathxx::Vec3::operator/().
kmVec3* kmVec3InverseTransformNormal | ( | kmVec3 * | pOut, | |
const kmVec3 * | pVect, | |||
const struct kmMat4 * | pM | |||
) |
kmScalar kmVec3Length | ( | const kmVec3 * | pIn | ) |
Returns the length of the vector
Definition at line 54 of file vec3.c.
References kmSQR(), kmVec3::x, kmVec3::y, and kmVec3::z.
Referenced by kmPlaneNormalize(), and kmVec3Normalize().
kmScalar kmVec3LengthSq | ( | const kmVec3 * | pIn | ) |
Returns the square of the length of the vector
Returns the vector passed in set to unit length the result is stored in pOut.
Definition at line 71 of file vec3.c.
References kmScalar, kmVec3Length(), kmVec3::x, kmVec3::y, and kmVec3::z.
Referenced by kmMat4GetForwardVec3(), kmMat4GetRightVec3(), kmMat4GetUpVec3(), kmMat4LookAt(), kmPlaneFromPoints(), kmPlaneNormalize(), kmQuaternionRotationBetweenVec3(), and kmQuaternionToAxisAngle().
Transforms a 3D vector by a given matrix, projecting the result back into w = 1.
Scales a vector to length s. Does not normalize first, you should do that!
Definition at line 256 of file vec3.c.
References kmVec3::x, kmVec3::y, and kmVec3::z.
Referenced by kmPlaneFromPoints(), and kmQuaternionMultiplyVec3().
Adds 2 vectors and returns the result
Subtracts 2 vectors and returns the result. The result is stored in pOut.
Definition at line 140 of file vec3.c.
References kmVec3::x, kmVec3::y, and kmVec3::z.
Referenced by kmMat4LookAt(), kmPlaneFromPoints(), and kmPlaneIntersectLine().
Subtracts 2 vectors and returns the result