Optionaloptions:
BodyOptions
Protected_Protected_inner initial params save
Protected_Protected_bounding box cache, without padding
Protectedcentered
is body centered
optimization for convex polygons
Readonlydestroy$
When Lifecycle Object is destroyed, it emits and closes this subject. Along with destroying his children, which in turn behave the same.
was the polygon modified and needs update in the next checkCollision
Parent GameObject is assigned at creation.
Readonlyisellipses are convex
static bodies don't move but they collide
trigger bodies move but are like ghosts
Each Lifecycle Object has label for pixi debugging.
maximum x bound of body
maximum y bound of body
minimum x bound of body
minimum y bound of body
bodies are not reinserted during update if their bbox didnt move outside bbox + padding
Protectedpointsbackup of points used for scaling
Protected
Readonlyscalescale Vector of body
Optionalsystem
reference to collision system
Readonlytype
ellipse type
Readonlytypefaster than type
Readonlyupdate$
When Lifecycle Object is updated, it emits this subject. Along with updating his children, which in turn behave the same.
Optionaluserallows 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
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
is body centered?
flag to set is body centered
get ellipse radiusX
set ellipse radiusX, update points
get ellipse radiusY
set ellipse radiusY, update points
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 ellipse step number
set ellipse step number
updating this.pos.x by this.x = x updates AABB
updating this.pos.y by this.y = y updates AABB
do not attempt to use Polygon.center()
Called to destroy can cleanup Lifecycle Object.
Draws exact collider on canvas context
Draws Bounding Box on canvas context
get body bounding box, without padding
Protectedgetreturns 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
Protectedmarkupdate instantly or mark as dirty
OptionalupdateNow:
boolean
update position BY MOVING FORWARD IN ANGLE DIRECTION
Optionalspeed:
number
OptionalupdateNow:
boolean
rotates polygon points by angle, in radians
Protectedrunused to do stuff with temporarily disabled rotation
OptionalupdateNow:
boolean
OptionalupdateNow:
boolean
sets polygon points to new array of vectors
update position BY TELEPORTING
OptionalupdateNow:
boolean
update scale
Optionaly:
number
OptionalupdateNow:
boolean
translates polygon points in x, y direction
= 1.0 for 60FPS
inner function for after position change update aabb in system and convex inner polygons
OptionalupdateNow:
boolean
Protectedupdatedo not attempt to use Polygon.updateConvex()
Protectedupdateupdate the position of the decomposed convex polygons (if any), called after the position of the body has changed
Protectedupdateupdates convex polygons cache in body
Optionalconvex:
Polygon[]
group for collision filtering