br_vector2
typedef
vector.h
for precise declaration and ordering)
br_scalar v[2] Ordinates (0=x, 1=y)
BrOriginToScreenXY()
251
, BrPointToScreenXY()
251
, BrPointToScreenXYMany()
251
,
BrMatrix23ApplyP()
173
, BrMatrix23ApplyV()
175
, BrMatrix23TApplyP()
175
, BrMatrix23TApplyV()
175
.
br_matrix23
171
, br_vertex
367
.
A pointer to the destination vector (may be same as source).
A pointer to the source vector.
Equivalent to the expression:
A pointer to the destination vector (may be same as either source).
A pointer to the first vector of the sum.
A pointer to the second vector of the sum.
A pointer to the accumulating vector (may be same as
A pointer to the vector to add.
Equivalent to the expression:
A pointer to the destination vector (may be same as
A pointer to the additive vector.
A pointer to the subtractive vector.
A pointer to the destination vector (may be same as source).
A pointer to the source vector.
Scale factor.
A pointer to the destination vector (may be same as source).
A pointer to the source vector.
Reciprocal scale factor.
Pointer to left hand vector (may be same as
Pointers to right hand vector.
Returns the dot product of the two source vectors. Equivalent to:
A pointer to the source vector.
Returns the length of the vector. Equivalent to:
or
A pointer to the source vector.
Returns the squared length of the vector. Equivalent to:
A pointer to the destination vector (may be same as source).
A pointer to the source vector.
A pointer to the destination vector (may be same as source).
A pointer to the source vector.
All other initialisation should use the functions,
A pointer to the destination vector.
The first vector element (x axis component).
The second vector element (y axis component).
A pointer to the destination vector.
The first vector element (x axis component).
The second vector element (y axis component).
A pointer to the destination vector.
The first vector element (x axis component).
The second vector element (y axis component).
Members
First and second ordinate. Conventionally, the first ordinate is the x-axis component, and the second, the y axis component.br_scalar v[2]
Arithmetic
Description:
Negate a vector and place the result in a second destination vector. Equivalent to the expression:BrVector2Negate()
void BrVector2Negate(br_vector2* v1, const br_vector2* v2)
br_vector2 * v1
const br_vector2 * v2
Description:
Add two vectors and place the result in a third destination vector.BrVector2Add()
void BrVector2Add(br_vector2* v1, const br_vector2* v2, const br_vector2* v3)
br_vector2 * v1
const br_vector2 * v2
const br_vector2 * v3
Description:
Add one vector to another. Equivalent to the expression:BrVector2Accumulate()
void BrVector2Accumulate(br_vector2* v1, const br_vector2* v2)
br_vector2 * v1
v2
).const br_vector2 * v2
Description:
Subtract one vector from another and place the result in a third destination vector.BrVector2Sub()
void BrVector2Sub(br_vector2* v1, const br_vector2* v2, const br_vector2* v3)
br_vector2 * v1
v1
or v2
).const br_vector2 * v2
const br_vector2 * v3
Description:
Scale a vector by a scalar and place the result in a destination vector. Equivalent to the expression:BrVector2Scale()
void BrVector2Scale(br_vector2* v1, const br_vector2* v2, br_scalar s)
br_vector2 * v1
const br_vector2 * v2
br_scalar s
Description:
Scale a vector by the reciprocal of a scalar and place the result in a destination vector. Equivalent to the expression:BrVector2InvScale()
void BrVector2InvScale(br_vector2* v1, const br_vector2* v2, br_scalar s)
br_vector2 * v1
const br_vector2 * v2
br_scalar s
Description:
Calculate the dot product of two vectors. Equivalent to the expression:BrVector2Dot()
br_scalar BrVector2Dot(const br_vector2* v1, const br_vector2* v2)
const br_vector2 * v1
v2
).const br_vector2 * v2
br_scalar
Description:
Calculate the length of a vector. Equivalent to the expression:BrVector2Length()
br_scalar BrVector2Length(const br_vector2* v1)
const br_vector2 * v1
br_scalar
BrVector2LengthSquared()
352
Description:
Calculate the squared length of a vector. Equivalent to the expression:BrVector2LengthSquared()
br_scalar BrVector2LengthSquared(const br_vector2* v1)
const br_vector2 * v1
br_scalar
BrVector2Length()
352
Description:
Normalise a vector and place the result in a destination vector. Equivalent to the expression:BrVector2Normalise()
void BrVector2Normalise(br_vector2* v1, const br_vector2* v2)
br_vector2 * v1
const br_vector2 * v2
Copy/Assign
Although copy by structure assignment currently works, use BrVector2Copy()
353 to ensure compatibility.
Description:
Copy a vector. Equivalent to the expression:BrVector2Copy()
void BrVector2Copy(br_vector2* v1, const br_vector2* v2)
br_vector2 * v1
const br_vector2 * v2
Referencing & Lifetime
This structure may be freely referenced, though take care if there is potential to supply the same vector as more than one argument to the same function. Initialisation
The following macro may be used as a static initialiser.
BR_VECTOR2(a,b)
Macro expands to {BR_SCALAR(a),BR_SCALAR(b)}
.BrVector2Set()
354BrVector2SetInt()
355BrVector2SetFloat()
354BrVector2Copy()
353
Description:
Set a vector with a pair of scalars.BrVector2Set()
void BrVector2Set(br_vector2* v1, br_scalar s1, br_scalar s2)
br_vector2 * v1
br_scalar s1
br_scalar s2
br_vector2 *va;
...
BrVector2Set(va,BR_SCALAR(1.0),BR_SCALAR(-1.0));
Description:
Set a vector from a pair of BrVector2SetFloat()
standard C floating point numbers.
void BrVector2SetFloat(br_vector2* v1, float f1, float f2)
br_vector2 * v1
float f1
float f2
br_vector2 *va;
...
BrVector2Set(va,1.f,-1.f);
Description:
Set a vector from a pair of standard C integers.BrVector2SetInt()
void BrVector2SetInt(br_vector2* v1, int i1, int i2)
br_vector2 * v1
int i1
int i2
br_vector2 *va;
...
BrVector2Set(va,1,-1);
Generated with CERN WebMaker