BoxShape class

Inheritance

Constructors

BoxShape({required Body body, required double width, required double height, required double radius})
BoxShape.fromRect({required Body body, required Rect rect, required double radius})

Properties

count int
no setter
hashCode int
The hash code for this object.
no setterinherited
isExist bool
no setterinherited
r double
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
verts List<Vector2>
no setter

Methods

cacheRect() Rect
Update, cache and return the bounding box of a shape based on the body it's attached to.
inherited
collide({required Shape a, required Shape b}) ContactPointSet
Return contact information about two shapes.
inherited
destroy() → void
Destroy a shape.
inherited
getArea() double
Get the calculated area of this shape.
inherited
getBody() Body
The cpBody this shape is connected to.
inherited
getCenterOfGravity() → Vector2
Get the centroid of this shape.
inherited
getCollisionType() int
Set the collision type of this shape.
inherited
getCount() int
Get the number of verts in a polygon shape.
inherited
getData<T>() → T?
Get the user data pointer associated with this pair of colliding objects.
inherited
getDensity() double
Get the density of the shape if you are having Chipmunk calculate mass properties for you.
inherited
getElasticity() double
Get the elasticity of this shape.
inherited
getFilter() ShapeFilter
Get the collision filtering parameters of this shape.
inherited
getFriction() double
Get the friction of this shape.
inherited
getMass() double
Get the mass of the shape if you are having Chipmunk calculate mass properties for you.
inherited
getMoment() double
Get the calculated moment of inertia for this shape.
inherited
getRadius() double
Get the radius of a polygon shape.
inherited
getRect() Rect
Get the bounding box that contains the shape given it's current position and angle.
inherited
getSensor() bool
Get if the shape is set to be a sensor or not.
inherited
getSpace() Space
The cpSpace this body is added to.
inherited
getSurfaceVelocity() → Vector2
Get the surface velocity of this shape.
inherited
getVert(int index) → Vector2
Get the @c ith vertex of a polygon shape.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pointQuery({required Vector2 point}) → (double, PointQueryInfo)
Perform a nearest point query. It finds the closest point on the surface of shape to a specific point. The value returned is the distance between the points. A negative distance means the point is inside the shape.
inherited
removeData() → void
If you need to perform any cleanup for this data, you must do it yourself, in the separate callback for instance.
inherited
segmentQuery({required Vector2 a, required Vector2 b, required double radius}) → (bool, SegmentQueryInfo)
Perform a segment query against a shape. @c info must be a pointer to a valid cpSegmentQueryInfo structure.
inherited
setBody(Body body) → void
Set the cpBody this shape is connected to. Can only be used if the shape is not currently added to a space.
inherited
setCollisionType(int collisionType) → void
Set the collision type of this shape.
inherited
setData<T>(T data) → void
Set a user data point associated with this pair of colliding objects.
inherited
setDensity(double density) → void
Set the density of this shape to have Chipmunk calculate mass properties for you.
inherited
setElasticity(double elasticity) → void
Set the elasticity of this shape.
inherited
setFilter(ShapeFilter filter) → void
Set the collision filtering parameters of this shape.
inherited
setFriction(double friction) → void
Set the friction of this shape.
inherited
setMass(double mass) → void
Set the mass of this shape to have Chipmunk calculate mass properties for you.
inherited
setRadius(double radius) → void
/// Set the radius of a poly shape.
inherited
setSensor(bool sensor) → void
Set if the shape is a sensor or not.
inherited
setSurfaceVelocity(Vector2 surfaceVelocity) → void
Set the surface velocity of this shape.
inherited
setVerts({required List<Vector2> verts, required Matrix4 transform}) → void
Set the vertexes of a poly shape.
inherited
setVertsRaw(List<Vector2> verts) → void
Set the vertexes of a poly shape.
inherited
toString() String
A string representation of this object.
inherited
update(Matrix4 transform) Rect
Update, cache and return the bounding box of a shape with an explicit transformation.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited