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
// Author: Tom Olsson <tom.olsson@embark-studios.com>

// Copyright © 2019, Embark Studios, all rights reserved.

// Created: 15 April 2019


#![warn(clippy::all)]

/*!

*/

use super::{px_type::*, rigid_actor::RigidActor};
use physx_macros::*;
use physx_sys::{PxRigidStatic, PxRigidStatic_getConcreteTypeName};

#[physx_type(inherit = "RigidActor")]
impl RigidStatic {
    pub fn new(px_link: *mut PxRigidStatic) -> Self {
        let mut _self = Self::from_ptr(px_link);
        _self.allocate_user_data();

        _self
    }

    /// Get the name of the real type referenced by this pointer, or None if the returned string is not valid

    pub fn get_concrete_type_name(&self) -> Option<&str> {
        unsafe {
            std::ffi::CStr::from_ptr(PxRigidStatic_getConcreteTypeName(self.get_raw()) as _)
                .to_str()
                .ok()
        }
    }
}