Ninja Physics Circle constructor.
Note: This class could be massively optimised and reduced in size. I leave that challenge up to you.
| Name | Type | Description |
|---|---|---|
body | Phaser.Physics.Ninja.Body | The body that owns this shape. |
x | number | The x coordinate to create this shape at. |
y | number | The y coordinate to create this shape at. |
radius | number | The radius of this Circle. |
| Name | Type | Description |
|---|---|---|
system | Phaser.Physics.Ninja.Body | A reference to the body that owns this shape. |
All of the collision response handlers.
The height.
The position of this object in the previous update.
The position of this object.
The radius of this circle shape.
A reference to the physics system.
The velocity of this object.
The width.
Half the width.
| Name | Type | Description |
|---|---|---|
xw | number | Half the height. |
Collides this Circle with a Tile.
| Name | Type | Description |
|---|---|---|
t | Phaser.Physics.Ninja.Tile | The Tile involved in the collision. |
True if they collide, otherwise false.
Collides this Circle against the world bounds.
Destroys this Circle's reference to Body and System
Updates this Circles position.
Resolves 22 Degree tile collision.
| Name | Type | Description |
|---|---|---|
x | number | Penetration depth on the x axis. |
y | number | Penetration depth on the y axis. |
oH | number | Grid / voronoi region. |
oV | number | Grid / voronoi region. |
obj | Phaser.Physics.Ninja.Circle | The Circle involved in the collision. |
t | Phaser.Physics.Ninja.Tile | The Tile involved in the collision. |
The result of the collision.
Resolves 22 Degree tile collision.
| Name | Type | Description |
|---|---|---|
x | number | Penetration depth on the x axis. |
y | number | Penetration depth on the y axis. |
oH | number | Grid / voronoi region. |
oV | number | Grid / voronoi region. |
obj | Phaser.Physics.Ninja.Circle | The Circle involved in the collision. |
t | Phaser.Physics.Ninja.Tile | The Tile involved in the collision. |
The result of the collision.
Resolves 45 Degree tile collision.
| Name | Type | Description |
|---|---|---|
x | number | Penetration depth on the x axis. |
y | number | Penetration depth on the y axis. |
oH | number | Grid / voronoi region. |
oV | number | Grid / voronoi region. |
obj | Phaser.Physics.Ninja.Circle | The Circle involved in the collision. |
t | Phaser.Physics.Ninja.Tile | The Tile involved in the collision. |
The result of the collision.
Resolves 67 Degree tile collision.
| Name | Type | Description |
|---|---|---|
x | number | Penetration depth on the x axis. |
y | number | Penetration depth on the y axis. |
oH | number | Grid / voronoi region. |
oV | number | Grid / voronoi region. |
obj | Phaser.Physics.Ninja.Circle | The Circle involved in the collision. |
t | Phaser.Physics.Ninja.Tile | The Tile involved in the collision. |
The result of the collision.
Resolves 67 Degree tile collision.
| Name | Type | Description |
|---|---|---|
x | number | Penetration depth on the x axis. |
y | number | Penetration depth on the y axis. |
oH | number | Grid / voronoi region. |
oV | number | Grid / voronoi region. |
obj | Phaser.Physics.Ninja.Circle | The Circle involved in the collision. |
t | Phaser.Physics.Ninja.Tile | The Tile involved in the collision. |
The result of the collision.
Resolves Concave tile collision.
| Name | Type | Description |
|---|---|---|
x | number | Penetration depth on the x axis. |
y | number | Penetration depth on the y axis. |
oH | number | Grid / voronoi region. |
oV | number | Grid / voronoi region. |
obj | Phaser.Physics.Ninja.Circle | The Circle involved in the collision. |
t | Phaser.Physics.Ninja.Tile | The Tile involved in the collision. |
The result of the collision.
Resolves Convex tile collision.
| Name | Type | Description |
|---|---|---|
x | number | Penetration depth on the x axis. |
y | number | Penetration depth on the y axis. |
oH | number | Grid / voronoi region. |
oV | number | Grid / voronoi region. |
obj | Phaser.Physics.Ninja.Circle | The Circle involved in the collision. |
t | Phaser.Physics.Ninja.Tile | The Tile involved in the collision. |
The result of the collision.
Resolves Full tile collision.
| Name | Type | Description |
|---|---|---|
x | number | Penetration depth on the x axis. |
y | number | Penetration depth on the y axis. |
oH | number | Grid / voronoi region. |
oV | number | Grid / voronoi region. |
obj | Phaser.Physics.Ninja.Circle | The Circle involved in the collision. |
t | Phaser.Physics.Ninja.Tile | The Tile involved in the collision. |
The result of the collision.
Resolves Half tile collision.
| Name | Type | Description |
|---|---|---|
x | number | Penetration depth on the x axis. |
y | number | Penetration depth on the y axis. |
oH | number | Grid / voronoi region. |
oV | number | Grid / voronoi region. |
obj | Phaser.Physics.Ninja.Circle | The Circle involved in the collision. |
t | Phaser.Physics.Ninja.Tile | The Tile involved in the collision. |
The result of the collision.
Render this circle for debugging purposes.
| Name | Type | Description |
|---|---|---|
context | object | The context to render to. |
xOffset | number | X offset from circle's position to render at. |
yOffset | number | Y offset from circle's position to render at. |
color | string | color of the debug shape to be rendered. (format is css color string). |
filled | boolean | Render the shape as solid (true) or hollow (false). |
Process a world collision and apply the resulting forces.
| Name | Type | Description |
|---|---|---|
px | number | The tangent velocity |
py | number | The tangent velocity |
dx | number | Collision normal |
dy | number | Collision normal |
obj | number | Object this Circle collided with |
Resolves tile collision.
| Name | Type | Description |
|---|---|---|
x | number | Penetration depth on the x axis. |
y | number | Penetration depth on the y axis. |
oH | number | Grid / voronoi region. |
oV | number | Grid / voronoi region. |
obj | Phaser.Physics.Ninja.Circle | The Circle involved in the collision. |
t | Phaser.Physics.Ninja.Tile | The Tile involved in the collision. |
The result of the collision.
© 2016 Richard Davey, Photon Storm Ltd.
Licensed under the MIT License.
http://phaser.io/docs/2.6.2/Phaser.Physics.Ninja.Circle.html