mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
docs: Use .. note:: to display better.
Also, make sure the note content has a blank line after it to remove a warning from Sphinx.
This commit is contained in:
@@ -3,9 +3,9 @@ Build cglm
|
|||||||
|
|
||||||
| **cglm** does not have any external dependencies.
|
| **cglm** does not have any external dependencies.
|
||||||
|
|
||||||
**NOTE:**
|
.. note::
|
||||||
If you only need to inline versions, you don't need to build **cglm**, you don't need to link it to your program.
|
If you only need to inline versions, you don't need to build **cglm**, you don't need to link it to your program.
|
||||||
Just import cglm to your project as dependency / external lib by copy-paste then use it as usual
|
Just import cglm to your project as dependency / external lib by copy-paste then use it as usual
|
||||||
|
|
||||||
CMake (All platforms):
|
CMake (All platforms):
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ fast if you don't care specific projection values.
|
|||||||
*_decomp* means decompose; these function can help to decompose projection
|
*_decomp* means decompose; these function can help to decompose projection
|
||||||
matrices.
|
matrices.
|
||||||
|
|
||||||
**NOTE**: Be careful when working with high range (very small near, very large
|
.. note:: Be careful when working with high range (very small near, very large
|
||||||
far) projection matrices. You may not get exact value you gave.
|
far) projection matrices. You may not get exact value you gave.
|
||||||
**float** type cannot store very high precision so you will lose precision.
|
**float** type cannot store very high precision so you will lose precision.
|
||||||
Also your projection matrix will be inaccurate due to losing precision
|
Also your projection matrix will be inaccurate due to losing precision
|
||||||
|
|
||||||
Table of contents (click to go):
|
Table of contents (click to go):
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@@ -178,7 +178,7 @@ Functions documentation
|
|||||||
|
|
||||||
| set up view matrix
|
| set up view matrix
|
||||||
|
|
||||||
**NOTE:** The UP vector must not be parallel to the line of sight from the eye point to the reference point.
|
.. note:: The UP vector must not be parallel to the line of sight from the eye point to the reference point.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
| *[in]* **eye** eye vector
|
| *[in]* **eye** eye vector
|
||||||
@@ -194,7 +194,7 @@ Functions documentation
|
|||||||
target self then this might be useful. Because you need to get target
|
target self then this might be useful. Because you need to get target
|
||||||
from direction.
|
from direction.
|
||||||
|
|
||||||
**NOTE:** The UP vector must not be parallel to the line of sight from the eye point to the reference point.
|
.. note:: The UP vector must not be parallel to the line of sight from the eye point to the reference point.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
| *[in]* **eye** eye vector
|
| *[in]* **eye** eye vector
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ Allocations:
|
|||||||
*cglm* doesn't alloc any memory on heap. So it doesn't provide any allocator.
|
*cglm* doesn't alloc any memory on heap. So it doesn't provide any allocator.
|
||||||
You must allocate memory yourself. You should alloc memory for out parameters too if you pass pointer of memory location. When allocating memory, don't forget that **vec4** and **mat4** require alignment.
|
You must allocate memory yourself. You should alloc memory for out parameters too if you pass pointer of memory location. When allocating memory, don't forget that **vec4** and **mat4** require alignment.
|
||||||
|
|
||||||
**NOTE:** Unaligned **vec4** and unaligned **mat4** operations will be supported in the future. Check todo list.
|
.. note:: Unaligned **vec4** and unaligned **mat4** operations will be supported in the future. Check todo list.
|
||||||
Because you may want to multiply a CGLM matrix with external matrix.
|
Because you may want to multiply a CGLM matrix with external matrix.
|
||||||
There is no guarantee that non-CGLM matrix is aligned. Unaligned types will have *u* prefix e.g. **umat4**
|
There is no guarantee that non-CGLM matrix is aligned. Unaligned types will have *u* prefix e.g. **umat4**
|
||||||
|
|
||||||
Array vs Struct:
|
Array vs Struct:
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ Example to print mat4 matrix:
|
|||||||
/* ... */
|
/* ... */
|
||||||
glm_mat4_print(transform, stderr);
|
glm_mat4_print(transform, stderr);
|
||||||
|
|
||||||
**NOTE:** print functions use **%0.4f** precision if you need more
|
.. note:: print functions use **%0.4f** precision if you need more
|
||||||
(you probably will in some cases), you can change it temporary.
|
(you probably will in some cases), you can change it temporary.
|
||||||
cglm may provide precision parameter in the future
|
cglm may provide precision parameter in the future.
|
||||||
|
|
||||||
Changes since **v0.7.3**:
|
Changes since **v0.7.3**:
|
||||||
* Now mis-alignment of columns are fixed: larger numbers are printed via %g and others are printed via %f. Column widths are calculated before print.
|
* Now mis-alignment of columns are fixed: larger numbers are printed via %g and others are printed via %f. Column widths are calculated before print.
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ Functions documentation
|
|||||||
|
|
||||||
Create mat2 matrix from pointer
|
Create mat2 matrix from pointer
|
||||||
|
|
||||||
| NOTE: **@src** must contain at least 4 elements.
|
.. note:: **@src** must contain at least 4 elements.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
| *[in]* **src** pointer to an array of floats
|
| *[in]* **src** pointer to an array of floats
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ Functions documentation
|
|||||||
|
|
||||||
Create mat2x3 matrix from pointer
|
Create mat2x3 matrix from pointer
|
||||||
|
|
||||||
| NOTE: **@src** must contain at least 6 elements.
|
.. note:: **@src** must contain at least 6 elements.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
| *[in]* **src** pointer to an array of floats
|
| *[in]* **src** pointer to an array of floats
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ Functions documentation
|
|||||||
|
|
||||||
Create mat2x4 matrix from pointer
|
Create mat2x4 matrix from pointer
|
||||||
|
|
||||||
| NOTE: **@src** must contain at least 8 elements.
|
.. note:: **@src** must contain at least 8 elements.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
| *[in]* **src** pointer to an array of floats
|
| *[in]* **src** pointer to an array of floats
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ Functions documentation
|
|||||||
|
|
||||||
Create mat3 matrix from pointer
|
Create mat3 matrix from pointer
|
||||||
|
|
||||||
| NOTE: **@src** must contain at least 9 elements.
|
.. note:: **@src** must contain at least 9 elements.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
| *[in]* **src** pointer to an array of floats
|
| *[in]* **src** pointer to an array of floats
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ Functions documentation
|
|||||||
|
|
||||||
Create mat3x2 matrix from pointer
|
Create mat3x2 matrix from pointer
|
||||||
|
|
||||||
| NOTE: **@src** must contain at least 6 elements.
|
.. note:: **@src** must contain at least 6 elements.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
| *[in]* **src** pointer to an array of floats
|
| *[in]* **src** pointer to an array of floats
|
||||||
| *[out]* **dest** destination matrix3x2
|
| *[out]* **dest** destination matrix3x2
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ Functions documentation
|
|||||||
|
|
||||||
Create mat3x4 matrix from pointer
|
Create mat3x4 matrix from pointer
|
||||||
|
|
||||||
| NOTE: **@src** must contain at least 12 elements.
|
.. note::: **@src** must contain at least 12 elements.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
| *[in]* **src** pointer to an array of floats
|
| *[in]* **src** pointer to an array of floats
|
||||||
| *[out]* **dest** destination matrix3x4
|
| *[out]* **dest** destination matrix3x4
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ Functions documentation
|
|||||||
| e.g Newton-Raphson. this should work faster than normal,
|
| e.g Newton-Raphson. this should work faster than normal,
|
||||||
| to get more precise use glm_mat4_inv version.
|
| to get more precise use glm_mat4_inv version.
|
||||||
|
|
||||||
| NOTE: You will lose precision, glm_mat4_inv is more accurate
|
.. note:: You will lose precision, glm_mat4_inv is more accurate
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
| *[in]* **mat** source
|
| *[in]* **mat** source
|
||||||
@@ -308,7 +308,7 @@ Functions documentation
|
|||||||
|
|
||||||
Create mat4 matrix from pointer
|
Create mat4 matrix from pointer
|
||||||
|
|
||||||
| NOTE: **@src** must contain at least 16 elements.
|
.. note:: **@src** must contain at least 16 elements.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
| *[in]* **src** pointer to an array of floats
|
| *[in]* **src** pointer to an array of floats
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ Functions documentation
|
|||||||
|
|
||||||
Create mat4x2 matrix from pointer
|
Create mat4x2 matrix from pointer
|
||||||
|
|
||||||
| NOTE: **@src** must contain at least 8 elements.
|
.. note:: **@src** must contain at least 8 elements.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
| *[in]* **src** pointer to an array of floats
|
| *[in]* **src** pointer to an array of floats
|
||||||
| *[out]* **dest** destination matrix4x2
|
| *[out]* **dest** destination matrix4x2
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ Functions documentation
|
|||||||
|
|
||||||
Create mat4x3 matrix from pointer
|
Create mat4x3 matrix from pointer
|
||||||
|
|
||||||
| NOTE: **@src** must contain at least 12 elements.
|
.. note:: **@src** must contain at least 12 elements.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
| *[in]* **src** pointer to an array of floats
|
| *[in]* **src** pointer to an array of floats
|
||||||
| *[out]* **dest** destination matrix4x3
|
| *[out]* **dest** destination matrix4x3
|
||||||
|
|||||||
@@ -426,7 +426,7 @@ Functions documentation
|
|||||||
|
|
||||||
Create quaternion from pointer
|
Create quaternion from pointer
|
||||||
|
|
||||||
| NOTE: **@src** must contain at least 4 elements. cglm store quaternions as [x, y, z, w].
|
.. note:: **@src** must contain at least 4 elements. cglm store quaternions as [x, y, z, w].
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
| *[in]* **src** pointer to an array of floats
|
| *[in]* **src** pointer to an array of floats
|
||||||
|
|||||||
@@ -389,7 +389,8 @@ Functions documentation
|
|||||||
|
|
||||||
Create two dimensional vector from pointer
|
Create two dimensional vector from pointer
|
||||||
|
|
||||||
| NOTE: **@src** must contain at least 2 elements.
|
.. note:: **@src** must contain at least 2 elements.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
| *[in]* **src** pointer to an array of floats
|
| *[in]* **src** pointer to an array of floats
|
||||||
| *[out]* **dest** destination vector
|
| *[out]* **dest** destination vector
|
||||||
|
|||||||
@@ -507,7 +507,7 @@ Functions documentation
|
|||||||
|
|
||||||
Create three dimensional vector from pointer
|
Create three dimensional vector from pointer
|
||||||
|
|
||||||
| NOTE: **@src** must contain at least 3 elements.
|
.. note::: **@src** must contain at least 3 elements.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
| *[in]* **src** pointer to an array of floats
|
| *[in]* **src** pointer to an array of floats
|
||||||
|
|||||||
@@ -412,7 +412,8 @@ Functions documentation
|
|||||||
|
|
||||||
Create four dimensional vector from pointer
|
Create four dimensional vector from pointer
|
||||||
|
|
||||||
| NOTE: **@src** must contain at least 4 elements.
|
.. note:: **@src** must contain at least 4 elements.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
| *[in]* **src** pointer to an array of floats
|
| *[in]* **src** pointer to an array of floats
|
||||||
| *[out]* **dest** destination vector
|
| *[out]* **dest** destination vector
|
||||||
|
|||||||
Reference in New Issue
Block a user