mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 15:42:35 +00:00
Broken support for textures, trying to switch to opengl-bindings gem
This commit is contained in:
@@ -10,6 +10,12 @@ class IMICFPS
|
||||
@textures = []
|
||||
@normals = []
|
||||
@faces = []
|
||||
|
||||
# Faces array packs everything:
|
||||
# vertex = index[0]
|
||||
# uv = index[1]
|
||||
# normal = index[2]
|
||||
# material = index[3]
|
||||
end
|
||||
|
||||
def flattened_vertices
|
||||
@@ -21,7 +27,7 @@ class IMICFPS
|
||||
list << v.x
|
||||
list << v.y
|
||||
list << v.z
|
||||
# list << v.weight
|
||||
list << v.weight
|
||||
end
|
||||
end
|
||||
|
||||
@@ -71,6 +77,23 @@ class IMICFPS
|
||||
|
||||
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 = list
|
||||
end
|
||||
|
||||
return @textures_list
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user