pub fn raycast(
        &self,
        whitelist: Vec<usize>,
        near: Vector3<f32>,
        far: Vector3<f32>,
    ) -> Option<Entity> {
        let origin = NPoint3::new(near.x, near.y, near.z);
        let dir = NVector3::new(far.x - near.x, far.y - near.y, far.z - near.z).normalize();
        let ray = Ray::new(origin, dir);
        let toi = 500.0; //TODO: Decide a good time of impact (currently just a big number)
        let mut groups = CollisionGroups::new();

        if !whitelist.is_empty() {
            groups.set_whitelist(&whitelist);
        }

        self.0
            .first_interference_with_ray(&ray, toi, &groups)
            .map(|result| *result.co.data())
    }
/// Note: If the whitelist is empty,
/// then the whitelist is set to ALL groups.
If the whitelist is empty,
then the whitelist is set to ALL groups.
If the whitelist is empty then the whitelist is set to ALL groups .
pub fn raycast(
        &self,
        whitelist: Vec<usize>,
        near: Vector3<f32>,
        far: Vector3<f32>,
    ) -> Option<Entity> {
        let origin = NPoint3::new(near.x, near.y, near.z);
        let dir = NVector3::new(far.x - near.x, far.y - near.y, far.z - near.z).normalize();
        let ray = Ray::new(origin, dir);
        let toi = 500.0; //TODO: Decide a good time of impact (currently just a big number)
        let mut groups = CollisionGroups::new();
        if !whitelist.is_empty() {
            groups.set_whitelist(&whitelist);
        }
        self.0
            .first_interference_with_ray(&ray, toi, &groups)
            .map(|result| *result.co.data())
    }
pub fn raycast ( & self , whitelist : Vec < usize > , near : Vector3 < f32 > , far : Vector3 < f32 > , ) -> Option < Entity > { let origin = NPoint3 :: new ( near . x , near . y , near . z ) ; let dir = NVector3 :: new ( far . x - near . x , far . y - near . y , far . z - near . z ) . normalize ( ) ; let ray = Ray :: new ( origin , dir ) ; let toi = 500.0 ; //TODO: Decide a good time of impact (currently just a big number) let mut groups = CollisionGroups :: new ( ) ; if ! whitelist . is_empty ( ) { groups . set_whitelist ( & whitelist ) ; } self . 0 . first_interference_with_ray ( & ray , toi , & groups ) . map ( | result | * result . co . data ( ) ) }
Note: If the whitelist is empty,
then the whitelist is set to ALL groups.
Note : If the whitelist is empty then the whitelist is set to ALL groups .
&self
whitelist
Vec<usize>
near
Vector3<f32>
far
Vector3<f32>
&self
whitelist
Vec<usize>
near
Vector3<f32>
far
Vector3<f32>