Skip to content

struct

ModelRef

pub struct ModelRef {
    pub src: String,
    pub node: Option<String>,
    pub animation: Option<String>,
    pub animation_speed: f32,
    pub looping: bool,
    pub override_material: bool,
}

model: a model file and how to play it.

Fields

src

pub src: String

The model file's URL (glTF, GLB or .wmodel).

node

pub node: Option<String>

Only this node (and what's under it), by name.

animation

pub animation: Option<String>

The animation clip to play, by name or index.

animation_speed

pub animation_speed: f32

How fast the animation plays (1 is normal speed).

looping

pub looping: bool

Whether it starts again when it ends.

override_material

pub override_material: bool

Draw every part with the object's material instead of the model's.

Methods

new

pub fn new(src: &str) -> ModelRef

A model loaded from src.

Trait implementations