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
impl b2Shape
Sourcepub unsafe fn Clone(
self: &b2Shape,
allocator: *mut b2BlockAllocator,
) -> *mut b2Shape
pub unsafe fn Clone( self: &b2Shape, allocator: *mut b2BlockAllocator, ) -> *mut b2Shape
Clone the concrete shape using the provided allocator.
Sourcepub fn GetChildCount(self: &b2Shape) -> c_int
pub fn GetChildCount(self: &b2Shape) -> c_int
Get the number of child primitives.
Sourcepub fn TestPoint(self: &b2Shape, xf: &b2Transform, p: &b2Vec2) -> bool
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.
Sourcepub unsafe fn ComputeDistance(
self: &b2Shape,
xf: &b2Transform,
p: &b2Vec2,
distance: *mut f32,
normal: *mut b2Vec2,
childIndex: c_int,
)
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.
Sourcepub unsafe fn RayCast(
self: &b2Shape,
output: *mut b2RayCastOutput,
input: &b2RayCastInput,
transform: &b2Transform,
childIndex: c_int,
) -> bool
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
Sourcepub unsafe fn ComputeAABB(
self: &b2Shape,
aabb: *mut b2AABB,
xf: &b2Transform,
childIndex: c_int,
)
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
Sourcepub unsafe fn ComputeMass(
self: &b2Shape,
massData: *mut b2MassData,
density: f32,
)
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.