mirror of
https://github.com/recp/cglm.git
synced 2025-10-04 09:08:53 +00:00
Merge branch 'master' into optimize-inv
This commit is contained in:
@@ -82,7 +82,7 @@ Functions documentation
|
||||
|
||||
| crops a bounding box with another one.
|
||||
|
||||
this could be useful for gettng a bbox which fits with view frustum and
|
||||
this could be useful for getting a bbox which fits with view frustum and
|
||||
object bounding boxes. In this case you crop view frustum box with objects
|
||||
box
|
||||
|
||||
@@ -95,7 +95,7 @@ Functions documentation
|
||||
|
||||
| crops a bounding box with another one.
|
||||
|
||||
this could be useful for gettng a bbox which fits with view frustum and
|
||||
this could be useful for getting a bbox which fits with view frustum and
|
||||
object bounding boxes. In this case you crop view frustum box with objects
|
||||
box
|
||||
|
||||
|
@@ -117,7 +117,7 @@ Functions documentation
|
||||
If you need to rotate object around itself e.g. center of object or at
|
||||
some point [of object] then `glm_rotate_at()` would be better choice to do so.
|
||||
|
||||
Even if object's model transform is identiy, rotation may not be around
|
||||
Even if object's model transform is identity, rotation may not be around
|
||||
center of object if object does not lay out at ORIGIN perfectly.
|
||||
|
||||
Using `glm_rotate_at()` with center of bounding shape ( AABB, Sphere ... )
|
||||
|
@@ -66,6 +66,7 @@ Follow the :doc:`build` documentation for this
|
||||
ivec4
|
||||
color
|
||||
plane
|
||||
noise
|
||||
project
|
||||
util
|
||||
io
|
||||
|
@@ -9,7 +9,7 @@ By default struct api adds `s` suffix to every type name e.g. vec3s, mat4s, vers
|
||||
Also struct api `s` suffix to namespace e.g. `glms_vec3_add`, `glms_mat4_mul` etc.
|
||||
|
||||
By starting v0.9.0, struct api namespace is configurable. We can omit **glms_** namespace or
|
||||
even change it with custom name to move existing api integrations to **cglm** more easliy...
|
||||
even change it with custom name to move existing api integrations to **cglm** more easily...
|
||||
We can also add **s** to function names if we want e.g. `glms_vec3_add()` -> `vec3_add()` or `vec3s_add()`.
|
||||
|
||||
By including **cglm/struct.h** header you will include all struct api. It will also include **cglm/cglm.h** too.
|
||||
|
@@ -62,7 +62,7 @@ Functions documentation
|
||||
|
||||
| crops a bounding box with another one.
|
||||
|
||||
this could be useful for gettng a bbox which fits with view frustum and
|
||||
this could be useful for getting a bbox which fits with view frustum and
|
||||
object bounding boxes. In this case you crop view frustum box with objects
|
||||
box
|
||||
|
||||
@@ -75,7 +75,7 @@ Functions documentation
|
||||
|
||||
| crops a bounding box with another one.
|
||||
|
||||
this could be useful for gettng a bbox which fits with view frustum and
|
||||
this could be useful for getting a bbox which fits with view frustum and
|
||||
object bounding boxes. In this case you crop view frustum box with objects
|
||||
box
|
||||
|
||||
|
60
docs/source/noise.rst
Normal file
60
docs/source/noise.rst
Normal file
@@ -0,0 +1,60 @@
|
||||
.. default-domain:: C
|
||||
|
||||
perlin
|
||||
================================================================================
|
||||
|
||||
Header: cglm/noise.h
|
||||
|
||||
Classic Perlin noise implementation.
|
||||
|
||||
Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise":
|
||||
https://github.com/stegu/webgl-noise
|
||||
Following Stefan Gustavson's paper "Simplex noise demystified":
|
||||
http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
|
||||
|
||||
Implementation based on glm::perlin function:
|
||||
https://github.com/g-truc/glm/blob/master/glm/gtc/noise.inl
|
||||
|
||||
Table of contents (click to go):
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Functions:
|
||||
|
||||
1. :c:func:`glm_perlin_vec4`
|
||||
#. :c:func:`glm_perlin_vec3`
|
||||
#. :c:func:`glm_perlin_vec2`
|
||||
|
||||
|
||||
Functions documentation
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. c:function:: float glm_perlin_vec4(vec4 point)
|
||||
|
||||
| Classic Perlin noise
|
||||
|
||||
Parameters:
|
||||
| *[in]* **point** 4D point
|
||||
|
||||
Returns:
|
||||
| noise value
|
||||
|
||||
|
||||
.. c:function:: float glm_perlin_vec3(vec3 point)
|
||||
|
||||
| Classic Perlin noise
|
||||
|
||||
Parameters:
|
||||
| *[in]* **point** 3D point
|
||||
|
||||
Returns:
|
||||
| noise value
|
||||
|
||||
.. c:function:: float glm_perlin_vec2(vec2 point)
|
||||
|
||||
| Classic Perlin noise
|
||||
|
||||
Parameters:
|
||||
| *[in]* **point** 2D point
|
||||
|
||||
Returns:
|
||||
| noise value
|
@@ -11,9 +11,9 @@ Header: cglm/quat.h
|
||||
|
||||
What you can do with quaternions with existing functions is (Some of them):
|
||||
|
||||
- You can rotate transform matrix using quaterion
|
||||
- You can rotate vector using quaterion
|
||||
- You can create view matrix using quaterion
|
||||
- You can rotate transform matrix using quaternion
|
||||
- You can rotate vector using quaternion
|
||||
- You can create view matrix using quaternion
|
||||
- You can create a lookrotation (from source point to dest)
|
||||
|
||||
Table of contents (click to go):
|
||||
@@ -55,6 +55,7 @@ Functions:
|
||||
#. :c:func:`glm_quat_lerp`
|
||||
#. :c:func:`glm_quat_nlerp`
|
||||
#. :c:func:`glm_quat_slerp`
|
||||
#. :c:func:`glm_quat_slerp_longest`
|
||||
#. :c:func:`glm_quat_look`
|
||||
#. :c:func:`glm_quat_for`
|
||||
#. :c:func:`glm_quat_forp`
|
||||
@@ -351,6 +352,17 @@ Functions documentation
|
||||
| *[in]* **t** interpolant (amount) clamped between 0 and 1
|
||||
| *[out]* **dest** result quaternion
|
||||
|
||||
.. c:function:: void glm_quat_slerp_longest(versor q, versor r, float t, versor dest)
|
||||
|
||||
| interpolates between two quaternions
|
||||
| using spherical linear interpolation (SLERP) and always takes the longest path
|
||||
|
||||
Parameters:
|
||||
| *[in]* **from** from
|
||||
| *[in]* **to** to
|
||||
| *[in]* **t** interpolant (amount) clamped between 0 and 1
|
||||
| *[out]* **dest** result quaternion
|
||||
|
||||
.. c:function:: void glm_quat_look(vec3 eye, versor ori, mat4 dest)
|
||||
|
||||
| creates view matrix using quaternion as camera orientation
|
||||
|
@@ -27,6 +27,8 @@ Functions:
|
||||
#. :c:func:`glm_vec2_isvalid`
|
||||
#. :c:func:`glm_vec2_sign`
|
||||
#. :c:func:`glm_vec2_abs`
|
||||
#. :c:func:`glm_vec2_fract`
|
||||
#. :c:func:`glm_vec2_floor`
|
||||
#. :c:func:`glm_vec2_sqrt`
|
||||
|
||||
Functions documentation
|
||||
@@ -134,6 +136,22 @@ Functions documentation
|
||||
| *[in]* **v** vector
|
||||
| *[out]* **dest** destination vector
|
||||
|
||||
.. c:function:: void glm_vec2_fract(vec2 v, vec2 dest)
|
||||
|
||||
get fractional part of each vector item
|
||||
|
||||
Parameters:
|
||||
| *[in]* **v** vector
|
||||
| *[out]* **dest** destination vector
|
||||
|
||||
.. c:function:: void glm_vec2_floor(vec2 v, vec2 dest)
|
||||
|
||||
floor value of each vector item
|
||||
|
||||
Parameters:
|
||||
| *[in]* **v** vector
|
||||
| *[out]* **dest** destination vector
|
||||
|
||||
.. c:function:: void glm_vec2_sqrt(vec2 v, vec2 dest)
|
||||
|
||||
square root of each vector item
|
||||
|
@@ -28,6 +28,8 @@ Functions:
|
||||
#. :c:func:`glm_vec3_isvalid`
|
||||
#. :c:func:`glm_vec3_sign`
|
||||
#. :c:func:`glm_vec3_abs`
|
||||
#. :c:func:`glm_vec3_fract`
|
||||
#. :c:func:`glm_vec3_floor`
|
||||
#. :c:func:`glm_vec3_sqrt`
|
||||
|
||||
Functions documentation
|
||||
@@ -151,6 +153,22 @@ Functions documentation
|
||||
| *[in]* **v** vector
|
||||
| *[out]* **dest** destination vector
|
||||
|
||||
.. c:function:: void glm_vec3_fract(vec3 v, vec3 dest)
|
||||
|
||||
fractional part of each vector item
|
||||
|
||||
Parameters:
|
||||
| *[in]* **v** vector
|
||||
| *[out]* **dest** destination vector
|
||||
|
||||
.. c:function:: void glm_vec3_floor(vec3 v, vec3 dest)
|
||||
|
||||
floor of each vector item
|
||||
|
||||
Parameters:
|
||||
| *[in]* **v** vector
|
||||
| *[out]* **dest** destination vector
|
||||
|
||||
.. c:function:: void glm_vec3_sqrt(vec3 v, vec3 dest)
|
||||
|
||||
square root of each vector item
|
||||
|
@@ -23,6 +23,15 @@ Functions:
|
||||
#. :c:func:`glm_vec4_eqv_eps`
|
||||
#. :c:func:`glm_vec4_max`
|
||||
#. :c:func:`glm_vec4_min`
|
||||
#. :c:func:`glm_vec4_isnan`
|
||||
#. :c:func:`glm_vec4_isinf`
|
||||
#. :c:func:`glm_vec4_isvalid`
|
||||
#. :c:func:`glm_vec4_sign`
|
||||
#. :c:func:`glm_vec4_abs`
|
||||
#. :c:func:`glm_vec4_fract`
|
||||
#. :c:func:`glm_vec4_floor`
|
||||
#. :c:func:`glm_vec4_sqrt`
|
||||
|
||||
|
||||
Functions documentation
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -129,6 +138,30 @@ Functions documentation
|
||||
| *[in]* **v** vector
|
||||
| *[out]* **dest** sign vector (only keeps signs as -1, 0, -1)
|
||||
|
||||
.. c:function:: void glm_vec4_abs(vec4 v, vec4 dest)
|
||||
|
||||
absolute value of each vector item
|
||||
|
||||
Parameters:
|
||||
| *[in]* **v** vector
|
||||
| *[out]* **dest** destination vector (abs(v))
|
||||
|
||||
.. c:function:: void glm_vec4_fract(vec4 v, vec4 dest)
|
||||
|
||||
fractional part of each vector item
|
||||
|
||||
Parameters:
|
||||
| *[in]* **v** vector
|
||||
| *[out]* **dest** destination vector (fract(v))
|
||||
|
||||
.. c:function:: void glm_vec4_floor(vec4 v, vec4 dest)
|
||||
|
||||
floor of each vector item
|
||||
|
||||
Parameters:
|
||||
| *[in]* **v** vector
|
||||
| *[out]* **dest** destination vector (floor(v))
|
||||
|
||||
.. c:function:: void glm_vec4_sqrt(vec4 v, vec4 dest)
|
||||
|
||||
square root of each vector item
|
||||
|
Reference in New Issue
Block a user