Main Page Modules Alphabetical List Data Structures Data Fields
|
Data Structures |
| struct | RwV2d |
Functions |
| RwReal | RwV2dLength (const RwV2d *in) |
| RwReal | RwV2dNormalize (RwV2d *out, const RwV2d *in) |
| void | RwV2dAssign (RwV2d *target, const RwV2d *source) |
| void | RwV2dAdd (RwV2d *out, const RwV2d *ina, const RwV2d *inb) |
| void | RwV2dSub (RwV2d *out, const RwV2d *ina, const RwV2d *inb) |
| void | RwV2dLineNormal (RwV2d *out, const RwV2d *ina, const RwV2d *inb) |
| void | RwV2dScale (RwV2d *out, const RwV2d *in, RwReal scalar) |
| RwReal | RwV2dDotProduct (const RwV2d *ina, const RwV2d *inb) |
| void | RwV2dPerp (RwV2d *out, const RwV2d *in) |
Detailed Description
2D Vector mathematics. - Requirements
-
- Headers: rwcore.h
- Libraries: rwcore.lib
This is RenderWare's 2D vector object.
RwV2d's API covers most 2D vector needs, including: addition, dot product, length, assignment, normalization, scaling and subtraction. The object is primarily used in the context of RenderWare's 2D Immediate Mode API RwIm2D . It is also used to represent a 2D coordinate or point in other parts of the API.
Function Documentation
|
|
RwV2dAdd is used to add together the specified 2D vectors. The result of the addition is placed in a third 2D vector.
- Note:
-
This function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
- Parameters:
-
| out |
A pointer to the 2D vector that will receive the result of the addition |
| ina |
A pointer to the first 2D vector |
| inb |
A pointer to the second 2D vector |
- Returns:
-
None
- See also:
-
RwV2dScale , RwV2dSub
|
| void RwV2dAssign |
( |
RwV2d * |
target, |
|
|
const RwV2d * |
source |
|
) |
|
|
|
|
RwV2dAssign is used to assign the first 2D vectors the value of the second 2D vector.
- Note:
-
This function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
- Parameters:
-
| target |
A pointer to the target 2D vector that will receive the assignment |
| source |
A pointer to the source 2D vector |
- Returns:
-
None
- See also:
-
RwV2dAdd , RwV2dScale , RwV2dSub
|
|
|
RwV2dDotProduct is used to calculate the scalar product of the specified 2D vectors.
- Note:
-
This function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
- Parameters:
-
| ina |
A pointer to the first 2D vector |
| inb |
A pointer to the second 2D vector |
- Returns:
-
Returns an RwReal value equal to the scalar product of the two input vectors if successful or -1 if there is an error
|
|
|
RwV2dLength is used to calculate the length of the specified 2D vector. - Parameters:
-
| in |
A pointer to the 2D vector |
- Returns:
-
Returns an RwReal value equal to the vector's length if successful
- See also:
-
RwV2dNormalize
|
|
|
RwV2dLineNormal is used to find the unit normal to line between the specified 2D vectors.
- Note:
-
This function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
- Parameters:
-
| out |
A pointer to the 2D vector that will receive the unit normal |
| ina |
A pointer to the first 2D vector |
| inb |
A pointer to the second 2D vector |
- Returns:
-
None
- See also:
-
RwV2dAdd , RwV2dScale
|
|
|
RwV2dNormalize is used to normalize the specified 2D vector. The input and output arguments can point to the same 2D vector.
- Note:
-
It is an error to try to normalize a vector whose length is zero. If this condition is detected RwV2dNormalize places a vector with components (0.0,0.0) in the output argument and returns 0.0.
- Parameters:
-
| out |
A pointer to the 2D vector that will receive the normalized vector |
| in |
A pointer to the 2D vector that is to be normalized and whose length is required |
- Returns:
-
Returns an RwReal value equal to the original length of the vector if successful or zero if there is an error
- See also:
-
RwV2dLength
|
|
|
RwV2dPerp is used to calculate a 2D vector that is perpendicular to the given 2D vector.
- Note:
-
The input and output arguments must not point to the same 2D vector.
- Note:
-
This function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
- Parameters:
-
| out |
A pointer to a 2D vector that will receive the perpendicular vector |
| in |
A pointer to the 2D vector whose perpendicular is required |
- Returns:
-
None
|
|
|
RwV2dScale is used to multiply the specified 2D vector by the given scalar. The result is placed in a second 2D vector.
- Note:
-
This function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
- Parameters:
-
| out |
A pointer to the 2D vector that will receive the result |
| in |
A pointer to the 2D vector that will be scaled |
| scalar |
An RwReal value equal to the scale factor |
- Returns:
-
None
- See also:
-
RwV2dAdd , RwV2dSub
|
|
|
RwV2dSub is used to subtract the specified 2D vectors. The second vector is subtracted from the first. The result of the subtraction is placed in a third 2D vector.
- Note:
-
This function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
- Parameters:
-
| out |
A pointer to the 2D vector that will receive the result of the subtraction |
| ina |
A pointer to the first 2D vector |
| inb |
A pointer to the second 2D vector |
- Returns:
-
None
- See also:
-
RwV2dAdd , RwV2dScale
|
© 1993-2004 Criterion Software Limited. All rights reserved. Built Thu Feb 12 13:46:51 2004.
Send Feedback