Constructor
new Box2dPlugin(instance)
Create the global UI system object
Name | Type | Description |
---|---|---|
instance | Object |
- Source
Members
bodyTypeDynamic
PropertiesType | Description |
---|---|
number | Dynamic, positive mass, non-zero velocity determined by forces, moved by solver |
- Source
bodyTypeKinematic
PropertiesType | Description |
---|---|
number | Kinematic, zero mass, non-zero velocity set by user, moved by solver |
- Source
bodyTypeStatic
PropertiesType | Description |
---|---|
number | Static, zero mass, zero velocity, may be manually moved |
- Source
positionIterations
PropertiesType | Description |
---|---|
number | Position iterations per update |
- Source
velocityIterations
PropertiesType | Description |
---|---|
number | Velocity iterations per update |
- Source
Methods
boxCast(pos, size)
box aabb cast and return the first object
- Source
boxCastAll(pos, size)
box aabb cast and return all the objects
- Source
castObjectType(o)
casts a box2d object to its correct type
Name | Type | Description |
---|---|---|
o | Object |
- Source
circleCast(pos, diameter)
circle cast and return the first object
Name | Type | Description |
---|---|---|
pos | Vector2 | |
diameter | number |
- Source
circleCastAll(pos, diameter)
circle cast and return all the objects
Name | Type | Description |
---|---|---|
pos | Vector2 | |
diameter | number |
- Source
drawFixture(fixture, pos, angle, coloropt, lineColoropt, lineWidthopt, contextopt)
draws a fixture
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
fixture | Object | |||
pos | Vector2 | |||
angle | number | |||
color | Color | <optional> | ||
lineColor | Color | <optional> | ||
lineWidth | number | <optional> | 0.1 | |
context | CanvasRenderingContext2D | <optional> |
- Source
isNull(o)
checks if a box2d object is null
Name | Type | Description |
---|---|---|
o | Object |
- Source
pointCast(pos, dynamicOnly)
point cast and return the first object
Name | Type | Default | Description |
---|---|---|---|
pos | Vector2 | ||
dynamicOnly | boolean | true |
- Source
raycast(start, end)
raycast and return the first result
- Source
raycastAll(start, end)
raycast and return a list of all the results
- Source
step(framesopt)
Step the physics world simulation
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
frames | number | <optional> | 1 |
- Source
vec2From(v)
converts a box2d vec2 to a Vector2
Name | Type | Description |
---|---|---|
v | Object |
- Source
vec2FromPointer(v)
converts a box2d vec2 pointer to a Vector2
Name | Type | Description |
---|---|---|
v | Object |
- Source
vec2dTo(v)
converts a Vector2 to a box2 vec2
Name | Type | Description |
---|---|---|
v | Vector2 |
- Source