parry3d/query/ray/simd_ray.rs
1use crate::math::{Point, SimdReal, Vector};
2use crate::query::Ray;
3use simba::simd::SimdValue;
4
5/// A structure representing 4 rays in an SIMD SoA fashion.
6#[derive(Debug, Copy, Clone)]
7pub struct SimdRay {
8 /// The origin of the rays represented as a single SIMD point.
9 pub origin: Point<SimdReal>,
10 /// The direction of the rays represented as a single SIMD vector.
11 pub dir: Vector<SimdReal>,
12}
13
14impl SimdRay {
15 /// Creates a new SIMD ray with all its lanes filled with the same ray.
16 pub fn splat(ray: Ray) -> Self {
17 Self {
18 origin: Point::splat(ray.origin),
19 dir: Vector::splat(ray.dir),
20 }
21 }
22}