geVec3d

Types:

geVec3d

typedef struct {
    geFloat X, Y, Z;
} geVec3d;


Functions:

GENESISAPI void GENESISCC  geVec3d_Add(const geVec3d *V1, const geVec3d *V2,  geVec3d *VSum);

This function adds V1 to V2 returning the result in VSum.

Returns: nothing.


GENESISAPI void GENESISCC  geVec3d_AddScaled(const geVec3d *V1, const geVec3d *V2, geFloat Scale, geVec3d *V1PlusV2Scaled);

This function calculates V1 + V2*Scale returning the result in V1PlusV2Scaled.

Returns: nothing.


GENESISAPI void GENESISCC  geVec3d_Clear(geVec3d *V);

This function clears all the elements of V to 0.0f.

Returns: nothing.


GENESISAPI geBoolean GENESISCC geVec3d_Compare(const geVec3d *V1, const geVec3d *V2, geFloat tolerance);

This function compares V1 to V2, if the difference between any of the elements is more than tolerance, then it returns GE_FALSE, otherwise GE_TRUE.

Returns: the result.


GENESISAPI void GENESISCC  geVec3d_Copy(const geVec3d *Vsrc, geVec3d *Vdst);

This function copies Vsrc to Vdst.

Returns: nothing.


GENESISAPI void GENESISCC  geVec3d_CrossProduct(const geVec3d *V1, const geVec3d *V2, geVec3d *VResult);

This function calculates the cross product of the two vectors V1 and V2 returning the result in VResult.  The cross product of two vectors can be thought of as the vector that is perpendicular to each with a length equal to the area of the parallelogram formed by the two vectors.

Returns: nothing.


GENESISAPI geFloat GENESISCC  geVec3d_DistanceBetween(const geVec3d *V1, const geVec3d *V2);

This function calculates the distance between the two points represented by V1 and V2.

Returns: the result.

Notes:
    from VEC3D.H: returns length of V1-V2


GENESISAPI geFloat GENESISCC geVec3d_DotProduct(const geVec3d *V1, const geVec3d *V2);

This function calculates the Dot Product of the two vectors returning the result.

Returns: the result.


GENESISAPI void GENESISCC  geVec3d_Get(const geVec3d *V, geFloat *X, geFloat *Y, geFloat *Z);

This function returns the components of the specified vector.

Returns: nothing.


GENESISAPI geFloat GENESISCC   geVec3d_GetElement(geVec3d *V, int Index);

This function returns the specified (0,1,2) element of the vector V.

Returns: the specified element.
 

GENESISAPI void GENESISCC  geVec3d_Inverse(geVec3d *V);
This function calculates the inverse of the given vector, replacing the original values.

Returns: nothing.


GENESISAPI geBoolean GENESISCC  geVec3d_IsNormalized(const geVec3d *V);

This function checks whether the vector V is normalized.  In other words whether its length is equal to 1.0f (within a certain tolerance).

Returns: GE_TRUE if the vector is normalized, GE_FALSE otherwise.


GENESISAPI geBoolean GENESISCC geVec3d_IsValid(const geVec3d *V);

This function checks each of the elements of V to assure that they are real.

Returns: GE_TRUE if the vector is valid, GE_FALSE otherwise.


GENESISAPI geFloat GENESISCC geVec3d_Length(const geVec3d *V1);

This function calculates the length of the given vector.

Returns: the result.


GENESISAPI geFloat GENESISCC geVec3d_LengthSquared(const geVec3d *V1);

This function calculates the length of the given vector and squares it.  Note that this function should be used whenever the square of the length of a vector is needed as it is actually faster than calculating the length of the vector, much less doing so then squaring it.

Returns: the result.


GENESISAPI void GENESISCC  geVec3d_MA(geVec3d *V1, geFloat Scale, const geVec3d *V2, geVec3d *V1PlusV2Scaled);

This function produces the same result as  geVec3d_AddScaled.

Returns: nothing


GENESISAPI geFloat GENESISCC geVec3d_Normalize(geVec3d *V1);

This function normalizes the vector V1 and returns its original length.  Note that the vector value is changed.

Returns: the original length of the vector.


GENESISAPI void GENESISCC  geVec3d_Scale(const geVec3d *VSrc, geFloat Scale, geVec3d *VDst);

This function calculates VSrc * Scale and returns the result in VDst.

Returns: nothing.


GENESISAPI void GENESISCC  geVec3d_Set(geVec3d *V, geFloat X, geFloat Y, geFloat Z);

This function sets the values of the elements of V.

Returns: nothing.


GENESISAPI void GENESISCC  geVec3d_Subtract(const geVec3d *V1, const geVec3d *V2, geVec3d *V1MinusV2);

This function computes the difference between V1 and V2 returning the resultant vector in V1MinusV2.

Returns: nothing.