pub struct TransformContext {
space_origin: EntityPath,
transform_per_entity: IntMap<EntityPath, TransformInfo>,
unreachable_descendants: Vec<(EntityPath, UnreachableTransformReason)>,
first_unreachable_parent: Option<(EntityPath, UnreachableTransformReason)>,
}
Expand description
Provides transforms from an entity to a chosen reference space for all elements in the scene for the currently selected time & timeline.
The renderer then uses this reference space as its world space, making world and reference space equivalent for a given space view.
Should be recomputed every frame.
TODO(#7025): Alternative proposal to not have to deal with tree upwards walking & per-origin tree walking.
Fields§
§space_origin: EntityPath
All transforms provided are relative to this reference path.
transform_per_entity: IntMap<EntityPath, TransformInfo>
All reachable entities.
unreachable_descendants: Vec<(EntityPath, UnreachableTransformReason)>
All unreachable descendant paths of reference_path
.
first_unreachable_parent: Option<(EntityPath, UnreachableTransformReason)>
The first parent of reference_path
that is no longer reachable.
Implementations§
source§impl TransformContext
impl TransformContext
sourcefn gather_parent_transforms<'a>(
&mut self,
ctx: &'a ViewContext<'a>,
query: &ViewQuery<'_>,
current_tree: &'a EntityTree,
time_query: &LatestAtQuery
)
fn gather_parent_transforms<'a>( &mut self, ctx: &'a ViewContext<'a>, query: &ViewQuery<'_>, current_tree: &'a EntityTree, time_query: &LatestAtQuery )
Gather transforms for everything above the root.
fn gather_descendants_transforms( &mut self, ctx: &ViewContext<'_>, view_query: &ViewQuery<'_>, subtree: &EntityTree, entity_db: &EntityDb, query: &LatestAtQuery, transform: TransformInfo )
pub fn reference_path(&self) -> &EntityPath
sourcepub fn transform_info_for_entity(
&self,
ent_path: &EntityPath
) -> Option<&TransformInfo>
pub fn transform_info_for_entity( &self, ent_path: &EntityPath ) -> Option<&TransformInfo>
Retrieves transform information for a given entity.
Returns None
if it’s not reachable from the view’s origin.
Trait Implementations§
source§impl Clone for TransformContext
impl Clone for TransformContext
source§fn clone(&self) -> TransformContext
fn clone(&self) -> TransformContext
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Default for TransformContext
impl Default for TransformContext
source§impl IdentifiedViewSystem for TransformContext
impl IdentifiedViewSystem for TransformContext
source§fn identifier() -> ViewSystemIdentifier
fn identifier() -> ViewSystemIdentifier
crate::SpaceViewClass
. Read moresource§impl ViewContextSystem for TransformContext
impl ViewContextSystem for TransformContext
source§fn execute(&mut self, ctx: &ViewContext<'_>, query: &ViewQuery<'_>)
fn execute(&mut self, ctx: &ViewContext<'_>, query: &ViewQuery<'_>)
Determines transforms for all entities relative to a space path which serves as the “reference”. I.e. the resulting transforms are “reference from scene”
This means that the entities in reference_space
get the identity transform and all other
entities are transformed relative to it.
source§fn compatible_component_sets(&self) -> Vec<ComponentNameSet>
fn compatible_component_sets(&self) -> Vec<ComponentNameSet>
source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
std::any::Any
, which enables downcasting to concrete types.Auto Trait Implementations§
impl Freeze for TransformContext
impl RefUnwindSafe for TransformContext
impl Send for TransformContext
impl Sync for TransformContext
impl Unpin for TransformContext
impl UnwindSafe for TransformContext
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request