Method: CGLM::Plane#normalize
- Defined in:
- ext/cglm/rb_cglm_plane.c
#normalize([dest]) ⇒ dest | new Plane
Normalizes this plane and places the result in dest, or allocates a new
Plane if dest is omitted.
8 9 10 11 12 13 14 15 |
# File 'ext/cglm/rb_cglm_plane.c', line 8
VALUE rb_cglm_plane_normalize(int argc, VALUE *argv, VALUE self) {
VALUE dest;
rb_scan_args(argc, argv, "01", &dest);
if (NIL_P(dest)) dest = PLANE_NEW(ALLOC_PLANE);
memcpy(&(VAL2VEC4(self)), &(VAL2VEC4(dest)), sizeof(vec4));
glm_plane_normalize(VAL2VEC4(dest));
return dest;
}
|