Актуализация документации по проекту
This commit is contained in:
parent
ed404690ed
commit
8ba075b557
16 changed files with 279 additions and 222 deletions
|
|
@ -2,21 +2,22 @@
|
|||
|
||||
[Русская версия / Russian version](set-values-rus.md)
|
||||
|
||||
You can set the coordinates of vectors either directly or using functions.
|
||||
The functions for setting coordinate values allow you to do this in one line.
|
||||
|
||||
Function for **BGC_FP32_Vector3**:
|
||||
The function for **BGC_FP32_Vector3**:
|
||||
|
||||
```c
|
||||
inline void bgc_fp32_vector3_set_values(BGC_FP32_Vector3* const destination, const float x, const float y, const float z);
|
||||
```
|
||||
|
||||
Function for **BGC_FP64_Vector3**:
|
||||
The function for **BGC_FP64_Vector3**:
|
||||
|
||||
```c
|
||||
inline void bgc_fp64_vector3_set_values(BGC_FP64_Vector3* const destination, const double x, const double y, const double z);
|
||||
```
|
||||
|
||||
These functions allow to set the values of coordinates in one-line.
|
||||
|
||||
The functions are especially useful when the values are constants like in the example below.
|
||||
|
||||
Each of these functions is equivalent to the following lines of code:
|
||||
|
||||
```c
|
||||
|
|
@ -25,14 +26,18 @@ destination->y = y;
|
|||
destination->z = z;
|
||||
```
|
||||
|
||||
Invalid pointers should not be passed in the **destination** parameter.
|
||||
The NULL (0) value is also considered invalid.
|
||||
### Parameters
|
||||
|
||||
This function is good for setting up the initial values of coordinates with
|
||||
one-line especially when the values are fixed constants like in the example
|
||||
below.
|
||||
| Parameter | Direction | Description |
|
||||
| ----------- | --------- | ------------------------------------------------------- |
|
||||
| destination | out | A pointer to a 3D-vector, which coordinates must be set |
|
||||
| x | in | A new value for the X-coordinate |
|
||||
| y | in | A new value for the Y-coordinate |
|
||||
| z | in | A new value for the Z-coordinate |
|
||||
|
||||
Example of use:
|
||||
The *destination* parameter must be a valid pointer. The NULL (0) value is considered invalid.
|
||||
|
||||
### Example
|
||||
|
||||
```c
|
||||
#include <stdio.h>
|
||||
|
|
@ -42,7 +47,7 @@ int main()
|
|||
{
|
||||
BGC_FP32_Vector3 v;
|
||||
|
||||
bgc_fp32_vector3_set_values(&v, -2.2f, 7.1f, 10.01f);
|
||||
bgc_fp32_vector3_set_values(&v, -2.2f, 7.8f, 10.01f);
|
||||
|
||||
printf("x = %f, y = %f, z = %f\n", v.x, v.y, v.z);
|
||||
|
||||
|
|
@ -51,3 +56,4 @@ int main()
|
|||
```
|
||||
|
||||
[Documentation](../intro-eng.md) / [3D vectors](../vector3-eng.md)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue