Struct re_renderer::draw_phases::picking_layer::PickingResult
source · pub struct PickingResult<T: 'static + Send + Sync> {
pub user_data: T,
pub rect: RectInt,
pub picking_id_data: Vec<PickingLayerId>,
pub picking_depth_data: Vec<f32>,
world_from_cropped_projection: Mat4,
}
Expand description
GPU retrieved & processed picking data result.
Fields§
§user_data: T
User data supplied on picking request.
rect: RectInt
Picking rect supplied on picking request. Describes the area of the picking layer that was read back.
picking_id_data: Vec<PickingLayerId>
Picking id data for the requested rectangle.
GPU internal row padding has already been removed from this buffer. Pixel data is stored in the normal fashion - row wise, left to right, top to bottom.
picking_depth_data: Vec<f32>
Picking depth data for the requested rectangle.
Use PickingResult::picked_world_position
for easy interpretation of the data.
GPU internal row padding has already been removed from this buffer. Pixel data is stored in the normal fashion - row wise, left to right, top to bottom.
world_from_cropped_projection: Mat4
Transforms a NDC position on the picking rect to a world position.
Implementations§
source§impl<T: 'static + Send + Sync> PickingResult<T>
impl<T: 'static + Send + Sync> PickingResult<T>
sourcepub fn picked_world_position(&self, pos_on_picking_rect: UVec2) -> Vec3
pub fn picked_world_position(&self, pos_on_picking_rect: UVec2) -> Vec3
Returns the picked world position.
Panics if the position is outside of the picking rect.
Keep in mind that the picked position may be (negative) infinity if nothing was picked.
sourcepub fn picked_id(&self, pos_on_picking_rect: UVec2) -> PickingLayerId
pub fn picked_id(&self, pos_on_picking_rect: UVec2) -> PickingLayerId
Returns the picked picking id.
Panics if the position is outside of the picking rect.
Auto Trait Implementations§
impl<T> Freeze for PickingResult<T>where
T: Freeze,
impl<T> RefUnwindSafe for PickingResult<T>where
T: RefUnwindSafe,
impl<T> Send for PickingResult<T>
impl<T> Sync for PickingResult<T>
impl<T> Unpin for PickingResult<T>where
T: Unpin,
impl<T> UnwindSafe for PickingResult<T>where
T: UnwindSafe,
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
§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 more