#[repr(C)]
pub struct b2Shape { /* private fields */ }
Expand description

@file Structures and functions used for computing contact points, distance queries, and TOI queries.

Implementations§

source§

impl b2Shape

source

pub unsafe fn Clone( self: &b2Shape, allocator: *mut b2BlockAllocator ) -> *mut b2Shape

Clone the concrete shape using the provided allocator.

source

pub fn GetChildCount(self: &b2Shape) -> c_int

Get the number of child primitives.

source

pub fn TestPoint(self: &b2Shape, xf: &b2Transform, p: &b2Vec2) -> bool

Test a point for containment in this shape. This only works for convex shapes. @param xf the shape world transform. @param p a point in world coordinates.

source

pub unsafe fn ComputeDistance( self: &b2Shape, xf: &b2Transform, p: &b2Vec2, distance: *mut f32, normal: *mut b2Vec2, childIndex: c_int )

Compute the distance from the current shape to the specified point. This only works for convex shapes. @param xf the shape world transform. @param p a point in world coordinates. @param distance returns the distance from the current shape. @param normal returns the direction in which the distance increases.

source

pub unsafe fn RayCast( self: &b2Shape, output: *mut b2RayCastOutput, input: &b2RayCastInput, transform: &b2Transform, childIndex: c_int ) -> bool

Cast a ray against a child shape. @param output the ray-cast results. @param input the ray-cast input parameters. @param transform the transform to be applied to the shape. @param childIndex the child shape index

source

pub unsafe fn ComputeAABB( self: &b2Shape, aabb: *mut b2AABB, xf: &b2Transform, childIndex: c_int )

Given a transform, compute the associated axis aligned bounding box for a child shape. @param aabb returns the axis aligned box. @param xf the world transform of the shape. @param childIndex the child shape

source

pub unsafe fn ComputeMass( self: &b2Shape, massData: *mut b2MassData, density: f32 )

Compute the mass properties of this shape using its dimensions and density. The inertia tensor is computed about the local origin. @param massData returns the mass data for this shape. @param density the density in kilograms per meter squared.

source§

impl b2Shape

source

pub fn GetType(&self) -> b2Shape_Type

Get the type of this shape. You can use this to down cast to the concrete shape. @return the shape type.

Trait Implementations§

source§

impl AsRef<b2Shape> for b2ChainShape

source§

fn as_ref(self: &b2ChainShape) -> &b2Shape

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<b2Shape> for b2CircleShape

source§

fn as_ref(self: &b2CircleShape) -> &b2Shape

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<b2Shape> for b2EdgeShape

source§

fn as_ref(self: &b2EdgeShape) -> &b2Shape

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<b2Shape> for b2PolygonShape

source§

fn as_ref(self: &b2PolygonShape) -> &b2Shape

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Drop for b2Shape

source§

fn drop(self: &mut b2Shape)

Executes the destructor for this type. Read more
source§

impl ExternType for b2Shape

§

type Kind = Opaque

§

type Id

A type-level representation of the type’s C++ namespace and type name. Read more
source§

impl MakeCppStorage for b2Shape

source§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut b2Shape

Allocates heap space for this type in C++ and return a pointer to that space, but do not initialize that space (i.e. do not yet call a constructor). Read more
source§

unsafe fn free_uninitialized_cpp_storage(arg0: *mut b2Shape)

Frees a C++ allocation which has not yet had a constructor called. Read more
source§

impl SharedPtrTarget for b2Shape

source§

impl UniquePtrTarget for b2Shape

source§

impl WeakPtrTarget for b2Shape

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.