mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
mark readonly parameters as const
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
*/
|
||||
CGLM_INLINE
|
||||
float
|
||||
glm_sphere_radii(vec4 s) {
|
||||
glm_sphere_radii(const vec4 s) {
|
||||
return s[3];
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ glm_sphere_radii(vec4 s) {
|
||||
*/
|
||||
CGLM_INLINE
|
||||
void
|
||||
glm_sphere_transform(vec4 s, mat4 m, vec4 dest) {
|
||||
glm_sphere_transform(const vec4 s, const mat4 m, vec4 dest) {
|
||||
glm_mat4_mulv3(m, s, 1.0f, dest);
|
||||
dest[3] = s[3];
|
||||
}
|
||||
@@ -57,7 +57,7 @@ glm_sphere_transform(vec4 s, mat4 m, vec4 dest) {
|
||||
*/
|
||||
CGLM_INLINE
|
||||
void
|
||||
glm_sphere_merge(vec4 s1, vec4 s2, vec4 dest) {
|
||||
glm_sphere_merge(const vec4 s1, const vec4 s2, vec4 dest) {
|
||||
float dist, radii;
|
||||
|
||||
dist = glm_vec3_distance(s1, s2);
|
||||
@@ -78,7 +78,7 @@ glm_sphere_merge(vec4 s1, vec4 s2, vec4 dest) {
|
||||
*/
|
||||
CGLM_INLINE
|
||||
bool
|
||||
glm_sphere_sphere(vec4 s1, vec4 s2) {
|
||||
glm_sphere_sphere(const vec4 s1, const vec4 s2) {
|
||||
return glm_vec3_distance2(s1, s2) <= glm_pow2(s1[3] + s2[3]);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ glm_sphere_sphere(vec4 s1, vec4 s2) {
|
||||
*/
|
||||
CGLM_INLINE
|
||||
bool
|
||||
glm_sphere_point(vec4 s, vec3 point) {
|
||||
glm_sphere_point(const vec4 s, const vec3 point) {
|
||||
float rr;
|
||||
rr = s[3] * s[3];
|
||||
return glm_vec3_distance2(point, s) <= rr;
|
||||
|
||||
Reference in New Issue
Block a user