Class: Mittsu::Uniform
- Inherits:
-
HashObject
- Object
- HashObject
- Mittsu::Uniform
- Defined in:
- lib/mittsu/renderers/shaders/uniforms_lib.rb
Instance Attribute Summary collapse
-
#needs_update ⇒ Object
Returns the value of attribute needs_update.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #clone ⇒ Object
-
#initialize(type, value) ⇒ Uniform
constructor
A new instance of Uniform.
Methods inherited from HashObject
Constructor Details
#initialize(type, value) ⇒ Uniform
Returns a new instance of Uniform.
8 9 10 11 12 |
# File 'lib/mittsu/renderers/shaders/uniforms_lib.rb', line 8 def initialize(type, value) super() @type, @value = type, value @needs_update = nil end |
Instance Attribute Details
#needs_update ⇒ Object
Returns the value of attribute needs_update.
6 7 8 |
# File 'lib/mittsu/renderers/shaders/uniforms_lib.rb', line 6 def needs_update @needs_update end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/mittsu/renderers/shaders/uniforms_lib.rb', line 6 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/mittsu/renderers/shaders/uniforms_lib.rb', line 6 def value @value end |
Instance Method Details
#clone ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/mittsu/renderers/shaders/uniforms_lib.rb', line 14 def clone new_value = case self.value when Color, Vector2, Vector3, Vector4, Matrix4#, Texture # TODO: when Texture exists self.value.clone when Array self.value.dup else self.value end Uniform.new(self.type, new_value) end |