Moved OBJ parser out of Model, added axis-aligned bounding boxes, added --debug, bounding boxes can be rendered.

This commit is contained in:
2018-03-19 14:35:13 -05:00
parent 30567a9e94
commit a46f3deff9
7 changed files with 261 additions and 281 deletions

View File

@@ -1,7 +1,7 @@
class IMICFPS
class Wavefront
class Object
attr_reader :name, :vertices, :textures, :normals
attr_reader :name, :vertices, :textures, :normals, :bounding_box
attr_accessor :faces
def initialize(name)
@@ -10,6 +10,7 @@ class IMICFPS
@textures = []
@normals = []
@faces = []
@bounding_box = BoundingBox.new(nil,nil,nil, nil,nil,nil)
# Faces array packs everything:
# vertex = index[0]