1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use crate::bounding_volume;
use crate::bounding_volume::AABB;
use crate::math::{Isometry, Real};
use crate::shape::Segment;
#[cfg(feature = "dim3")]
use crate::shape::{Cone, Cylinder};
#[cfg(feature = "dim3")]
impl Cone {
#[inline]
pub fn aabb(&self, pos: &Isometry<Real>) -> AABB {
bounding_volume::details::support_map_aabb(pos, self)
}
#[inline]
pub fn local_aabb(&self) -> AABB {
bounding_volume::details::local_support_map_aabb(self)
}
}
#[cfg(feature = "dim3")]
impl Cylinder {
#[inline]
pub fn aabb(&self, pos: &Isometry<Real>) -> AABB {
bounding_volume::details::support_map_aabb(pos, self)
}
#[inline]
pub fn local_aabb(&self) -> AABB {
bounding_volume::details::local_support_map_aabb(self)
}
}
impl Segment {
#[inline]
pub fn aabb(&self, pos: &Isometry<Real>) -> AABB {
self.transformed(pos).local_aabb()
}
#[inline]
pub fn local_aabb(&self) -> AABB {
bounding_volume::details::local_support_map_aabb(self)
}
}