- The Structure
- Members
- Arithmetic
- BrVector3Negate()
- BrVector3Add()
- BrVector3Accumulate()
- BrVector3Sub()
- BrVector3Scale()
- BrVector3InvScale()
- BrVector3Dot()
- BrVector3Cross()
- BrVector3Length()
- BrVector3LengthSquared()
- BrVector3Normalise()
- BrVector3NormaliseQuick()
- BrVector3NormaliseLP()
- Copy/Assign
- BrVector3Copy()
- Referencing & Lifetime
- Initialisation
- BrVector3Set()
- BrVector3SetFloat()
- BrVector3SetInt()

** br_vector3**

`typedef`

`vector.h `

for precise declaration and ordering)
**br_scalar v[3] Ordinates (0=x, 1=y, 2=z)**

`BrOriginToScreenXYZO()`

, `BrPointToScreenXYZO()`

, `BrPointToScreenXYZOMany()`

.

`BrMatrix34`

[`Pre`

|`Post`

]`Rotate()`

`BrMatrix`

[`34`

|`4`

][`T`

]`Apply`

[`V`

|`P`

]`()`

`br_matrix23`

, `br_matrix34`

, `br_model`

, `br_vertex`

, `br_transform`

, `br_bounds`

.`br_scalar v[3]`

**BrVector3Negate()**

Declaration:

**void BrVector3Negate(br_vector3* v1, const br_vector3* v2)**

Arguments:

**br_vector3 * v1**

A pointer to the destination vector (may be same as source).

**const br_vector3 * v2**

A pointer to the source vector.

**BrVector3Add()**

Equivalent to the expression:

Declaration:

**void BrVector3Add(br_vector3* v1, const br_vector3* v2, const br_vector3* v3)**

Arguments:

**br_vector3 * v1**

A pointer to the destination vector (may be same as either source).

**const br_vector3 * v2**

A pointer to the first vector of the sum.

**const br_vector3 * v3**

A pointer to the second vector of the sum.

**BrVector3Accumulate()**

Declaration:

**void BrVector3Accumulate(br_vector3* v1, const br_vector3* v2)**

Arguments:

**br_vector3 * v1**

A pointer to the accumulating vector (may be same as `v2`

).

**const br_vector3 * v2**

A pointer to the vector to add.

**BrVector3Sub()**

Equivalent to the expression:

Declaration:

**void BrVector3Sub(br_vector3* v1, const br_vector3* v2, const br_vector3* v3)**

Arguments:

**br_vector3 * v1**

A pointer to the destination vector (may be same as `v2 `

or `v3`

).

**const br_vector3 * v2**

A pointer to the additive vector.

**const br_vector3 * v3**

A pointer to the subtractive vector.

**BrVector3Scale()**

Declaration:

**void BrVector3Scale(br_vector3* v1, const br_vector3* v2, br_scalar s)**

Arguments:

**br_vector3 * v1**

A pointer to the destination vector (may be same as source).

**const br_vector3 * v2**

A pointer to the source vector.

**br_scalar s**

Scale factor.

**BrVector3InvScale()**

Declaration:

**void BrVector3InvScale(br_vector3* v1, const br_vector3* v2, br_scalar s)**

Arguments:

**br_vector3 * v1**

A pointer to the destination vector (may be same as source).

**const br_vector3 * v2**

A pointer to the source vector.

**br_scalar s**

Reciprocal scale factor.

**BrVector3Dot()**

Declaration:

**br_scalar BrVector3Dot(const br_vector3* v1, const br_vector3* v2)**

Arguments:

**const br_vector3 * v1**

Pointer to left hand vector (may be same as `v2`

).

**const br_vector3 * v2**

Pointers to right hand vector (may be same as `v1`

).

Result:

**br_scalar**

Returns the dot product of the two source vectors. Equivalent to:

**BrVector3Cross()**

Declaration:

**void BrVector3Cross(br_vector3* v1, const br_vector3* v2, const br_vector3* v3)**

Arguments:

**br_vector3 * v1**

Pointer to destination vector (must be different from both `v1 `

and `v2`

).

**const br_vector3 * v2**

Pointer to left hand vector.

