Trait bevy_mod_bounding::BoundingVolume [−][src]
A BoundingVolume stores its properties in mesh space to maximize precision. Because some types of bounding volume must be recomputed if the mesh is scaled or rotated, this trait calls an update function depending on whether the mesh or transform has updated.
Required methods
fn new(mesh: &Mesh, transform: &GlobalTransform) -> Self
[src]
Initializes a valid bounding volume given a [Mesh] and [GlobalTransform].
fn new_debug_mesh(&self, transform: &GlobalTransform) -> Mesh
[src]
Generate a debug [Mesh] representing the bounding volume from a BoundingVolume.
fn update_on_transform_change(
&self,
_mesh: &Mesh,
_transform: &GlobalTransform
) -> Option<Self> where
Self: Sized,
[src]
&self,
_mesh: &Mesh,
_transform: &GlobalTransform
) -> Option<Self> where
Self: Sized,
This function is only called when only the entity’s [GlobalTransform] has changed. Only some types of bounding volume need to be recomputed in this case.
fn outside_plane(
&self,
bound_vol_position: &GlobalTransform,
point: Vec3,
normal: Vec3
) -> bool
[src]
&self,
bound_vol_position: &GlobalTransform,
point: Vec3,
normal: Vec3
) -> bool
Returns true iff the bounding mesh is entirely on the outside of the supplied plane. “Outside” is the direction that the plane normal points to.
Implementors
impl BoundingVolume for Aabb
[src]
fn new(mesh: &Mesh, transform: &GlobalTransform) -> Self
[src]
fn new_debug_mesh(&self, transform: &GlobalTransform) -> Mesh
[src]
fn update_on_transform_change(
&self,
mesh: &Mesh,
transform: &GlobalTransform
) -> Option<Self>
[src]
&self,
mesh: &Mesh,
transform: &GlobalTransform
) -> Option<Self>
fn outside_plane(
&self,
bound_vol_position: &GlobalTransform,
point: Vec3,
normal: Vec3
) -> bool
[src]
&self,
bound_vol_position: &GlobalTransform,
point: Vec3,
normal: Vec3
) -> bool
impl BoundingVolume for Obb
[src]
fn new(mesh: &Mesh, _transform: &GlobalTransform) -> Self
[src]
fn new_debug_mesh(&self, _transform: &GlobalTransform) -> Mesh
[src]
fn update_on_transform_change(
&self,
_mesh: &Mesh,
_transform: &GlobalTransform
) -> Option<Self>
[src]
&self,
_mesh: &Mesh,
_transform: &GlobalTransform
) -> Option<Self>
fn outside_plane(
&self,
bound_vol_position: &GlobalTransform,
point: Vec3,
normal: Vec3
) -> bool
[src]
&self,
bound_vol_position: &GlobalTransform,
point: Vec3,
normal: Vec3
) -> bool
impl BoundingVolume for BSphere
[src]
Create a valid boundary sphere from a mesh and globaltransform.
fn new(mesh: &Mesh, _transform: &GlobalTransform) -> Self
[src]
fn new_debug_mesh(&self, transform: &GlobalTransform) -> Mesh
[src]
Generate a debug mesh, and apply the inverse transform. Because the debug mesh is a child, the transform of the parent will be applied to it. This needs to be negated so the bounding circle debug mesh isn’t warped.
fn update_on_transform_change(
&self,
mesh: &Mesh,
transform: &GlobalTransform
) -> Option<Self>
[src]
&self,
mesh: &Mesh,
transform: &GlobalTransform
) -> Option<Self>
fn outside_plane(
&self,
bound_vol_position: &GlobalTransform,
point: Vec3,
normal: Vec3
) -> bool
[src]
&self,
bound_vol_position: &GlobalTransform,
point: Vec3,
normal: Vec3
) -> bool