Added Asset Viewer

This commit is contained in:
2020-01-30 15:30:58 -06:00
parent dbf4edbb93
commit eb1bfe204b
10 changed files with 197 additions and 20 deletions

View File

@@ -11,13 +11,24 @@ class IMICFPS
def initialize(manifest:, map_entity: nil, spawnpoint: nil, backface_culling: true, auto_manage: true)
@manifest = manifest
@position = map_entity ? map_entity.position.clone : spawnpoint.position.clone
@orientation = map_entity ? map_entity.orientation.clone : spawnpoint.orientation.clone
@scale = map_entity ? map_entity.scale.clone : Vector.new(1, 1, 1)
if map_entity
@position = map_entity.position.clone
@orientation = map_entity.orientation.clone
@scale = map_entity.scale.clone
@bound_model = bind_model
elsif spawnpoint
@position = spawnpoint.position.clone
@orientation = spawnpoint.orientation.clone
@scale = Vector.new(1, 1, 1)
else
@position = Vector.new
@orientation = Vector.up
@scale = Vector.new(1, 1, 1)
end
@backface_culling = backface_culling
@name = @manifest.name
@bound_model = map_entity ? bind_model : nil
@visible = true
@renderable = true
@@ -57,7 +68,7 @@ class IMICFPS
end
def bind_model
model = ModelCache.new(manifest: @manifest, entity: @dummy_entity)
model = ModelCache.new(manifest: @manifest)
raise "model isn't a model!" unless model.is_a?(ModelCache)
@bound_model = model