pub struct Cylinder {
pub p1: Vec3,
pub dir: Vec3,
pub radius: f32,
/* private fields */
}Fields§
§p1: Vec3§dir: Vec3§radius: f32Implementations§
Source§impl Cylinder
impl Cylinder
pub const fn new(p1: Vec3, p2: Vec3, radius: f32) -> Self
Sourcepub fn from_center_orientation(
center: DVec3,
orientation: DMat3,
radius: f64,
length: f64,
) -> Self
pub fn from_center_orientation( center: DVec3, orientation: DMat3, radius: f64, length: f64, ) -> Self
Create a Cylinder from center, orientation (DMat3), radius, and length.
The cylinder axis is along the orientation’s Y column.
Sourcepub fn to_center_orientation_length(&self) -> (DVec3, DMat3, f64)
pub fn to_center_orientation_length(&self) -> (DVec3, DMat3, f64)
Extract center, orientation (DMat3), and length from this cylinder.
pub fn p2(&self) -> Vec3
pub fn bounding_sphere(&self) -> (Vec3, f32)
Sourcepub fn point_dist_sq(&self, p: Vec3) -> f32
pub fn point_dist_sq(&self, p: Vec3) -> f32
Squared distance from a point to the nearest point on the cylinder surface/interior.
Sourcepub fn contains_point(&self, p: Vec3) -> bool
pub fn contains_point(&self, p: Vec3) -> bool
Returns true if the point lies inside or on the cylinder surface.
Source§impl Cylinder
impl Cylinder
Sourcepub fn broadphase(&self) -> Sphere
pub fn broadphase(&self) -> Sphere
Sourcepub fn obb(&self) -> Cuboid
pub fn obb(&self) -> Cuboid
See Bounded::obb
Sourcepub fn aabb(&self) -> Cuboid
pub fn aabb(&self) -> Cuboid
See Bounded::aabb
Trait Implementations§
Source§impl<PCL: PointCloudMarker> ColliderComponent<PCL> for Cylinder
impl<PCL: PointCloudMarker> ColliderComponent<PCL> for Cylinder
fn add_to_shapes(self, c: &mut Collider<PCL>)
Source§impl ColliderQuery<NoPcl> for Cylinder
impl ColliderQuery<NoPcl> for Cylinder
Source§impl ColliderQuery<Pointcloud> for Cylinder
impl ColliderQuery<Pointcloud> for Cylinder
fn query_collider(&self, c: &Collider<Pointcloud>) -> bool
Source§impl Collides<ConvexPolygon> for Cylinder
impl Collides<ConvexPolygon> for Cylinder
Source§impl Collides<ConvexPolytope> for Cylinder
impl Collides<ConvexPolytope> for Cylinder
Source§impl Collides<Cylinder> for ConvexPolygon
impl Collides<Cylinder> for ConvexPolygon
Source§impl Collides<Cylinder> for ConvexPolytope
impl Collides<Cylinder> for ConvexPolytope
Source§impl Collides<Cylinder> for LineSegment
impl Collides<Cylinder> for LineSegment
Source§impl Collides<Cylinder> for Pointcloud
impl Collides<Cylinder> for Pointcloud
Source§impl Collides<LineSegment> for Cylinder
impl Collides<LineSegment> for Cylinder
Source§impl Collides<Pointcloud> for Cylinder
impl Collides<Pointcloud> for Cylinder
Source§impl Stretchable for Cylinder
impl Stretchable for Cylinder
Source§impl Transformable for Cylinder
impl Transformable for Cylinder
fn translate(&mut self, offset: Vec3A)
fn rotate_mat(&mut self, mat: Mat3A)
fn rotate_quat(&mut self, quat: Quat)
fn transform(&mut self, mat: Affine3A)
fn translated(self, offset: Vec3A) -> Self
fn translate_d(&mut self, offset: DVec3)
fn translated_d(self, offset: DVec3) -> Self
fn rotated_mat(self, mat: Mat3A) -> Self
fn rotate_mat_d(&mut self, mat: DMat3)
fn rotated_mat_d(self, mat: DMat3) -> Self
fn rotated_quat(self, quat: Quat) -> Self
fn rotate_quat_d(&mut self, quat: DQuat)
fn rotated_quat_d(self, quat: DQuat) -> Self
fn transformed(self, mat: Affine3A) -> Self
fn transform_d(&mut self, mat: DAffine3)
fn transformed_d(self, mat: DAffine3) -> Self
impl Copy for Cylinder
impl StructuralPartialEq for Cylinder
Auto Trait Implementations§
impl Freeze for Cylinder
impl RefUnwindSafe for Cylinder
impl Send for Cylinder
impl Sync for Cylinder
impl Unpin for Cylinder
impl UnsafeUnpin for Cylinder
impl UnwindSafe for Cylinder
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