pub struct RigidBodyCollider3 {
pub linear_velocity: Vector3D,
pub angular_velocity: Vector3D,
/* private fields */
}Expand description
§3-D rigid body collider class.
This class implements 3-D rigid body collider. The collider can only take rigid body motion with linear and rotational velocities.
Fields§
§linear_velocity: Vector3DLinear velocity of the rigid body.
angular_velocity: Vector3DAngular velocity of the rigid body.
Implementations§
Source§impl RigidBodyCollider3
impl RigidBodyCollider3
Sourcepub fn new(surface: Surface3Ptr) -> RigidBodyCollider3
pub fn new(surface: Surface3Ptr) -> RigidBodyCollider3
Constructs a collider with a surface.
Sourcepub fn new_vel(
surface: Surface3Ptr,
linear_velocity: Vector3D,
angular_velocity: Vector3D,
) -> RigidBodyCollider3
pub fn new_vel( surface: Surface3Ptr, linear_velocity: Vector3D, angular_velocity: Vector3D, ) -> RigidBodyCollider3
Constructs a collider with a surface and other parameters.
Sourcepub fn set_on_begin_update_callback(&mut self, callback: OnBeginUpdateCallback)
pub fn set_on_begin_update_callback(&mut self, callback: OnBeginUpdateCallback)
\brief Sets the callback function to be called when Collider3::update function is invoked.
The callback function takes current simulation time in seconds unit. Use this callback to track any motion or state changes related to this collider.
- parameter: callback The callback function.
Trait Implementations§
Source§impl Collider3 for RigidBodyCollider3
impl Collider3 for RigidBodyCollider3
Source§fn velocity_at(&self, point: &Vector3D) -> Vector3D
fn velocity_at(&self, point: &Vector3D) -> Vector3D
Returns the velocity of the collider at given \p point.
Source§fn update(
&mut self,
current_time_in_seconds: f64,
time_interval_in_seconds: f64,
)where
Self: Sized,
fn update(
&mut self,
current_time_in_seconds: f64,
time_interval_in_seconds: f64,
)where
Self: Sized,
Updates the collider state.
fn view(&self) -> &Collider3Data
fn view_mut(&mut self) -> &mut Collider3Data
Source§fn resolve_collision(
&self,
radius: f64,
restitution_coefficient: f64,
new_position: &mut Vector3D,
new_velocity: &mut Vector3D,
)
fn resolve_collision( &self, radius: f64, restitution_coefficient: f64, new_position: &mut Vector3D, new_velocity: &mut Vector3D, )
Resolves collision for given point. Read more
Source§fn friction_coefficient(&self) -> f64
fn friction_coefficient(&self) -> f64
Returns friction coefficient.
Source§fn set_friction_coefficient(&mut self, new_friction_coefficient: f64)
fn set_friction_coefficient(&mut self, new_friction_coefficient: f64)
Sets the friction coefficient. Read more
Source§fn surface(&self) -> Surface3Ptr
fn surface(&self) -> Surface3Ptr
Returns the surface instance.
Source§fn set_surface(&mut self, new_surface: Surface3Ptr)
fn set_surface(&mut self, new_surface: Surface3Ptr)
Assigns the surface instance from the subclass.
Source§fn get_closest_point(
&self,
surface: Surface3Ptr,
query_point: &Vector3D,
result: &mut ColliderQueryResult,
)
fn get_closest_point( &self, surface: Surface3Ptr, query_point: &Vector3D, result: &mut ColliderQueryResult, )
Outputs closest point’s information.
Source§fn is_penetrating(
&self,
collider_point: &ColliderQueryResult,
position: &Vector3D,
radius: f64,
) -> bool
fn is_penetrating( &self, collider_point: &ColliderQueryResult, position: &Vector3D, radius: f64, ) -> bool
Returns true if given point is in the opposite side of the surface.
Auto Trait Implementations§
impl Freeze for RigidBodyCollider3
impl RefUnwindSafe for RigidBodyCollider3
impl !Send for RigidBodyCollider3
impl !Sync for RigidBodyCollider3
impl Unpin for RigidBodyCollider3
impl UnwindSafe for RigidBodyCollider3
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more