Skip to main content

Scene

Struct Scene 

Source
pub struct Scene {
    pub meshes: Vec<PlayerMesh>,
    pub nodes: Vec<PlayerNode>,
    pub cameras: HashMap<String, Camera>,
    pub step_images: HashMap<String, String>,
    pub thumbnails: HashMap<String, String>,
    pub poses: HashMap<String, Vec<Pose>>,
    pub pmi: HashMap<String, PlayerPmi>,
    pub arrows: HashMap<String, Vec<Arrow>>,
    pub assembly: Vec<PlayerComponent>,
    pub wrapper: String,
}
Expand description

What the caller supplies beside the block: the meshes and nodes of the assembly as placed, each step’s camera and picture, and part thumbnails.

Fields§

§meshes: Vec<PlayerMesh>§nodes: Vec<PlayerNode>§cameras: HashMap<String, Camera>§step_images: HashMap<String, String>§thumbnails: HashMap<String, String>§poses: HashMap<String, Vec<Pose>>

Each step’s explode poses, by step id.

§pmi: HashMap<String, PlayerPmi>

Each step’s view PMI, by step id.

§arrows: HashMap<String, Vec<Arrow>>

The arrows a step’s parts come home along when they are not the step’s own (a Line art step without arrows gets one per part from the engine), by step id; a step not listed uses its own arrows.

§assembly: Vec<PlayerComponent>

The assembly’s occurrence tree (PlayerComponent::rows); each row’s thumbnail is taken from thumbnails by its part.

§wrapper: String

The wrapper occurrence the instructions place the assembly under (ACOMP1): a step’s motion, keyed by the assembly’s own occurrences, is re-keyed under it. Empty when the nodes are the assembly’s own.

Implementations§

Source§

impl Scene

Source

pub fn share_meshes( &mut self, keys: &[String], placements: &[Option<[f64; 16]>], )

One mesh per part. keys is one key per node (its part and member) and placements one optional placement per node (column-major, the engine’s pose of the occurrence in the world). Among the nodes of one key, the first is the reference:

  • with placements, its mesh is made part-local (its vertices taken back through its placement, normals through the rotation) and every placed node of the key shares it, each carrying its own placement as its matrix, whatever that copy’s own tessellation was;
  • without, a node whose mesh is the same tessellation as the reference’s moved rigidly shares it and carries the rigid move, decided by the vertices themselves (the same index order and count, every vertex within RIGID_FIT_TOLERANCE of the fit), so a mirrored or re-tessellated copy keeps its own.

Meshes left unreferenced are dropped and the rest renumbered.

Trait Implementations§

Source§

impl Clone for Scene

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Scene

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Scene

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for Scene

§

impl Freeze for Scene

§

impl Move for Scene

§

impl RefUnwindSafe for Scene

§

impl Send for Scene

§

impl Sync for Scene

§

impl Unpin for Scene

§

impl UnsafeUnpin for Scene

§

impl UnwindSafe for Scene

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.