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
Sourcepub unsafe fn CreateLoop(
self: Pin<&mut Self>,
vertices: *const b2Vec2,
count: c_int,
)
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
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
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.