Polygon-shaped physics body with Canvas visualization. More...
| Import Statement: | import Clayground.Physics |
VisualizedPolyBody combines a visual Poly shape with a Box2D polygon fixture. The physics shape automatically synchronizes with the visual vertices.
Example usage:
import Clayground.Physics import Box2D VisualizedPolyBody { canvas: myCanvas vertices: [ {x: 0, y: 0}, {x: 2, y: 0}, {x: 1, y: 2} ] fillColor: "green" bodyType: Body.Dynamic density: 2 }
The Box2D body instance.
The Box2D polygon fixture.
Physics world reference.
Fixture density.
Friction coefficient.
Bounciness coefficient.
If true, detects collisions without physical response.
Collision category bits.
Collision mask bits.
Collision group index.
Refreshes visual and physics geometry from vertices.