pub trait Object: AsRef<Base> {
type Data;
// Required method
fn resolve_data(&self, sync_guard: &SyncGuard<'_>) -> Self::Data;
// Provided methods
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§
Sourcetype Data
type Data
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§
Sourcefn resolve_data(&self, sync_guard: &SyncGuard<'_>) -> Self::Data
fn resolve_data(&self, sync_guard: &SyncGuard<'_>) -> Self::Data
Retrieves the internal data for the object.
Prefer to use SyncGuard::resolve_data
over calling this directly.
Provided Methods§
Sourcefn set_visible(&self, visible: bool)
fn set_visible(&self, visible: bool)
Invisible objects are not rendered by cameras.
Sourcefn set_transform<P, Q>(&self, pos: P, rot: Q, scale: f32)
fn set_transform<P, Q>(&self, pos: P, rot: Q, scale: f32)
Set both position, orientation and scale.
Sourcefn set_orientation<Q>(&self, rot: Q)
fn set_orientation<Q>(&self, rot: Q)
Set orientation.
Sourcefn set_weights(&self, weights: Vec<f32>)
fn set_weights(&self, weights: Vec<f32>)
Set weights.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.