fmod/core/geometry/
mod.rs1use std::ptr::NonNull;
8
9use fmod_sys::*;
10
11mod general;
12mod polygons;
13mod spatialization;
14
15#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
17#[repr(transparent)] pub struct Geometry {
19 pub(crate) inner: NonNull<FMOD_GEOMETRY>,
20}
21
22#[cfg(not(feature = "thread-unsafe"))]
23unsafe impl Send for Geometry {}
24#[cfg(not(feature = "thread-unsafe"))]
25unsafe impl Sync for Geometry {}
26
27impl Geometry {
28 pub unsafe fn from_ffi(value: *mut FMOD_GEOMETRY) -> Self {
36 let inner = NonNull::new(value).unwrap();
37 Geometry { inner }
38 }
39
40 pub fn as_ptr(self) -> *mut FMOD_GEOMETRY {
42 self.inner.as_ptr()
43 }
44}
45
46impl From<Geometry> for *mut FMOD_GEOMETRY {
47 fn from(value: Geometry) -> Self {
48 value.inner.as_ptr()
49 }
50}