Struct three::template::Template

source ·
pub struct Template {
    pub name: Option<String>,
    pub objects: Vec<ObjectTemplate>,
    pub groups: Vec<usize>,
    pub cameras: Vec<CameraTemplate>,
    pub meshes: Vec<MeshTemplate>,
    pub lights: Vec<LightTemplate>,
    pub bones: Vec<BoneTemplate>,
    pub skeletons: Vec<usize>,
    pub animations: Vec<AnimationTemplate>,
}
Expand description

A template representing a hierarchy of objects.

To create an instance of the template that can be added to your scene, use Factory::instantiate_template. For more information about the templating system and how to use it, see the module documentation.

Fields

name: Option<String>

An optional name for the template.

objects: Vec<ObjectTemplate>

The base object data for all objects defined in the template.

The index into this array is used to uniquely identify each object in the template. Each object, regardless of its concrete type, will be represented in this array exactly once. These indices are primarily used in AnimationTemplate to define the target of each track of the animation.

groups: Vec<usize>

Definitions for all Group objects in the template, given as indices into objects.

Groups carry no data beyond the common object data, so groups are defined soley by their ObjectTemplate.

cameras: Vec<CameraTemplate>

Projection data used by cameras defined in the template.

meshes: Vec<MeshTemplate>

The meshes defined in this template.

lights: Vec<LightTemplate>

Data for the lights described by this template.

bones: Vec<BoneTemplate>

Data for the bones described by this template.

skeletons: Vec<usize>

Definitions for all Skeleton objects in the template, given as indices into objects.

Skeletons carry no data beyond the common object data, so groups are defined soley by their ObjectTemplate.

animations: Vec<AnimationTemplate>

Templates for animation clips that target objects instantiated from this template.

Implementations

Creates an empty template.

Examples

Create an empty template and then instantiate it, effectively the most verbose way to call Factory::group:

use three::template::Template;

let template = Template::new();
let (group, animations) = window.factory.instantiate_template(&template);

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Sets value as a parameter of self.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.