pub enum CircularCone<N>where
N: RealField + Copy,{
Full,
Empty,
Spread {
axis: Unit<Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>>,
angle: N,
},
}
Expand description
A cone with a circular basis and its apex at the origin.
A circular cone is a set of half-lines emanating from its apex and forming an angle of at most angle
with its axis
.
It is usually used to bound a set of directions like normals and tangents.
It is convex and have a circular basis.
Variants§
Full
A cone which is the whole space.
Empty
An empty cone containing only the zero vector.
Spread
Fields
axis: Unit<Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>>
The cone axis.
angle: N
Half of the cone apex angle, i.e., the largest angle possible between the axis and a vector contained by this cone.
All the vectors emanating from the origin, with a maximal angle
wrt the given axis
.
Implementations§
source§impl<N> CircularCone<N>where
N: RealField + Copy,
impl<N> CircularCone<N>where N: RealField + Copy,
sourcepub fn from_vectors(
dirs: &[Unit<Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>>]
) -> CircularCone<N>
pub fn from_vectors( dirs: &[Unit<Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>>] ) -> CircularCone<N>
Creates a circular cone from a set of vectors.
sourcepub fn push(
&mut self,
dir: Unit<Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>>
)
pub fn push( &mut self, dir: Unit<Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>> )
Enlarge this cone so it contains dir
too.
sourcepub fn intersects(&self, other: &CircularCone<N>) -> bool
pub fn intersects(&self, other: &CircularCone<N>) -> bool
Returns true
if this cone intersects other
.
sourcepub fn double_cones_intersect(&self, other: &CircularCone<N>) -> bool
pub fn double_cones_intersect(&self, other: &CircularCone<N>) -> bool
Tests if this circular cone, extended to be a double cone, intersects the other
circular cone, also seen as a double cone.
sourcepub fn contains(&self, other: &CircularCone<N>) -> bool
pub fn contains(&self, other: &CircularCone<N>) -> bool
Returns true
if this cone contains other
.
sourcepub fn merge(&mut self, other: &CircularCone<N>)
pub fn merge(&mut self, other: &CircularCone<N>)
Merges this cone with other
in-place.
sourcepub fn merged(&self, other: &CircularCone<N>) -> CircularCone<N>
pub fn merged(&self, other: &CircularCone<N>) -> CircularCone<N>
Merges this cone with other
.
Trait Implementations§
source§impl<N> Clone for CircularCone<N>where
N: Clone + RealField + Copy,
impl<N> Clone for CircularCone<N>where N: Clone + RealField + Copy,
source§fn clone(&self) -> CircularCone<N>
fn clone(&self) -> CircularCone<N>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'de, N> Deserialize<'de> for CircularCone<N>where
N: RealField + Copy + Deserialize<'de>,
impl<'de, N> Deserialize<'de> for CircularCone<N>where N: RealField + Copy + Deserialize<'de>,
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<CircularCone<N>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<CircularCone<N>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
source§impl<N> PartialEq<CircularCone<N>> for CircularCone<N>where
N: PartialEq<N> + RealField + Copy,
impl<N> PartialEq<CircularCone<N>> for CircularCone<N>where N: PartialEq<N> + RealField + Copy,
source§fn eq(&self, other: &CircularCone<N>) -> bool
fn eq(&self, other: &CircularCone<N>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<N> Serialize for CircularCone<N>where
N: RealField + Copy + Serialize,
impl<N> Serialize for CircularCone<N>where N: RealField + Copy + Serialize,
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
impl<N> Copy for CircularCone<N>where N: Copy + RealField,
impl<N> Eq for CircularCone<N>where N: Eq + RealField + Copy,
impl<N> StructuralEq for CircularCone<N>where N: RealField + Copy,
impl<N> StructuralPartialEq for CircularCone<N>where N: RealField + Copy,
Auto Trait Implementations§
impl<N> RefUnwindSafe for CircularCone<N>where N: RefUnwindSafe,
impl<N> Send for CircularCone<N>
impl<N> Sync for CircularCone<N>
impl<N> Unpin for CircularCone<N>where N: Unpin,
impl<N> UnwindSafe for CircularCone<N>where N: UnwindSafe,
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.