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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
use crate::Box;
use crate::Point3D;
use crate::Sphere;
use glib::translate::*;
glib::wrapper! {
pub struct Frustum(BoxedInline<ffi::graphene_frustum_t>);
match fn {
copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::graphene_frustum_get_type(), ptr as *mut _) as *mut ffi::graphene_frustum_t,
free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::graphene_frustum_get_type(), ptr as *mut _),
type_ => || ffi::graphene_frustum_get_type(),
}
}
impl Frustum {
#[doc(alias = "graphene_frustum_contains_point")]
pub fn contains_point(&self, point: &Point3D) -> bool {
unsafe {
ffi::graphene_frustum_contains_point(self.to_glib_none().0, point.to_glib_none().0)
}
}
#[doc(alias = "graphene_frustum_equal")]
fn equal(&self, b: &Frustum) -> bool {
unsafe { ffi::graphene_frustum_equal(self.to_glib_none().0, b.to_glib_none().0) }
}
#[doc(alias = "graphene_frustum_intersects_box")]
pub fn intersects_box(&self, box_: &Box) -> bool {
unsafe {
ffi::graphene_frustum_intersects_box(self.to_glib_none().0, box_.to_glib_none().0)
}
}
#[doc(alias = "graphene_frustum_intersects_sphere")]
pub fn intersects_sphere(&self, sphere: &Sphere) -> bool {
unsafe {
ffi::graphene_frustum_intersects_sphere(self.to_glib_none().0, sphere.to_glib_none().0)
}
}
}
impl PartialEq for Frustum {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.equal(other)
}
}
impl Eq for Frustum {}