Pack everything as f*? It renders!

This commit is contained in:
2018-03-19 09:40:06 -05:00
parent 6df9f09496
commit b489c48200
4 changed files with 59 additions and 54 deletions

View File

@@ -32,7 +32,7 @@ class IMICFPS
end
@vertices_list_size = list.size
@vertices_list = list.pack("i*")
@vertices_list = list.pack("f*")
end
return @vertices_list
@@ -42,6 +42,44 @@ class IMICFPS
@vertices_list_size
end
def flattened_textures
unless @textures_list
list = []
@faces.each do |face|
[face[1]].each do |v|
next unless v
list << v.x
list << v.y
end
end
@textures_list_size = list.size
@textures_list = list.pack("f*")
end
return @textures_list
end
def flattened_normals
unless @normals_list
list = []
@faces.each do |face|
[face[2]].each do |v|
next unless v
list << v.x
list << v.y
list << v.z
# list << v.weight
end
end
@normals_list_size = list.size
@normals_list = list.pack("f*")
end
return @normals_list
end
def flattened_materials
unless @materials_list
list = []
@@ -59,49 +97,11 @@ class IMICFPS
end
@materials_list_size = list.size
@materials_list = list.pack("i*")
@materials_list = list.pack("f*")
end
return @materials_list
end
def flattened_normals
unless @normals_list
list = []
@faces.each do |face|
[face[2]].each do |v|
next unless v
list << v.x
list << v.y
list << v.z
# list << v.weight
end
end
@normals_list_size = list.size
@normals_list = list.pack("i*")
end
return @normals_list
end
def flattened_textures
unless @textures_list
list = []
@faces.each do |face|
[face[1]].each do |v|
next unless v
list << v.x
list << v.y
end
end
@textures_list_size = list.size
@textures_list = list.pack("i*")
end
return @textures_list
end
end
end
end