Method: CGLM::Mat4#invert

Defined in:
ext/cglm/rb_cglm_mat4.c

#invert([dest]) ⇒ dest | new Mat4

Computes the inverse of this matrix and stores it in dest, creating a new Mat4 if dest is omitted. Returns dest.

Returns:



152
153
154
155
156
157
158
# File 'ext/cglm/rb_cglm_mat4.c', line 152

VALUE rb_cglm_mat4_invert(int argc, VALUE *argv, VALUE self) {
  VALUE dest;
  rb_scan_args(argc, argv, "01", &dest);
  if (NIL_P(dest)) dest = MAT4_NEW(ALLOC_MAT4);
  glm_mat4_inv(VAL2MAT4(self), VAL2MAT4(dest));
  return dest;
}