br_vector3
typedef
vector.h
for precise declaration and ordering)
br_scalar v[3] Ordinates (0=x, 1=y, 2=z)
BrOriginToScreenXYZO()
252
, BrPointToScreenXYZO()
252
, BrPointToScreenXYZOMany()
253
.
BrMatrix34
[Pre
|Post
]Rotate()
[197|201], BrMatrix
[34
|4
][T
]Apply
[V
|P
]()
[190-193|216-219].
br_matrix23
171
, br_matrix34
187
, br_model
228
, br_vertex
367
, br_transform
339
, br_bounds
105
.
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 (may be same as
Returns the dot product of the two source vectors. Equivalent to:
Pointer to destination vector (must be different from both
Pointer to left hand vector.
Pointers to right hand vector.
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.
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).
The third vector element (z axis component).
A pointer to the destination vector.
The first vector element (x axis component).
The second vector element (y axis component).
The third vector element (z axis component).
A pointer to the destination vector.
The first vector element (x axis component).
The second vector element (y axis component).
The third vector element (z axis component).
Members
First, second and third ordinate. Conventionally, the first ordinate is the x-axis component, the second, the y axis component, and the third, the z axis component. Remember that BRender has a right handed co-ordinate system and so, with the x axis positive to the right, and the y axis positive upwards, the z axis is therefore positive toward you (typically, the z axis points out of the screen).br_scalar v[3]
Arithmetic
Description:
Negate a vector and place the result in a second destination vector. Equivalent to the expression:BrVector3Negate()
void BrVector3Negate(br_vector3* v1, const br_vector3* v2)
br_vector3 * v1
const br_vector3 * v2
Description:
Add two vectors and place the result in a third destination vector.BrVector3Add()
void BrVector3Add(br_vector3* v1, const br_vector3* v2, const br_vector3* v3)
br_vector3 * v1
const br_vector3 * v2
const br_vector3 * v3
Description:
Add one vector to another. Equivalent to the expression:BrVector3Accumulate()
void BrVector3Accumulate(br_vector3* v1, const br_vector3* v2)
br_vector3 * v1
v2
).const br_vector3 * v2
Description:
Subtract one vector from another and place the result in a third destination vector.BrVector3Sub()
void BrVector3Sub(br_vector3* v1, const br_vector3* v2, const br_vector3* v3)
br_vector3 * v1
v2
or v3
).const br_vector3 * v2
const br_vector3 * v3
Description:
Scale a vector by a scalar and place the result in a destination vector. Equivalent to the expression:BrVector3Scale()
void BrVector3Scale(br_vector3* v1, const br_vector3* v2, br_scalar s)
br_vector3 * v1
const br_vector3 * 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:BrVector3InvScale()
void BrVector3InvScale(br_vector3* v1, const br_vector3* v2, br_scalar s)
br_vector3 * v1
const br_vector3 * v2
br_scalar s
Description:
Calculate the dot product of two vectors. Equivalent to the expression:BrVector3Dot()
br_scalar BrVector3Dot(const br_vector3* v1, const br_vector3* v2)
const br_vector3 * v1
v2
).const br_vector3 * v2
v1
).br_scalar
Description:
Calculate the cross product of two vectors and store the result in a destination vector. Equivalent to the expression:BrVector3Cross()
void BrVector3Cross(br_vector3* v1, const br_vector3* v2, const br_vector3* v3)
br_vector3 * v1
v1
and v2
).const br_vector3 * v2
const br_vector3 * v3
Description:
Calculate the length of a vector. Equivalent to the expression:BrVector3Length()
br_scalar BrVector3Length(const br_vector3* v1)
const br_vector3 * v1
br_scalar
BrVector3LengthSquared()
360
Description:
Calculate the squared length of a vector. Equivalent to the expression:BrVector3LengthSquared()
br_scalar BrVector3LengthSquared(const br_vector3* v1)
const br_vector3 * v1
br_scalar
BrVector3Length()
360
Description:
Normalise a vector and place the result in a destination vector. Equivalent to the expression:BrVector3Normalise()
void BrVector3Normalise(br_vector3* v1, const br_vector3* v2)
br_vector3 * v1
const br_vector3 * v2
Description:
Normalise a vector with non-zero length and place the result in a destination vector. Equivalent to the expression: BrVector3NormaliseQuick()
void BrVector3NormaliseQuick(br_vector3* v1, const br_vector3* v2)
br_vector3 * v1
const br_vector3 * v2
Description:
Normalise a vector with non-zero length using low precision*2 arithmetic and place the result in a destination vector. Equivalent to the expression:BrVector3NormaliseLP()
void BrVector3NormaliseLP(br_vector3* v1, const br_vector3* v2)
br_vector3 * v1
const br_vector3 * v2
Copy/Assign
Although copy by structure assignment currently works, use BrVector3Copy()
362 to ensure compatibility.
Description:
Copy a vector. Equivalent to the expression:BrVector3Copy()
void BrVector3Copy(br_vector3* v1, const br_vector3* v2)
br_vector3 * v1
const br_vector3 * 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_VECTOR3(a,b,c)
Macro expands to {
BR_SCALAR
(a),
BR_SCALAR
(b),
BR_SCALAR
(c)}
.BrVector3Set()
363BrVector3SetInt()
364BrVector3SetFloat()
363BrVector3Copy()
362
Description:
Set a vector with a triple of scalars.BrVector3Set()
void BrVector3Set(br_vector3* v1, br_scalar s1, br_scalar s2, br_scalar s3)
br_vector3 * v1
br_scalar s1
br_scalar s2
br_scalar s3
br_vector3 *va;
...
BrVector3Set(va,BR_SCALAR(1.0),BR_SCALAR(-1.0),BR_SCALAR(2.0));
Description:
Set a vector from a triple of BrVector3SetFloat()
standard C floating point numbers.
void BrVector3SetFloat(br_vector3* v1, float f1, float f2, float f3)
br_vector3 * v1
float f1
float f2
float f3
br_vector3 *va;
...
BrVector3Set(va,1.f,-1.f,1.5f);
Description:
Set a vector from a triple of standard C integers.BrVector3SetInt()
void BrVector3SetInt(br_vector3* v1, int i1, int i2, int i3)
br_vector3 * v1
int i1
int i2
int i3
br_vector3 *va;
...
BrVector3Set(va,1,-1,2);
Generated with CERN WebMaker