collider - point (very tiny box)
Optional
options: BodyOptions<UserDataType>Protected
_groupgroup for collision filtering
Protected
_heightinner height
Protected
_widthinner width
body angle in radians use deg2rad to convert
move(speed) moves at 1 speed = 1px
towards angle
bounding box cache, without padding
Protected
centeredis body centered
optimization for convex polygons
was the polygon modified and needs update in the next checkCollision
Readonly
isboxes are convex
static bodies don't move but they collide
trigger bodies move but are like ghosts
maximum x bound of body
maximum y bound of body
minimum x bound of body
minimum y bound of body
each body may have offset from center
bodies are not reinserted during update if their bbox didnt move outside bbox + padding
Protected
pointsbackup of points used for scaling
Protected
Readonly
scalescale Vector of body
Optional
systemreference to collision system
Readonly
typepoint type
Readonly
typefaster than type
Optional
userallows the user to set any misc data for client use
group for collision filtering
Values in BodyGroup are predefined and used each the body type and should not be used for custom filtering
0b00000001 << 16
to 0b01000000 << 16
(max 0x7fffffff) are free to use for custom groups
canInteract for how groups are used
group for collision filtering
Values in BodyGroup are predefined and used each the body type and should not be used for custom filtering
0b00000001 << 16
to 0b01000000 << 16
(max 0x7fffffff) are free to use for custom groups
canInteract for how groups are used
get box height
set box height, update points
is polygon centered?
flag to set is polygon centered
allow approx getting of scale
allow easier setting of scale
allow exact getting of scale x - use setScale(x, y) to set
allow exact getting of scale y - use setScale(x, y) to set
get box width
set box width, update points
updating this.pos.x by this.x = x updates AABB
updating this.pos.y by this.y = y updates AABB
Protected
afterafter setting width/height update translate see https://github.com/Prozi/detect-collisions/issues/70
Draws exact collider on canvas context
Draws Bounding Box on canvas context
get body bounding box, without padding
get body centroid without applied angle
Protected
getreturns body split into convex polygons, or empty array for convex bodies
Get edge line by index
if true, polygon is not an invalid, self-crossing polygon
Protected
markupdate instantly or mark as dirty
update position BY MOVING FORWARD IN ANGLE DIRECTION
Protected
retranslatefor setting offset from center
update position BY TELEPORTING
inner function for after position change update aabb in system and convex inner polygons
Protected
updateupdate the position of the decomposed convex polygons (if any), called after the position of the body has changed
Protected
updateProtected
updatedo not attempt to use Polygon.updateIsConvex()
collider - point (very tiny box)