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
sourceimpl Template
impl Template
sourcepub fn new() -> Template
pub fn new() -> Template
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
Auto Trait Implementations
impl !RefUnwindSafe for Template
impl Send for Template
impl Sync for Template
impl Unpin for Template
impl !UnwindSafe for Template
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Resultwhere
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Resultwhere
T: Parameter<Self>,
value
as a parameter of self
.