Struct bevy_mod_picking::RayCastSource[][src]

pub struct RayCastSource<T> {
    pub cast_method: RayCastMethod,
    // some fields omitted
}

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]

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]

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]

Auto Trait Implementations

impl<T> RefUnwindSafe for RayCastSource<T> where
    T: RefUnwindSafe

impl<T> Send for RayCastSource<T> where
    T: Send

impl<T> Sync for RayCastSource<T> where
    T: Sync

impl<T> Unpin for RayCastSource<T> where
    T: Unpin

impl<T> UnwindSafe for RayCastSource<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Component for T where
    T: 'static + Send + Sync

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

impl<T> From<T> for T[src]

impl<T> FromWorld for T where
    T: Default

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,