SegmentShape class

Inheritance

Constructors

SegmentShape({required Body body, required Vector2 a, required Vector2 b, required double radius})

Properties

a → Vector2
no setter
aTangent → Vector2
no setter
b → Vector2
no setter
bTangent → Vector2
no setter
hashCode int
The hash code for this object.
no setterinherited
isExist bool
no setterinherited
n → Vector2
no setter
r double
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
ta → Vector2
no setter
tb → Vector2
no setter
tn → 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
getA() → Vector2
Get the first endpoint of a segment shape.
getArea() double
Get the calculated area of this shape.
inherited
getB() → Vector2
Get the second endpoint of a segment shape.
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
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
getNormal() → Vector2
Get the normal of a segment shape.
getRadius() double
Get the first endpoint of a segment shape.
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
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
setEndpoints({required Vector2 a, required Vector2 b}) → void
Set the endpoints of a segment shape.
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
setNeighbors({required Vector2 pref, required Vector2 next}) → void
Let Chipmunk know about the geometry of adjacent segments to avoid colliding with endcaps.
setRadius(double radius) → void
Set the radius of a segment shape.
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
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