Class: Snow::Mat4
- Inherits:
-
Object
- Object
- Snow::Mat4
- Defined in:
- lib/snow-math/mat4.rb
Instance Method Summary collapse
- #adjoint! ⇒ Object
- #inverse_affine! ⇒ Object
- #inverse_general! ⇒ Object
- #inverse_orthogonal! ⇒ Object
- #multiply(rhs, out = nil) ⇒ Object (also: #*)
- #multiply!(rhs) ⇒ Object
- #multiply_mat4!(rhs) ⇒ Object
- #scale!(x, y, z) ⇒ Object
- #translate!(*args) ⇒ Object
- #transpose! ⇒ Object
Instance Method Details
#adjoint! ⇒ Object
33 34 35 |
# File 'lib/snow-math/mat4.rb', line 33 def adjoint! adjoint self end |
#inverse_affine! ⇒ Object
68 69 70 |
# File 'lib/snow-math/mat4.rb', line 68 def inverse_affine! inverse_affine self end |
#inverse_general! ⇒ Object
72 73 74 |
# File 'lib/snow-math/mat4.rb', line 72 def inverse_general! inverse_general self end |
#inverse_orthogonal! ⇒ Object
29 30 31 |
# File 'lib/snow-math/mat4.rb', line 29 def inverse_orthogonal! inverse_orthogonal self end |
#multiply(rhs, out = nil) ⇒ Object Also known as: *
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/snow-math/mat4.rb', line 41 def multiply(rhs, out = nil) raise "Invalid type for output, must be the same as RHS" if !out.nil? && !out.kind_of?(rhs.class) case rhs when ::Snow::Mat4 then multiply_mat4(rhs, out) when ::Snow::Vec4 then multiply_vec4(rhs, out) when ::Snow::Vec3 then transform_vec3(rhs, out) when Numeric then scale(rhs, rhs, rhs, out) else raise TypeError, "Invalid type for RHS" end end |
#multiply!(rhs) ⇒ Object
52 53 54 55 56 57 58 |
# File 'lib/snow-math/mat4.rb', line 52 def multiply!(rhs) multiply rhs, case rhs when Mat4, Numeric then self when Vec4, Vec3 then rhs else raise TypeError, "Invalid type for RHS" end end |
#multiply_mat4!(rhs) ⇒ Object
37 38 39 |
# File 'lib/snow-math/mat4.rb', line 37 def multiply_mat4!(rhs) multiply_mat4 rhs, self end |
#scale!(x, y, z) ⇒ Object
60 61 62 |
# File 'lib/snow-math/mat4.rb', line 60 def scale!(x, y, z) scale x, y, z, self end |
#translate!(*args) ⇒ Object
64 65 66 |
# File 'lib/snow-math/mat4.rb', line 64 def translate!(*args) translate *args, self end |
#transpose! ⇒ Object
25 26 27 |
# File 'lib/snow-math/mat4.rb', line 25 def transpose! transpose self end |