Alpha Engine: AEVec2.h File Reference

AlphaEngine

AEVec2.h File Reference

Header file for the 2D vector library. More...

#include "AEExport.h" #include "AETypes.h"

Go to the source code of this file.

Classes

struct  AEVec2
 

Typedefs

typedef struct AEVec2 AEVec2
 

Functions

s32 AEVec2Test (s32 i1, s32 i2)
 
void AEVec2Zero (AEVec2 *pResult)
 Set pResult to zero. More...
 
void AEVec2Set (AEVec2 *pResult, f32 x, f32 y)
 Set pResult to (x, y). More...
 
void AEVec2Neg (AEVec2 *pResult, AEVec2 *pVec0)
 Set pResult to the negative of pVec0. More...
 
void AEVec2Add (AEVec2 *pResult, AEVec2 *pVec0, AEVec2 *pVec1)
 Set pResult to (pVec0 + pVec1). More...
 
void AEVec2Sub (AEVec2 *pResult, AEVec2 *pVec0, AEVec2 *pVec1)
 Set pResult to (pVec0 - pVec1). More...
 
void AEVec2Normalize (AEVec2 *pResult, AEVec2 *pVec0)
 Set pResult to the normalized of pVec0. More...
 
void AEVec2Scale (AEVec2 *pResult, AEVec2 *pVec0, f32 s)
 Set pResult to (pVec0 * s). More...
 
void AEVec2ScaleAdd (AEVec2 *pResult, AEVec2 *pVec0, AEVec2 *pVec1, f32 s)
 Set pResult to ((pVec0 + pVec1) * s). More...
 
void AEVec2ScaleSub (AEVec2 *pResult, AEVec2 *pVec0, AEVec2 *pVec1, f32 s)
 Set pResult to ((pVec0 - pVec1) * s). More...
 
void AEVec2Project (AEVec2 *pResult, AEVec2 *pVec0, AEVec2 *pVec1)
 Set pResult to the projection of pVec1 onto pVec0. More...
 
void AEVec2ProjectPerp (AEVec2 *pResult, AEVec2 *pVec0, AEVec2 *pVec1)
 Set pResult to the perpendicular projection (rejection) of pVec0 onto pVec1. More...
 
void AEVec2Lerp (AEVec2 *pResult, AEVec2 *pVec0, AEVec2 *pVec1, f32 t)
 Set pResult to the linear interpolation between pVec0 and pVec1 at time interval t. More...
 
f32 AEVec2Length (AEVec2 *pVec0)
 Calculate the length of pVec0. More...
 
f32 AEVec2SquareLength (AEVec2 *pVec0)
 Calculate the squared length of pVec0. More...
 
f32 AEVec2Distance (AEVec2 *pVec0, AEVec2 *pVec1)
 Calculate the distance between 2 points. More...
 
f32 AEVec2SquareDistance (AEVec2 *pVec0, AEVec2 *pVec1)
 Calculate the squared distance between 2 points. More...
 
f32 AEVec2DotProduct (AEVec2 *pVec0, AEVec2 *pVec1)
 Calculate the dot product of 2 vectors. More...
 
f32 AEVec2CrossProductMag (AEVec2 *pVec0, AEVec2 *pVec1)
 Calculate the magnitude of the cross product of 2 vectors. More...
 
void AEVec2FromAngle (AEVec2 *pResult, f32 angle)
 Set pResult to unit vector of angle. More...
 

Detailed Description

Header file for the 2D vector library.

Project: Alpha Engine
Author
Sun Tjen Fam
Date
January 31, 2008
Copyright
Copyright (C) 2013 DigiPen Institute of Technology. Reproduction or disclosure of this file or its contents without the prior written consent of DigiPen Institute of Technology is prohibited.

Definition in file AEVec2.h.

Typedef Documentation

typedef struct AEVec2 AEVec2

Function Documentation

void AEVec2Add ( AEVec2 pResult,
AEVec2 pVec0,
AEVec2 pVec1 
)

Set pResult to (pVec0 + pVec1).

Parameters
[out]pResultPointer to AEVec2 to be set.
[in]pVec0Pointer to AEVec2 for input.
[in]pVec1Pointer to AEVec2 for input.
Return values
voidNo return.
f32 AEVec2CrossProductMag ( AEVec2 pVec0,
AEVec2 pVec1 
)

Calculate the magnitude of the cross product of 2 vectors.

Parameters
[in]pVec0Pointer to AEVec2 of first vector.
[in]pVec1Pointer to AEVec2 of second vector.
Return values
f32Returns the magnitude of the cross product of pVec0 and pVec1.
f32 AEVec2Distance ( AEVec2 pVec0,
AEVec2 pVec1 
)

Calculate the distance between 2 points.

Parameters
[in]pVec0Pointer to AEVec2 of first point.
[in]pVec1Pointer to AEVec2 of second point.
Return values
f32Returns the distance between pVec0 and pVec1.
f32 AEVec2DotProduct ( AEVec2 pVec0,
AEVec2 pVec1 
)

Calculate the dot product of 2 vectors.

Parameters
[in]pVec0Pointer to AEVec2 of first vector.
[in]pVec1Pointer to AEVec2 of second vector.
Return values
f32Returns the dot product of pVec0 and pVec1.
void AEVec2FromAngle ( AEVec2 pResult,
f32  angle 
)

