Sha256: 23b31dfd2798a07db145bab14fab0233bfa7f73f2008dbb5180ec65184eed610

Contents?: true

Size: 499 Bytes

Versions: 6

Compression:

Stored size: 499 Bytes

Contents

module CyberarmEngine
  class Model
    class Material
      attr_accessor :name, :ambient, :diffuse, :specular
      attr_reader :texture_id

      def initialize(name)
        @name    = name
        @ambient = Color.new(1, 1, 1, 1)
        @diffuse = Color.new(1, 1, 1, 1)
        @specular = Color.new(1, 1, 1, 1)
        @texture = nil
        @texture_id = nil
      end

      def set_texture(texture_path)
        @texture_id = Texture.new(path: texture_path).id
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cyberarm_engine-0.19.0 lib/cyberarm_engine/model/material.rb
cyberarm_engine-0.18.0 lib/cyberarm_engine/model/material.rb
cyberarm_engine-0.17.1 lib/cyberarm_engine/model/material.rb
cyberarm_engine-0.17.0 lib/cyberarm_engine/model/material.rb
cyberarm_engine-0.16.0 lib/cyberarm_engine/model/material.rb
cyberarm_engine-0.15.0 lib/cyberarm_engine/model/material.rb