mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 15:42:35 +00:00
Added main menu, added loading screen, hacked and chiseled things until I could load models without attaching to a gameobject.
This commit is contained in:
@@ -11,12 +11,12 @@ class IMICFPS
|
||||
include Parser
|
||||
|
||||
attr_accessor :objects, :materials, :vertices, :texures, :normals, :faces
|
||||
attr_accessor :x, :y, :z, :scale
|
||||
attr_accessor :x, :y, :z, :scale, :game_object
|
||||
attr_reader :bounding_box
|
||||
|
||||
def initialize(file_path:, game_object:)
|
||||
def initialize(file_path:, game_object: nil)
|
||||
@game_object = game_object
|
||||
update
|
||||
update if @game_object
|
||||
@file_path = file_path
|
||||
@file = File.open(file_path, 'r')
|
||||
@material_file = nil
|
||||
@@ -103,6 +103,10 @@ class IMICFPS
|
||||
def update
|
||||
@x, @y, @z = @game_object.x, @game_object.y, @game_object.z
|
||||
@scale = @game_object.scale
|
||||
# if @scale != @game_object.scale
|
||||
# puts "oops for #{self}: #{@scale} != #{@game_object.scale}"
|
||||
# self.objects.each(&:reflatten) if self.objects && self.objects.count > 0
|
||||
# end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -22,6 +22,20 @@ class IMICFPS
|
||||
# material = index[3]
|
||||
end
|
||||
|
||||
def parent=(game_object)
|
||||
@parent = game_object
|
||||
end
|
||||
|
||||
def reflatten
|
||||
@vertices_list = nil
|
||||
@textures_list = nil
|
||||
@normals_list = nil
|
||||
|
||||
flattened_vertices
|
||||
flattened_textures
|
||||
flattened_normals
|
||||
end
|
||||
|
||||
def at_same_position?
|
||||
if @x == @parent.x
|
||||
if @x == @parent.x
|
||||
|
||||
Reference in New Issue
Block a user