#[repr(C, align(8))]
pub struct b2ChainShape { /* private fields */ }
Expand description

A chain shape is a free form sequence of line segments. The chain has one-sided collision, with the surface normal pointing to the right of the edge. This provides a counter-clockwise winding like the polygon shape. Connectivity information is used to create smooth collisions. @warning the chain will not collide properly if there are self-intersections.

Implementations§

source§

impl b2ChainShape

source

pub fn new() -> impl New<Output = Self>

source

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

Implement b2Shape. Vertices are cloned using b2Alloc.

source

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

@see b2Shape::GetChildCount

source

pub fn TestPoint( self: &b2ChainShape, transform: &b2Transform, p: &b2Vec2 ) -> bool

This always return false. @see b2Shape::TestPoint

source

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

source

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

Implement b2Shape.

source

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

@see b2Shape::ComputeAABB

source

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

Chains have zero mass. @see b2Shape::ComputeMass

source§

impl b2ChainShape

source

pub fn Clear(self: Pin<&mut Self>)

Clear all data.

source§

impl b2ChainShape

source

pub unsafe fn CreateLoop( self: Pin<&mut Self>, vertices: *const b2Vec2, count: c_int )

Create a loop. This automatically adjusts connectivity. @param vertices an array of vertices, these are copied @param count the vertex count

source§

impl b2ChainShape

source

pub unsafe fn CreateChain( self: Pin<&mut Self>, vertices: *const b2Vec2, count: c_int, prevVertex: &b2Vec2, nextVertex: &b2Vec2 )

Create a chain with ghost vertices to connect multiple chains together. @param vertices an array of vertices, these are copied @param count the vertex count @param prevVertex previous vertex from chain that connects to the start @param nextVertex next vertex from chain that connects to the end

source§

impl b2ChainShape

source

pub unsafe fn GetChildEdge(&self, edge: *mut b2EdgeShape, index: c_int)

Get a child edge.

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 CopyNew for b2ChainShape

source§

unsafe fn copy_new( other: &b2ChainShape, this: Pin<&mut MaybeUninit<b2ChainShape>> )

Synthesized copy constructor.

source§

impl Drop for b2ChainShape

source§

fn drop(self: &mut b2ChainShape)

The destructor frees the vertices using b2Free.

source§

impl ExternType for b2ChainShape

§

type Id = (b, _2, C, h, a, i, n, S, h, a, p, e)

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

type Kind = Opaque

source§

impl MakeCppStorage for b2ChainShape

source§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut b2ChainShape

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

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

impl SharedPtrTarget for b2ChainShape

source§

impl UniquePtrTarget for b2ChainShape

source§

impl WeakPtrTarget for b2ChainShape

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.