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
use crate::{owner::Owner, traits::Class};
use physx_sys::PxConstraint_release_mut;
#[repr(transparent)]
pub struct Constraint {
obj: physx_sys::PxConstraint,
}
crate::DeriveClassForNewType!(Constraint: PxConstraint, PxBase);
impl Constraint {
#[allow(dead_code)]
pub(crate) unsafe fn from_raw(ptr: *mut physx_sys::PxConstraint) -> Option<Owner<Self>> {
unsafe { Owner::from_raw(ptr as *mut Self) }
}
}
unsafe impl Send for Constraint {}
unsafe impl Sync for Constraint {}
impl Drop for Constraint {
fn drop(&mut self) {
unsafe { PxConstraint_release_mut(self.as_mut_ptr()) }
}
}