struct
Object3D
pub struct Object3D {
pub geometry: Geometry,
pub transform: Transform,
pub color: Color,
pub material: Material,
pub motion: Motion,
pub transition_ms: f32,
pub label: Option<String>,
pub parent: Mat4,
pub animation: Option<Tween>,
pub bounds: Option<(Vec3, Vec3)>,
pub cast_shadow: bool,
pub receive_shadow: bool,
}An object in a scene: its geometry, transform, colour and material, motion and animation, label and shadows.
Fields
animation
pub animation: Option<Tween>A GSAP-style tween over x y z rotation-x/y/z scale opacity (start values already resolved), timed from scene start.
Methods
new
pub fn new(primitive: Primitive) -> Object3DAn object of a built-in shape, with the default material and no transform.
of
pub fn of(geometry: Geometry) -> Object3DAn object of geometry, with the default material and no transform.
local_bounds
pub fn local_bounds(&self) -> (Vec3, Vec3)Its local bounding box: the mesh's, what loaded, or a unit box until then.
pose
pub fn pose(&self, t: f32) -> (Transform, Color, f32)The transform, colour and opacity at time t (seconds): the base transform with the tween and continuous motion applied.
pose_from
pub fn pose_from(&self, base: &Transform, color: Color, t: f32) -> (Transform, Color, f32)[Object3D::pose] starting from another base (e.g. mid-transition).
world_matrix
pub fn world_matrix(&self, t: f32) -> Mat4World matrix at time t (enclosing groups, tween and motion).