Method: CGLM::Vec3#normalize
- Defined in:
- ext/cglm/rb_cglm_vec3.c
#normalize([dest]) ⇒ dest | new Vec3
Normalizes self and places the result into dest. If dest is omitted,
a new Vec3 is allocated. Returns dest.
382 383 384 385 386 387 388 |
# File 'ext/cglm/rb_cglm_vec3.c', line 382 VALUE rb_cglm_vec3_normalize(int argc, VALUE *argv, VALUE self) { VALUE dest; rb_scan_args(argc, argv, "01", &dest); if (NIL_P(dest)) dest = VEC3_NEW(ALLOC_VEC3); glm_vec3_normalize_to(VAL2VEC3(self), VAL2VEC3(dest)); return dest; } |