mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-16 08:02:36 +00:00
Added Asset Viewer
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user