/ich/Programmieren/KazadeEngine/NeHeKazmath/kazmath/src/vec2.c File Reference

#include <assert.h>
#include <stdlib.h>
#include "mat4.h"
#include "vec2.h"
#include "utility.h"

Go to the source code of this file.

Functions

kmVec2kmVec2Fill (kmVec2 *pOut, kmScalar x, kmScalar y)
kmScalar kmVec2Length (const kmVec2 *pIn)
 Returns the length of the vector.
kmScalar kmVec2LengthSq (const kmVec2 *pIn)
 Returns the square of the length of the vector.
kmVec2kmVec2Normalize (kmVec2 *pOut, const kmVec2 *pIn)
 Returns the vector passed in set to unit length.
kmVec2kmVec2Add (kmVec2 *pOut, const kmVec2 *pV1, const kmVec2 *pV2)
 Adds 2 vectors and returns the result.
kmScalar kmVec2Dot (const kmVec2 *pV1, const kmVec2 *pV2)
kmVec2kmVec2Subtract (kmVec2 *pOut, const kmVec2 *pV1, const kmVec2 *pV2)
 Subtracts 2 vectors and returns the result.
kmVec2kmVec2Transform (kmVec2 *pOut, const kmVec2 *pV1, const kmMat4 *pM)
kmVec2kmVec2TransformCoord (kmVec2 *pOut, const kmVec2 *pV, const kmMat4 *pM)
kmVec2kmVec2Scale (kmVec2 *pOut, const kmVec2 *pIn, const kmScalar s)
 Scales a vector to length s.
int kmVec2AreEqual (const kmVec2 *p1, const kmVec2 *p2)
 Returns 1 if both vectors are equal.


Function Documentation

kmVec2* kmVec2Add ( kmVec2 pOut,
const kmVec2 pV1,
const kmVec2 pV2 
)

Adds 2 vectors and returns the result.

Definition at line 60 of file vec2.c.

References kmVec2::x, and kmVec2::y.

int kmVec2AreEqual ( const kmVec2 p1,
const kmVec2 p2 
)

Returns 1 if both vectors are equal.

Definition at line 101 of file vec2.c.

References kmEpsilon, kmVec2::x, and kmVec2::y.

kmScalar kmVec2Dot ( const kmVec2 pV1,
const kmVec2 pV2 
)

Definition at line 68 of file vec2.c.

References kmVec2::x, and kmVec2::y.

kmVec2* kmVec2Fill ( kmVec2 pOut,
kmScalar  x,
kmScalar  y 
)

kmScalar kmVec2Length ( const kmVec2 pIn  ) 

Returns the length of the vector.

Definition at line 40 of file vec2.c.

References kmSQR(), kmVec2::x, and kmVec2::y.

Referenced by kmVec2Normalize().

kmScalar kmVec2LengthSq ( const kmVec2 pIn  ) 

Returns the square of the length of the vector.

Definition at line 45 of file vec2.c.

References kmSQR(), kmVec2::x, and kmVec2::y.

kmVec2* kmVec2Normalize ( kmVec2 pOut,
const kmVec2 pIn 
)

Returns the vector passed in set to unit length.

Definition at line 50 of file vec2.c.

References kmScalar, kmVec2Length(), kmVec2::x, and kmVec2::y.

kmVec2* kmVec2Scale ( kmVec2 pOut,
const kmVec2 pIn,
const kmScalar  s 
)

Scales a vector to length s.

Definition at line 93 of file vec2.c.

References kmVec2::x, and kmVec2::y.

kmVec2* kmVec2Subtract ( kmVec2 pOut,
const kmVec2 pV1,
const kmVec2 pV2 
)

Subtracts 2 vectors and returns the result.

Returns the Dot product which is the cosine of the angle between the two vectors multiplied by their lengths

Definition at line 73 of file vec2.c.

References kmVec2::x, and kmVec2::y.

kmVec2* kmVec2Transform ( kmVec2 pOut,
const kmVec2 pV1,
const kmMat4 pM 
)

Definition at line 81 of file vec2.c.

kmVec2* kmVec2TransformCoord ( kmVec2 pOut,
const kmVec2 pV,
const kmMat4 pM 
)

Definition at line 87 of file vec2.c.


Generated on Mon Dec 29 18:40:11 2008 for Kazmath by  doxygen 1.5.6