intrude import depth_core
intrude import flat
-# Simple material with static colors used for debugging or display abstract objects
-class SmoothMaterial
- super Material
-
+redef class Material
# Get the default blueish material
- init default do init(
+ new do return new SmoothMaterial(
[0.0, 0.0, 0.3, 1.0],
[0.0, 0.0, 0.6, 1.0],
[1.0, 1.0, 1.0, 1.0])
+end
+
+# Simple material with static colors used for debugging or display abstract objects
+class SmoothMaterial
+ super Material
# Ambient color, always visible
var ambient_color: Array[Float] is writable
var content = text_asset.to_s
if content.is_empty then
print_error "Model failed to load: Asset empty at '{self.path}'"
- leaves.add new LeafModel(new Cube, new SmoothMaterial.default)
+ leaves.add new LeafModel(new Cube, new Material)
return
end
var obj_def = parser.parse
if obj_def == null then
print_error "Model failed to load: .obj format error on '{self.path}'"
- leaves.add new LeafModel(new Cube, new SmoothMaterial.default)
+ leaves.add new LeafModel(new Cube, new Material)
return
end
# Create models and store them
for mesh, mtl_def in mesh_to_mtl do
var material = materials.get_or_null(mtl_def)
- if material == null then material = new SmoothMaterial.default
+ if material == null then material = new Material
var model = new LeafModel(mesh, material)
array.add model
# Blue cube of 1 unit on each side, acting as placeholder for models failing to load
#
# This model can be freely used by any `Actor` as placeholder or for debugging.
- var placeholder_model = new LeafModel(new Cube, new SmoothMaterial.default) is lazy
+ var placeholder_model = new LeafModel(new Cube, new Material) is lazy
end