Method: CGLM::Vec3#signs
- Defined in:
- ext/cglm/rb_cglm_vec3.c
#signs([dest]) ⇒ dest | new Vec3
Places +1, 0 or -1 into each component of dest based on whether the
corresponding component of this Vec3 is positive, 0/NaN, or negative.
If dest is omitted, a new Vec3 is created and returned.
745 746 747 748 749 750 751 |
# File 'ext/cglm/rb_cglm_vec3.c', line 745
VALUE rb_cglm_vec3_signs(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_sign(VAL2VEC3(self), VAL2VEC3(dest));
return dest;
}
|