Skip to content

enum

Geometry

pub enum Geometry {
    Primitive(Primitive),
    Text(TextSpec),
    Model(ModelRef),
    Mesh(Arc<Mesh>),
}

What an object is made of.

Variants

Primitive

Primitive(Primitive)

A built-in shape.

Text

Text(TextSpec)

Text from a font's outlines.

Model

Model(ModelRef)

A model file (glTF/GLB, OBJ, STL, PLY, .wmodel), loaded by URL.

Mesh

Mesh(Arc<Mesh>)

A mesh made in code.

Methods

kind

pub fn kind(&self) -> &'static str

The DSL element it came from.

primitive

pub fn primitive(&self) -> Option<Primitive>

The built-in shape, if it is one.

mesh

pub fn mesh(&self) -> Option<Mesh>

The mesh, when it's known without loading anything.

asset

pub fn asset(&self) -> Option<&str>

The URL it needs loaded first, if any.

Trait implementations