pub struct Ray {
pub origin: Vec3A,
pub direction: Vec3A,
}Fields§
§origin: Vec3A§direction: Vec3AImplementations§
Source§impl Ray
impl Ray
pub fn new(origin: impl Into<Vec3A>, direction: impl Into<Vec3A>) -> Self
Sourcepub fn from_ndc(ndc: Vec2, view_proj_inv: Mat4) -> Self
pub fn from_ndc(ndc: Vec2, view_proj_inv: Mat4) -> Self
NDC (Normalized Device Coordinates) uzayından 3B Dünya (World) uzayına bir Ray oluşturur.
ndc: [-1.0, 1.0] aralığında ekran koordinatları.
view_proj_inv: (Projection * View) matrisinin tersi.
Sourcepub fn at(self, t: f32) -> Vec3A
pub fn at(self, t: f32) -> Vec3A
Işının uzayda t uzaklığındaki ulaştığı (çarpıştığı) kesin noktayı hesaplar.
Sourcepub fn intersect_bounds(self, min: Vec3A, max: Vec3A) -> Option<f32>
pub fn intersect_bounds(self, min: Vec3A, max: Vec3A) -> Option<f32>
Bir eksen kısıtlı boundary kutusuyla kesişim testi yapar (Slab Algorithm). Kesişiyorsa t_near mesafesini döner, kesişmiyorsa None döner.
Sourcepub fn intersect_aabb(self, aabb: Aabb) -> Option<f32>
pub fn intersect_aabb(self, aabb: Aabb) -> Option<f32>
Bir Aabb nesnesiyle (Axis-Aligned Bounding Box) doğrudan kesişim testi yapar.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Ray
impl RefUnwindSafe for Ray
impl Send for Ray
impl Sync for Ray
impl Unpin for Ray
impl UnsafeUnpin for Ray
impl UnwindSafe for Ray
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
Mutably borrows from an owned value. Read more