Переименование s0 -> s, x1 -> x, x2 -> y, x3 -> z, что должно упростить читаемость кода. Также обновление документации
This commit is contained in:
parent
d83ab7160d
commit
b8d383da33
38 changed files with 2104 additions and 2070 deletions
|
|
@ -2,27 +2,30 @@
|
|||
|
||||
These functions set all coordinates of 3D vectors to 0.
|
||||
|
||||
Function for **BgcVector3FP32**:
|
||||
Function for **BGC_FP32_Vector3**:
|
||||
|
||||
```c
|
||||
inline void bgc_vector3_reset_fp32(BgcVector3FP32* vector);
|
||||
inline void bgc_fp32_vector3_reset(BGC_FP32_Vector3* vector);
|
||||
```
|
||||
|
||||
Function for **BgcVector3FP64**:
|
||||
Function for **BGC_FP64_Vector3**:
|
||||
|
||||
```c
|
||||
inline void bgc_vector3_reset_fp64(BgcVector3FP64* vector);
|
||||
inline void bgc_fp64_vector3_reset(BGC_FP64_Vector3* vector);
|
||||
```
|
||||
|
||||
Each of these functions is equivalent to the following lines of code:
|
||||
|
||||
```c
|
||||
vector->x1 = 0;
|
||||
vector->x2 = 0;
|
||||
vector->x3 = 0;
|
||||
vector->x = 0;
|
||||
vector->y = 0;
|
||||
vector->z = 0;
|
||||
```
|
||||
|
||||
You should not pass invalid pointers to these functions. The NULL (0) value is also considered invalid.
|
||||
You should not pass invalid pointers to these functions. The NULL (0) value is
|
||||
also considered invalid.
|
||||
|
||||
This function is good for setting up the initial state of a 3D vector.
|
||||
|
||||
Example of use:
|
||||
|
||||
|
|
@ -32,11 +35,11 @@ Example of use:
|
|||
|
||||
int main()
|
||||
{
|
||||
BgcVector3FP32 my_vector;
|
||||
BGC_FP32_Vector3 my_vector;
|
||||
|
||||
bgc_vector3_reset_fp32(&my_vector);
|
||||
bgc_fp32_vector3_reset(&my_vector);
|
||||
|
||||
printf("x1 = %f, x2 = %f, x3 = %f\n", my_vector.x1, my_vector.x2, my_vector.x3);
|
||||
printf("x = %f, y = %f, z = %f\n", my_vector.x, my_vector.y, my_vector.z);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue