Method: CGLM::Mat3.identity
- Defined in:
- ext/cglm/rb_cglm_mat3.c
.identity([dest]) ⇒ dest | new Mat3
Sets dest to the identity if provided. If omitted, a new Mat4 is created
and set to the identity. dest or the new Mat3 is returned.
8 9 10 11 12 13 14 |
# File 'ext/cglm/rb_cglm_mat3.c', line 8
VALUE rb_cglm_mat3_new_identity(int argc, VALUE *argv, VALUE self) {
VALUE dest;
rb_scan_args(argc, argv, "01", &dest);
if (NIL_P(dest)) dest = MAT3_NEW(ALLOC_MAT3);
glm_mat3_identity(VAL2MAT3(dest));
return dest;
}
|