Struct Model
pub struct Model {
pub unique_material: Option<bool>,
pub is_child: bool,
/* private fields */
}Expand description
Describes a glTF/GLB model object.
Fields§
§unique_material: Option<bool>Whether the material properties of the object are uniquely copied.
is_child: boolWhether this model is a child of another model.
Implementations§
§impl Model
impl Model
pub fn new(identifier: &str, unique_material: Option<bool>) -> Self
pub fn new(identifier: &str, unique_material: Option<bool>) -> Self
Creates a top-level model write-access helper.
pub fn with_base(
identifier: &str,
base: &str,
unique_material: Option<bool>,
) -> Self
pub fn with_base( identifier: &str, base: &str, unique_material: Option<bool>, ) -> Self
Creates a model write-access helper nested under base.
pub fn material(&self) -> Result<MeshStandardMaterial>
pub fn material(&self) -> Result<MeshStandardMaterial>
Access the material property of the model object.
Returns Error::Runtime if unique_material was not explicitly set.
Methods from Deref<Target = Obj>§
pub fn quaternion(&self) -> Xyzw
pub fn quaternion(&self) -> Xyzw
Access the quaternion of the object.
pub fn visible(&self, value: bool) -> Instruction
pub fn visible(&self, value: bool) -> Instruction
Access the visibility of the object.
pub fn parent(&self, parent: Option<&Obj>) -> Instruction
pub fn parent(&self, parent: Option<&Obj>) -> Instruction
Attach the object to a parent, or detach it when parent is None.
pub fn render_order(&self, value: f64) -> Instruction
pub fn render_order(&self, value: f64) -> Instruction
Writes the render order, overriding the default draw-order sort. Mainly relevant for transparent objects without depth writing, where draw order (not depth) determines blending order against other transparent objects.
pub fn render_order_recursive(&self, value: f64) -> Instruction
pub fn render_order_recursive(&self, value: f64) -> Instruction
Writes the render order recursively to every descendant. renderOrder
does not cascade to children in the browser dispatcher’s underlying
renderer, unlike most other object properties.
pub fn material(&self) -> MaterialHelper
pub fn material(&self) -> MaterialHelper
Access the material property of the object.