Struct libliquidfun_sys::box2d::ffi::b2PolygonShape
source · #[repr(C, align(8))]pub struct b2PolygonShape { /* private fields */ }Expand description
A solid convex polygon. It is assumed that the interior of the polygon is to the left of each edge. Polygons have a maximum number of vertices equal to b2_maxPolygonVertices. In most cases you should not need many vertices for a convex polygon.
Implementations§
source§impl b2PolygonShape
impl b2PolygonShape
sourcepub unsafe fn Set(
self: Pin<&mut b2PolygonShape>,
points: *const b2Vec2,
count: c_int
)
pub unsafe fn Set( self: Pin<&mut b2PolygonShape>, points: *const b2Vec2, count: c_int )
Create a convex hull from the given array of local points. The count must be in the range [3, b2_maxPolygonVertices]. @warning the points may be re-ordered, even if they form a convex polygon @warning collinear points are handled but not removed. Collinear points may lead to poor stacking behavior.
pub fn new() -> impl New<Output = Self>
sourcepub unsafe fn Clone(
self: &b2PolygonShape,
allocator: *mut b2BlockAllocator
) -> *mut b2Shape
pub unsafe fn Clone( self: &b2PolygonShape, allocator: *mut b2BlockAllocator ) -> *mut b2Shape
Implement b2Shape.
sourcepub fn GetChildCount(self: &b2PolygonShape) -> c_int
pub fn GetChildCount(self: &b2PolygonShape) -> c_int
@see b2Shape::GetChildCount
sourcepub fn TestPoint(
self: &b2PolygonShape,
transform: &b2Transform,
p: &b2Vec2
) -> bool
pub fn TestPoint( self: &b2PolygonShape, transform: &b2Transform, p: &b2Vec2 ) -> bool
@see b2Shape::TestPoint
pub unsafe fn ComputeDistance( self: &b2PolygonShape, xf: &b2Transform, p: &b2Vec2, distance: *mut f32, normal: *mut b2Vec2, childIndex: c_int )
sourcepub unsafe fn RayCast(
self: &b2PolygonShape,
output: *mut b2RayCastOutput,
input: &b2RayCastInput,
transform: &b2Transform,
childIndex: c_int
) -> bool
pub unsafe fn RayCast( self: &b2PolygonShape, output: *mut b2RayCastOutput, input: &b2RayCastInput, transform: &b2Transform, childIndex: c_int ) -> bool
Implement b2Shape. @note because the polygon is solid, rays that start inside do not hit because the normal is not defined.
sourcepub unsafe fn ComputeAABB(
self: &b2PolygonShape,
aabb: *mut b2AABB,
transform: &b2Transform,
childIndex: c_int
)
pub unsafe fn ComputeAABB( self: &b2PolygonShape, aabb: *mut b2AABB, transform: &b2Transform, childIndex: c_int )
@see b2Shape::ComputeAABB
sourcepub unsafe fn ComputeMass(
self: &b2PolygonShape,
massData: *mut b2MassData,
density: f32
)
pub unsafe fn ComputeMass( self: &b2PolygonShape, massData: *mut b2MassData, density: f32 )
@see b2Shape::ComputeMass
source§impl b2PolygonShape
impl b2PolygonShape
sourcepub fn SetAsBox1(
self: Pin<&mut Self>,
hx: f32,
hy: f32,
center: &b2Vec2,
angle: f32
)
pub fn SetAsBox1( self: Pin<&mut Self>, hx: f32, hy: f32, center: &b2Vec2, angle: f32 )
Build vertices to represent an oriented box. @param hx the half-width. @param hy the half-height. @param center the center of the box in local coordinates. @param angle the rotation of the box in local coordinates.
Trait Implementations§
source§impl AsRef<b2Shape> for b2PolygonShape
impl AsRef<b2Shape> for b2PolygonShape
source§fn as_ref(self: &b2PolygonShape) -> &b2Shape
fn as_ref(self: &b2PolygonShape) -> &b2Shape
source§impl CopyNew for b2PolygonShape
impl CopyNew for b2PolygonShape
source§unsafe fn copy_new(
other: &b2PolygonShape,
this: Pin<&mut MaybeUninit<b2PolygonShape>>
)
unsafe fn copy_new( other: &b2PolygonShape, this: Pin<&mut MaybeUninit<b2PolygonShape>> )
Synthesized copy constructor.
source§impl Drop for b2PolygonShape
impl Drop for b2PolygonShape
source§fn drop(self: &mut b2PolygonShape)
fn drop(self: &mut b2PolygonShape)
Synthesized destructor.