gamnit :: Model :: defaultinit
# 3D model composed of `Mesh` and `Material`, loaded from the assets folder by default
#
# Instances can be created at any time and must be loaded after or at the end of `create_scene`.
# If loading fails, the model is replaced by `placeholder_model`.
#
# ~~~
# import gamnit::depth
#
# var model = new Model("path/in/assets.obj")
# model.load
# ~~~
#
# The most simple model is `LeafModel`, composed of a single `Mesh` and `Material`.
# It can be easily created programmatically to display simple geometries.
# Whereas `CompositeModel` is composed of one or many `LeafModel` and is usually
# loaded from the assets folder as a `ModelAsset`.
# Instances of `ModelAsset` must be in the format OBJ and MAT,
# and their texture in PNG or JPG.
abstract class Model
# Load this model in memory
fun load do end
# Errors raised at loading
var errors = new Array[Error]
# All `LeafModel` composing this model
#
# Usually, there is one `LeafModel` per material.
# At each frame, each material is asked to draw all the live `LeafModel` instaces.
fun leaves: Array[LeafModel] is abstract
# Sub-models with names, usually declared in the asset file
var named_parts = new Map[Text, Model]
end
lib/gamnit/depth/depth_core.nit:85,1--119,3