mirror of
https://github.com/recp/cglm.git
synced 2026-01-09 23:56:25 +00:00
- Added `ivec3s` type - Struct implementation of: affine.h, box.h, color.h, curve.h, frutum.h, io.h, plane.h, project.h - Deleted `glms_mat3_transpose_to` and `glms_mat4_transpose_to` - Bug fixes in mat4.h
37 lines
654 B
C
37 lines
654 B
C
/*
|
|
* Copyright (c), Recep Aslantas.
|
|
*
|
|
* MIT License (MIT), http://opensource.org/licenses/MIT
|
|
* Full license can be found in the LICENSE file
|
|
*/
|
|
|
|
#ifndef cglm_plane_h
|
|
#define cglm_plane_h
|
|
|
|
#include "common.h"
|
|
#include "vec4.h"
|
|
|
|
/*
|
|
Plane equation: Ax + By + Cz + D = 0;
|
|
|
|
It stored in vec4 as [A, B, C, D]. (A, B, C) is normal and D is distance
|
|
*/
|
|
|
|
/*
|
|
Functions:
|
|
CGLM_INLINE void glm_plane_normalize(vec4 plane);
|
|
*/
|
|
|
|
/*!
|
|
* @brief normalizes a plane
|
|
*
|
|
* @param[in, out] plane plane to normalize
|
|
*/
|
|
CGLM_INLINE
|
|
void
|
|
glm_plane_normalize(vec4 plane) {
|
|
glm_vec4_scale(plane, 1.0f / glm_vec3_norm(plane), plane);
|
|
}
|
|
|
|
#endif /* cglm_plane_h */
|