Added evergreen_tree model, added work-in-progress collada parser, renamed ModelLoader to ModelCache

This commit is contained in:
2020-01-30 11:25:31 -06:00
parent 31f0fa141b
commit 8b35bf037e
13 changed files with 529 additions and 41 deletions

View File

@@ -49,11 +49,11 @@ class IMICFPS
face.uvs = []
face.normals = []
face.colors = []
face.material = material
face.material = current_material
face.smoothing= @model.smoothing
mat = face.material.diffuse
color = Vector.new(mat.red, mat.green, mat.blue)
color = mat
verts.each_with_index do |v, index|
@@ -110,11 +110,6 @@ class IMICFPS
end
end
def change_object(name)
@model.objects << Model::ModelObject.new(name)
@model.current_object = @model.objects.last
end
def set_smoothing(value)
if value == "1"
@model.smoothing = true
@@ -123,20 +118,6 @@ class IMICFPS
end
end
def set_material(name)
@model.current_material = name
end
def material
@model.materials[@model.current_material]
end
def faces_count
count = 0
@model.objects.each {|o| count+=o.faces.count}
return count
end
def add_vertex(array)
@model.vertex_count+=1
vert = nil