Class: Mittsu::Uniform
- Inherits:
-
Object
- Object
- Mittsu::Uniform
- Defined in:
- lib/mittsu/renderers/shaders/uniforms_lib.rb
Instance Attribute Summary collapse
-
#array ⇒ Object
Returns the value of attribute array.
-
#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.
Constructor Details
#initialize(type, value) ⇒ Uniform
Returns a new instance of Uniform.
7 8 9 10 11 |
# File 'lib/mittsu/renderers/shaders/uniforms_lib.rb', line 7 def initialize(type, value) super() @type, @value = type, value @needs_update = nil end |
Instance Attribute Details
#array ⇒ Object
Returns the value of attribute array.
5 6 7 |
# File 'lib/mittsu/renderers/shaders/uniforms_lib.rb', line 5 def array @array end |
#needs_update ⇒ Object
Returns the value of attribute needs_update.
5 6 7 |
# File 'lib/mittsu/renderers/shaders/uniforms_lib.rb', line 5 def needs_update @needs_update end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/mittsu/renderers/shaders/uniforms_lib.rb', line 5 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/mittsu/renderers/shaders/uniforms_lib.rb', line 5 def value @value end |
Instance Method Details
#clone ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/mittsu/renderers/shaders/uniforms_lib.rb', line 13 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 |