RigidBodyCollider3

Struct RigidBodyCollider3 

Source
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: Vector3D

Linear velocity of the rigid body.

§angular_velocity: Vector3D

Angular velocity of the rigid body.

Implementations§

Source§

impl RigidBodyCollider3

Source

pub fn new(surface: Surface3Ptr) -> RigidBodyCollider3

Constructs a collider with a surface.

Source

pub fn new_vel( surface: Surface3Ptr, linear_velocity: Vector3D, angular_velocity: Vector3D, ) -> RigidBodyCollider3

Constructs a collider with a surface and other parameters.

Source

pub fn builder() -> Builder

Returns builder fox RigidBodyCollider3.

Source

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

Source§

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,

Updates the collider state.
Source§

fn view(&self) -> &Collider3Data

Source§

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, )

Resolves collision for given point. Read more
Source§

fn friction_coefficient(&self) -> f64

Returns friction coefficient.
Source§

fn set_friction_coefficient(&mut self, new_friction_coefficient: f64)

Sets the friction coefficient. Read more
Source§

fn surface(&self) -> Surface3Ptr

Returns the surface instance.
Source§

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, )

Outputs closest point’s information.
Source§

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V