Struct bevy_mod_picking::RayCastSource [−][src]
The RayCastSource
component is used to generate rays with the specified cast_method
. A ray
is generated when the RayCastSource is initialized, either by waiting for update_raycast system
to process the ray, or by using a with_ray
function.
Fields
cast_method: RayCastMethod
Implementations
impl<T> RayCastSource<T>
[src]
pub fn new() -> RayCastSource<T>
[src]
Instantiates a RayCastSource. It will not be initialized until the update_raycast system
runs, or one of the with_ray
functions is run.
pub fn with_ray_screenspace(
&self,
cursor_pos_screen: Vec2,
windows: &Res<'_, Windows>,
camera: &Camera,
camera_transform: &GlobalTransform
) -> RayCastSource<T>
[src]
&self,
cursor_pos_screen: Vec2,
windows: &Res<'_, Windows>,
camera: &Camera,
camera_transform: &GlobalTransform
) -> RayCastSource<T>
Initializes a RayCastSource with a valid screenspace ray.
pub fn with_ray_transform(&self, transform: Mat4) -> RayCastSource<T>
[src]
Initializes a RayCastSource with a valid ray derived from a transform.
pub fn new_screenspace(
cursor_pos_screen: Vec2,
windows: &Res<'_, Windows>,
camera: &Camera,
camera_transform: &GlobalTransform
) -> RayCastSource<T>
[src]
cursor_pos_screen: Vec2,
windows: &Res<'_, Windows>,
camera: &Camera,
camera_transform: &GlobalTransform
) -> RayCastSource<T>
Instantiates and initializes a RayCastSource with a valid screenspace ray.
pub fn new_transform(transform: Mat4) -> RayCastSource<T>
[src]
Initializes a RayCastSource with a valid ray derived from a transform.
pub fn new_transform_empty() -> RayCastSource<T>
[src]
Instantiates a RayCastSource with RayCastMethod::Transform, and an empty ray. It will not be initialized until the update_raycast system is run and a [GlobalTransform] is present on this entity.
Warning
Only use this if the entity this is associated with will have its [Transform] or [GlobalTransform] specified elsewhere. If the [GlobalTransform] is not set, this ray casting source will never be able to generate a raycast.
pub fn intersect_list(&self) -> Option<&Vec<(Entity, Intersection), Global>>
[src]
pub fn intersect_top(&self) -> Option<(Entity, Intersection)>
[src]
pub fn intersect_primitive(&self, shape: Primitive3d) -> Option<Intersection>
[src]
pub fn ray(&self) -> Option<Ray3d>
[src]
Get a reference to the ray cast source’s ray.
Trait Implementations
impl<T> Default for RayCastSource<T>
[src]
pub fn default() -> RayCastSource<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for RayCastSource<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for RayCastSource<T> where
T: Send,
T: Send,
impl<T> Sync for RayCastSource<T> where
T: Sync,
T: Sync,
impl<T> Unpin for RayCastSource<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for RayCastSource<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Component for T where
T: 'static + Send + Sync,
T: 'static + Send + Sync,
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> From<T> for T
[src]
impl<T> FromWorld for T where
T: Default,
T: Default,
pub fn from_world(_world: &mut World) -> T
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,