**const br_vector3 * v3**

Pointers to right hand vector.

Remarks: The cross product of the two source vectors is equivalent to:

**BrVector3Length()**

Declaration:

**br_scalar BrVector3Length(const br_vector3* v1)**

Arguments:

**const br_vector3 * v1**

A pointer to the source vector.

Result:

**br_scalar**

Returns the length of the vector. Equivalent to:

See Also:

`BrVector3LengthSquared()`

**BrVector3LengthSquared()**

or

Declaration:

**br_scalar BrVector3LengthSquared(const br_vector3* v1)**

Arguments:

**const br_vector3 * v1**

A pointer to the source vector.

Result:

**br_scalar**

Returns the squared length of the vector. Equivalent to:

See Also:

`BrVector3Length()`

**BrVector3Normalise()**

Declaration:

**void BrVector3Normalise(br_vector3* v1, const br_vector3* v2)**

Arguments:

**br_vector3 * v1**

A pointer to the destination vector (may be same as source).

**const br_vector3 * v2**

A pointer to the source vector.

Remarks: If the source vector's length is zero

**BrVector3NormaliseQuick()**

Declaration:

**void BrVector3NormaliseQuick(br_vector3* v1, const br_vector3* v2)**

Arguments:

**br_vector3 * v1**

A pointer to the destination vector (may be same as source).

**const br_vector3 * v2**

A pointer to the source vector.

Remarks: No check made for zero length, hence quicker.

**BrVector3NormaliseLP()**

Declaration:

**void BrVector3NormaliseLP(br_vector3* v1, const br_vector3* v2)**

Arguments:

**br_vector3 * v1**

A pointer to the destination vector (may be same as source).

**const br_vector3 * v2**

A pointer to the source vector.

Remarks: No check is made for zero length. The destination vector will be left unchanged if the reciprocal of length of the vector is zero.

`BrVector3Copy()`

to ensure compatibility.

**BrVector3Copy()**

Declaration:

**void BrVector3Copy(br_vector3* v1, const br_vector3* v2)**

Arguments:

**br_vector3 * v1**

A pointer to the destination vector (may be same as source).

**const br_vector3 * v2**

A pointer to the source vector.

BR_VECTOR3(a,b,c)Macro expands to

`{`

`BR_SCALAR`

`(a),`

`BR_SCALAR`

`(b),`

`BR_SCALAR`

`(c)}`

.

All other initialisation should use the functions, `BrVector3Set()`

*363*`, `

`BrVector3SetInt()`

*364*`, `

`BrVector3SetFloat()`

*363*` `

or `BrVector3Copy()`

*362*`.`

**BrVector3Set()**

Declaration:

**void BrVector3Set(br_vector3* v1, br_scalar s1, br_scalar s2, br_scalar s3)**

Arguments:

**br_vector3 * v1**

A pointer to the destination vector.

**br_scalar s1**

The first vector element (x axis component).

**br_scalar s2**

The second vector element (y axis component).

**br_scalar s3**

The third vector element (z axis component).

Example:

br_vector3 *va; ... BrVector3Set(va,BR_SCALAR(1.0),BR_SCALAR(-1.0),BR_SCALAR(2.0));

**BrVector3SetFloat()**

`standard C floating point numbers.`

Declaration:

**void BrVector3SetFloat(br_vector3* v1, float f1, float f2, float f3)**

Arguments:

**br_vector3 * v1**

A pointer to the destination vector.

**float f1**

The first vector element (x axis component).

**float f2**

The second vector element (y axis component).

**float f3**

The third vector element (z axis component).

Example:

br_vector3 *va; ... BrVector3Set(va,1.f,-1.f,1.5f);

**BrVector3SetInt()**

Declaration:

**void BrVector3SetInt(br_vector3* v1, int i1, int i2, int i3)**

Arguments:

**br_vector3 * v1**

A pointer to the destination vector.

**int i1**

The first vector element (x axis component).

**int i2**

The second vector element (y axis component).

**int i3**

The third vector element (z axis component).

Example:

br_vector3 *va; ... BrVector3Set(va,1,-1,2);

Generated with CERN WebMaker