#[non_exhaustive]pub struct Contact {
pub a: BodyId,
pub b: ContactPartner,
pub point: Vec3,
pub normal: Vec3,
pub depth: f32,
pub phase: ContactPhase,
}Expand description
A single point at which two things touch. 两样东西相互接触的单个点。
The normal points from a toward b; depth is how far the two shapes
overlap along it. A pair that separates still reports an End contact built
from the last state in which it overlapped, so an application can always
observe both ends of a contact’s lifetime.
法线由 a 指向 b;depth 是两形状沿该方向的重叠量。已经分离的一对仍会报出一个
由最后一次重叠状态构造的 End 接触,因此应用总能观察到一段接触生命周期的两端。
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.a: BodyIdThe Body the normal points away from. 法线背离的那个 Body。
b: ContactPartnerWhat the normal points toward. 法线指向的东西。
point: Vec3The contact point, in world space. 接触点(世界空间)。
normal: Vec3The unit contact normal, pointing from a toward b.
单位接触法线,由 a 指向 b。
depth: f32Penetration depth along the normal. Always positive for a live Contact. 沿法线的穿透深度。存活接触恒为正。
phase: ContactPhaseWhere this Contact is in its lifetime. 该接触在其生命周期中的位置。
Implementations§
Trait Implementations§
impl Copy for Contact
impl StructuralPartialEq for Contact
Auto Trait Implementations§
impl Freeze for Contact
impl RefUnwindSafe for Contact
impl Send for Contact
impl Sync for Contact
impl Unpin for Contact
impl UnsafeUnpin for Contact
impl UnwindSafe for Contact
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