Struct libliquidfun_sys::box2d::ffi::b2ChainShape
source · #[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
impl b2ChainShape
pub fn new() -> impl New<Output = Self>
sourcepub unsafe fn Clone(
self: &b2ChainShape,
allocator: *mut b2BlockAllocator
) -> *mut b2Shape
pub unsafe fn Clone( self: &b2ChainShape, allocator: *mut b2BlockAllocator ) -> *mut b2Shape
Implement b2Shape. Vertices are cloned using b2Alloc.
sourcepub fn GetChildCount(self: &b2ChainShape) -> c_int
pub fn GetChildCount(self: &b2ChainShape) -> c_int
@see b2Shape::GetChildCount
sourcepub fn TestPoint(
self: &b2ChainShape,
transform: &b2Transform,
p: &b2Vec2
) -> bool
pub fn TestPoint( self: &b2ChainShape, transform: &b2Transform, p: &b2Vec2 ) -> bool
This always return false. @see b2Shape::TestPoint
pub unsafe fn ComputeDistance( self: &b2ChainShape, xf: &b2Transform, p: &b2Vec2, distance: *mut f32, normal: *mut b2Vec2, childIndex: c_int )
sourcepub unsafe fn RayCast(
self: &b2ChainShape,
output: *mut b2RayCastOutput,
input: &b2RayCastInput,
transform: &b2Transform,
childIndex: c_int
) -> bool
pub unsafe fn RayCast( self: &b2ChainShape, output: *mut b2RayCastOutput, input: &b2RayCastInput, transform: &b2Transform, childIndex: c_int ) -> bool
Implement b2Shape.
sourcepub unsafe fn ComputeAABB(
self: &b2ChainShape,
aabb: *mut b2AABB,
transform: &b2Transform,
childIndex: c_int
)
pub unsafe fn ComputeAABB( self: &b2ChainShape, aabb: *mut b2AABB, transform: &b2Transform, childIndex: c_int )
@see b2Shape::ComputeAABB
sourcepub unsafe fn ComputeMass(
self: &b2ChainShape,
massData: *mut b2MassData,
density: f32
)
pub unsafe fn ComputeMass( self: &b2ChainShape, massData: *mut b2MassData, density: f32 )
Chains have zero mass. @see b2Shape::ComputeMass
source§impl b2ChainShape
impl b2ChainShape
source§impl b2ChainShape
impl b2ChainShape
sourcepub unsafe fn CreateChain(
self: Pin<&mut Self>,
vertices: *const b2Vec2,
count: c_int,
prevVertex: &b2Vec2,
nextVertex: &b2Vec2
)
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
impl b2ChainShape
sourcepub unsafe fn GetChildEdge(&self, edge: *mut b2EdgeShape, index: c_int)
pub unsafe fn GetChildEdge(&self, edge: *mut b2EdgeShape, index: c_int)
Get a child edge.
Trait Implementations§
source§impl AsRef<b2Shape> for b2ChainShape
impl AsRef<b2Shape> for b2ChainShape
source§fn as_ref(self: &b2ChainShape) -> &b2Shape
fn as_ref(self: &b2ChainShape) -> &b2Shape
source§impl CopyNew for b2ChainShape
impl CopyNew for b2ChainShape
source§unsafe fn copy_new(
other: &b2ChainShape,
this: Pin<&mut MaybeUninit<b2ChainShape>>
)
unsafe fn copy_new( other: &b2ChainShape, this: Pin<&mut MaybeUninit<b2ChainShape>> )
Synthesized copy constructor.
source§impl Drop for b2ChainShape
impl Drop for b2ChainShape
source§fn drop(self: &mut b2ChainShape)
fn drop(self: &mut b2ChainShape)
The destructor frees the vertices using b2Free.