Class: Mittsu::Uniform
- Inherits:
-
Object
- Object
- Mittsu::Uniform
- Defined in:
- lib/mittsu/core/uniform.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.
5 6 7 8 9 |
# File 'lib/mittsu/core/uniform.rb', line 5 def initialize(type, value) super() @type, @value = type, value @needs_update = nil end |
Instance Attribute Details
#array ⇒ Object
Returns the value of attribute array.
3 4 5 |
# File 'lib/mittsu/core/uniform.rb', line 3 def array @array end |
#needs_update ⇒ Object
Returns the value of attribute needs_update.
3 4 5 |
# File 'lib/mittsu/core/uniform.rb', line 3 def needs_update @needs_update end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/mittsu/core/uniform.rb', line 3 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/mittsu/core/uniform.rb', line 3 def value @value end |
Instance Method Details
#clone ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/mittsu/core/uniform.rb', line 11 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 |