Class: Lightwave::LightwaveObject::TextureLayer
- Inherits:
-
ChunkReader
- Object
- ChunkReader
- Lightwave::LightwaveObject::TextureLayer
- Defined in:
- lib/lightwave.rb
Instance Attribute Summary collapse
-
#aa ⇒ Object
(also: #aa?)
Returns the value of attribute aa.
-
#aa_strength ⇒ Object
Returns the value of attribute aa_strength.
-
#amplitude ⇒ Object
Returns the value of attribute amplitude.
-
#axis ⇒ Object
Bodgetastic.
-
#header ⇒ Object
Bodgetastic.
-
#height_repeat ⇒ Object
Returns the value of attribute height_repeat.
-
#height_wrap ⇒ Object
Returns the value of attribute height_wrap.
-
#image_index ⇒ Object
Returns the value of attribute image_index.
-
#mapping ⇒ Object
Bodgetastic.
-
#ordinal ⇒ Object
Bodgetastic.
-
#pixel_blending ⇒ Object
(also: #pixel_blending?)
Returns the value of attribute pixel_blending.
-
#projection_mode ⇒ Object
Bodgetastic.
-
#sticky ⇒ Object
(also: #sticky?)
Returns the value of attribute sticky.
-
#sticky_time ⇒ Object
Returns the value of attribute sticky_time.
-
#type ⇒ Object
Bodgetastic.
-
#vertex_map_name ⇒ Object
Returns the value of attribute vertex_map_name.
-
#width_repeat ⇒ Object
Returns the value of attribute width_repeat.
-
#width_wrap ⇒ Object
Returns the value of attribute width_wrap.
Attributes inherited from ChunkReader
Instance Method Summary collapse
-
#initialize(strio) ⇒ TextureLayer
constructor
A new instance of TextureLayer.
- #read_aa(c) ⇒ Object
- #read_sticky(c) ⇒ Object
- #read_wraps(c) ⇒ Object
Methods inherited from ChunkReader
chunk_map, #make_defaults, #process_tags, set_chunk_length
Constructor Details
#initialize(strio) ⇒ TextureLayer
Returns a new instance of TextureLayer.
266 267 268 269 270 271 272 273 274 275 276 |
# File 'lib/lightwave.rb', line 266 def initialize(strio) @type, header_chunk = strio.read_chunk(2) @errors = [] if @type != 'IMAP' @errors << TextureError.new("#{@type} (non image-mapped) texture layer found.") end @ordinal = header_chunk.read_string @header = TextureHeader.new(header_chunk) super(strio) end |
Instance Attribute Details
#aa ⇒ Object Also known as: aa?
Returns the value of attribute aa.
232 233 234 |
# File 'lib/lightwave.rb', line 232 def aa @aa end |
#aa_strength ⇒ Object
Returns the value of attribute aa_strength.
232 233 234 |
# File 'lib/lightwave.rb', line 232 def aa_strength @aa_strength end |
#amplitude ⇒ Object
Returns the value of attribute amplitude.
235 236 237 |
# File 'lib/lightwave.rb', line 235 def amplitude @amplitude end |
#axis ⇒ Object
Bodgetastic. Assumes that we’re only ever an IMAP texture block. Must change. The UV file has a NEGA as part of the header. I don’t think that can be right, according to the docs, but it does make sense in context.
228 229 230 |
# File 'lib/lightwave.rb', line 228 def axis @axis end |
#header ⇒ Object
Bodgetastic. Assumes that we’re only ever an IMAP texture block. Must change. The UV file has a NEGA as part of the header. I don’t think that can be right, according to the docs, but it does make sense in context.
228 229 230 |
# File 'lib/lightwave.rb', line 228 def header @header end |
#height_repeat ⇒ Object
Returns the value of attribute height_repeat.
230 231 232 |
# File 'lib/lightwave.rb', line 230 def height_repeat @height_repeat end |
#height_wrap ⇒ Object
Returns the value of attribute height_wrap.
229 230 231 |
# File 'lib/lightwave.rb', line 229 def height_wrap @height_wrap end |
#image_index ⇒ Object
Returns the value of attribute image_index.
229 230 231 |
# File 'lib/lightwave.rb', line 229 def image_index @image_index end |
#mapping ⇒ Object
Bodgetastic. Assumes that we’re only ever an IMAP texture block. Must change. The UV file has a NEGA as part of the header. I don’t think that can be right, according to the docs, but it does make sense in context.
228 229 230 |
# File 'lib/lightwave.rb', line 228 def mapping @mapping end |
#ordinal ⇒ Object
Bodgetastic. Assumes that we’re only ever an IMAP texture block. Must change. The UV file has a NEGA as part of the header. I don’t think that can be right, according to the docs, but it does make sense in context.
228 229 230 |
# File 'lib/lightwave.rb', line 228 def ordinal @ordinal end |
#pixel_blending ⇒ Object Also known as: pixel_blending?
Returns the value of attribute pixel_blending.
233 234 235 |
# File 'lib/lightwave.rb', line 233 def pixel_blending @pixel_blending end |
#projection_mode ⇒ Object
Bodgetastic. Assumes that we’re only ever an IMAP texture block. Must change. The UV file has a NEGA as part of the header. I don’t think that can be right, according to the docs, but it does make sense in context.
228 229 230 |
# File 'lib/lightwave.rb', line 228 def projection_mode @projection_mode end |
#sticky ⇒ Object Also known as: sticky?
Returns the value of attribute sticky.
234 235 236 |
# File 'lib/lightwave.rb', line 234 def sticky @sticky end |
#sticky_time ⇒ Object
Returns the value of attribute sticky_time.
234 235 236 |
# File 'lib/lightwave.rb', line 234 def sticky_time @sticky_time end |
#type ⇒ Object
Bodgetastic. Assumes that we’re only ever an IMAP texture block. Must change. The UV file has a NEGA as part of the header. I don’t think that can be right, according to the docs, but it does make sense in context.
228 229 230 |
# File 'lib/lightwave.rb', line 228 def type @type end |
#vertex_map_name ⇒ Object
Returns the value of attribute vertex_map_name.
231 232 233 |
# File 'lib/lightwave.rb', line 231 def vertex_map_name @vertex_map_name end |
#width_repeat ⇒ Object
Returns the value of attribute width_repeat.
230 231 232 |
# File 'lib/lightwave.rb', line 230 def width_repeat @width_repeat end |
#width_wrap ⇒ Object
Returns the value of attribute width_wrap.
229 230 231 |
# File 'lib/lightwave.rb', line 229 def width_wrap @width_wrap end |
Instance Method Details
#read_aa(c) ⇒ Object
262 263 264 265 |
# File 'lib/lightwave.rb', line 262 def read_aa(c) self.aa = c.read_u2 != 0 self.aa_strength = c.read_float end |
#read_sticky(c) ⇒ Object
255 256 257 258 |
# File 'lib/lightwave.rb', line 255 def read_sticky(c) self.sticky = c.read_u2 != 0 self.sticky_time = c.read_float end |
#read_wraps(c) ⇒ Object
259 260 261 |
# File 'lib/lightwave.rb', line 259 def read_wraps(c) self.width_wrap, self.height_wrap = [c.read_u2, c.read_u2].collect{|i| WRAP_TYPES[i]} end |