Trait three::object::Object

source ·
pub trait Object: AsRef<Base> {
    type Data;

    fn resolve_data(&self, sync_guard: &SyncGuard<'_>) -> Self::Data;

    fn upcast(&self) -> Base { ... }
    fn set_visible(&self, visible: bool) { ... }
    fn set_name<S: Into<String>>(&self, name: S) { ... }
    fn set_transform<P, Q>(&self, pos: P, rot: Q, scale: f32)
    where
        Self: Sized,
        P: Into<Point3<f32>>,
        Q: Into<Quaternion<f32>>
, { ... } fn set_position<P>(&self, pos: P)
    where
        Self: Sized,
        P: Into<Point3<f32>>
, { ... } fn set_orientation<Q>(&self, rot: Q)
    where
        Self: Sized,
        Q: Into<Quaternion<f32>>
, { ... } fn set_scale(&self, scale: f32) { ... } fn set_weights(&self, weights: Vec<f32>) { ... } fn look_at<E, T>(&self, eye: E, target: T, up: Option<Vector3<f32>>)
    where
        Self: Sized,
        E: Into<Point3<f32>>,
        T: Into<Point3<f32>>
, { ... } }
Expand description

Marks data structures that are able to added to the scene graph.

Required Associated Types

The internal data for the object.

Three-rs objects normally expose a write-only interface, making it possible to change an object’s internal values but not possible to read those values. SyncGuard::resolve_data allows for that data to be read in a controlled way, with. the data for the specific object type determined by the Data trait member.

Each object type has its own internal data, and not all object types can provide access to meaningful data. Types that cannot provide user-facing data will specify () for Data.

Required Methods

Retrieves the internal data for the object.

Prefer to use SyncGuard::resolve_data over calling this directly.

Provided Methods

Converts into the base type.

Invisible objects are not rendered by cameras.

Sets the name of the object.

Set both position, orientation and scale.

Set position.

Set orientation.

Set scale.

Set weights.

Rotates object in the specific direction of target.

Implementors