Set pResult to unit vector of angle.

Parameters
[out]pResultPointer to AEVec2 to be set.
[in]angleAngle of the unit vector.
Return values
voidNo return.
f32 AEVec2Length ( AEVec2 pVec0)

Calculate the length of pVec0.

Parameters
[in]pVec0Pointer to AEVec2 for input
Return values
f32Returns the length of pVec0.
void AEVec2Lerp ( AEVec2 pResult,
AEVec2 pVec0,
AEVec2 pVec1,
f32  t 
)

Set pResult to the linear interpolation between pVec0 and pVec1 at time interval t.

Warning
t should be between 0.0f to 1.0f.
Parameters
[out]pResultPointer to AEVec2 to be set.
[in]pVec0Pointer to AEVec2 for input.
[in]pVec1Pointer to AEVec2 for input.
[in]tThe time interval to calculate the linear interpolation at. At t = 0.0f, the result will be pVec0. At t = 1.0f, the result will be pVec1.
Return values
voidNo return.
void AEVec2Neg ( AEVec2 pResult,
AEVec2 pVec0 
)

Set pResult to the negative of pVec0.

Parameters
[out]pResultPointer to AEVec2 to be set.
[in]pVec0Pointer to AEVec2 for input.
Return values
voidNo return.
void AEVec2Normalize ( AEVec2 pResult,
AEVec2 pVec0 
)

Set pResult to the normalized of pVec0.

Parameters
[out]pResultPointer to AEVec2 to be set.
[in]pVec0Pointer to AEVec2 for input.
Return values
voidNo return.
void AEVec2Project ( AEVec2 pResult,
AEVec2 pVec0,
AEVec2 pVec1 
)

Set pResult to the projection of pVec1 onto pVec0.

Parameters
[out]pResultPointer to AEVec2 to be set.
[in]pVec0Pointer to AEVec2 for input.
[in]pVec1Pointer to AEVec2 for input.
Return values
voidNo return.
void AEVec2ProjectPerp ( AEVec2 pResult,
AEVec2 pVec0,
AEVec2 pVec1 
)

Set pResult to the perpendicular projection (rejection) of pVec0 onto pVec1.

Parameters
[out]pResultPointer to AEVec2 to be set.
[in]pVec0Pointer to AEVec2 for input.
[in]pVec1Pointer to AEVec2 for input.
Return values
voidNo return.
void AEVec2Scale ( AEVec2 pResult,
AEVec2 pVec0,
f32  s 
)

Set pResult to (pVec0 * s).

Parameters
[out]pResultPointer to AEVec2 to be set.
[in]pVec0Pointer to AEVec2 for input.
[in]sValue to scale with.
Return values
voidNo return.
void AEVec2ScaleAdd ( AEVec2 pResult,
AEVec2 pVec0,
AEVec2 pVec1,
f32  s 
)

Set pResult to ((pVec0 + pVec1) * s).

Warning
Purpose unclear or error in implementation.
Parameters
[out]pResultPointer to AEVec2 to be set.
[in]pVec0Pointer to AEVec2 for input.
[in]pVec1Pointer to AEVec2 for input.
[in]sValue to scale with.
Return values
voidNo return.
void AEVec2ScaleSub ( AEVec2 pResult,
AEVec2 pVec0,
AEVec2 pVec1,
f32  s 
)

Set pResult to ((pVec0 - pVec1) * s).

Warning
Purpose unclear or error in implementation.
Parameters
[out]pResultPointer to AEVec2 to be set.
[in]pVec0Pointer to AEVec2 for input.
[in]pVec1Pointer to AEVec2 for input.
[in]sValue to scale with.
Return values
voidNo return.
void AEVec2Set ( AEVec2 pResult,
f32  x,
f32  y 
)

Set pResult to (x, y).

Parameters
[out]pResultPointer to AEVec2 to be set.
[in]xX value to set with.
[in]yY value to set with.
Return values
voidNo return.
f32 AEVec2SquareDistance ( AEVec2 pVec0,
AEVec2 pVec1 
)

Calculate the squared distance between 2 points.

Parameters
[in]pVec0Pointer to AEVec2 of first point.
[in]pVec1Pointer to AEVec2 of second point.
Return values
f32Returns the squared distance between pVec0 and pVec1.
f32 AEVec2SquareLength ( AEVec2 pVec0)

Calculate the squared length of pVec0.

Parameters
[in]pVec0Pointer to AEVec2 for input
Return values
f32Returns the squared length of pVec0.
void AEVec2Sub ( AEVec2 pResult,
AEVec2 pVec0,
AEVec2 pVec1 
)

Set pResult to (pVec0 - pVec1).

Parameters
[out]pResultPointer to AEVec2 to be set.
[in]pVec0Pointer to AEVec2 for input.
[in]pVec1Pointer to AEVec2 for input.
Return values
voidNo return.
s32 AEVec2Test ( s32  i1,
s32  i2 
)
void AEVec2Zero ( AEVec2 pResult)

Set pResult to zero.

Parameters
[out]pResultPointer to AEVec2 to be set.
Return values
voidNo return.
Generated on Sat Jan 4 2014 02:06:22 for Alpha Engine by   doxygen 1.8.5