new Circle(body, x, y, radius)
Ninja Physics Circle constructor. Note: This class could be massively optimised and reduced in size. I leave that challenge up to you.
Parameters:
| 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. |
- Source - physics/ninja/Circle.js, line 19
Members
-
body
-
- Source - physics/ninja/Circle.js, line 24
Properties:
Name Type Description systemPhaser.Physics.Ninja.Body A reference to the body that owns this shape.
-
circleTileProjections :object
-
All of the collision response handlers.
- Source - physics/ninja/Circle.js, line 90
-
<readonly> height :number
-
The height.
- Source - physics/ninja/Circle.js, line 68
-
oldpos :Phaser.Point
-
The position of this object in the previous update.
- Source - physics/ninja/Circle.js, line 39
-
pos :Phaser.Point
-
The position of this object.
- Source - physics/ninja/Circle.js, line 34
-
radius :number
-
The radius of this circle shape.
- Source - physics/ninja/Circle.js, line 44
-
system :Phaser.Physics.Ninja
-
A reference to the physics system.
- Source - physics/ninja/Circle.js, line 29
-
velocity :Phaser.Point
-
The velocity of this object.
- Source - physics/ninja/Circle.js, line 85
-
<readonly> width :number
-
The width.
- Source - physics/ninja/Circle.js, line 62
-
<readonly> xw :number
-
Half the width.
- Source - physics/ninja/Circle.js, line 50
-
<readonly> yw
-
- Source - physics/ninja/Circle.js, line 56
Properties:
Name Type Description xwnumber Half the height.
Methods
-
collideCircleVsTile(t) → {boolean}
-
Collides this Circle with a Tile.
Parameters:
Name Type Description tPhaser.Physics.Ninja.Tile The Tile involved in the collision.
Returns:
boolean -True if they collide, otherwise false.
- Source - physics/ninja/Circle.js, line 248
-
collideWorldBounds()
-
Collides this Circle against the world bounds.
- Source - physics/ninja/Circle.js, line 207
-
destroy()
-
Destroys this Circle's reference to Body and System
- Source - physics/ninja/Circle.js, line 2612
-
integrate()
-
Updates this Circles position.
- Source - physics/ninja/Circle.js, line 112
-
projCircle_22DegB(x, y, oH, oV, obj, t) → {number}
-
Resolves 22 Degree tile collision.
Parameters:
Name Type Description xnumber Penetration depth on the x axis.
ynumber Penetration depth on the y axis.
oHnumber Grid / voronoi region.
oVnumber Grid / voronoi region.
objPhaser.Physics.Ninja.Circle The Circle involved in the collision.
tPhaser.Physics.Ninja.Tile The Tile involved in the collision.
Returns:
number -The result of the collision.
- Source - physics/ninja/Circle.js, line 1719
-
projCircle_22DegS(x, y, oH, oV, obj, t) → {number}
-
Resolves 22 Degree tile collision.
Parameters:
Name Type Description xnumber Penetration depth on the x axis.
ynumber Penetration depth on the y axis.
oHnumber Grid / voronoi region.
oVnumber Grid / voronoi region.
objPhaser.Physics.Ninja.Circle The Circle involved in the collision.
tPhaser.Physics.Ninja.Tile The Tile involved in the collision.
Returns:
number -The result of the collision.
- Source - physics/ninja/Circle.js, line 1427
-
projCircle_45Deg(x, y, oH, oV, obj, t) → {number}
-
Resolves 45 Degree tile collision.
Parameters:
Name Type Description xnumber Penetration depth on the x axis.
ynumber Penetration depth on the y axis.
oHnumber Grid / voronoi region.
oVnumber Grid / voronoi region.
objPhaser.Physics.Ninja.Circle The Circle involved in the collision.
tPhaser.Physics.Ninja.Tile The Tile involved in the collision.
Returns:
number -The result of the collision.
- Source - physics/ninja/Circle.js, line 447
-
projCircle_67DegB(x, y, oH, oV, obj, t) → {number}
-
Resolves 67 Degree tile collision.
Parameters:
Name Type Description xnumber Penetration depth on the x axis.
ynumber Penetration depth on the y axis.
oHnumber Grid / voronoi region.
oVnumber Grid / voronoi region.
objPhaser.Physics.Ninja.Circle The Circle involved in the collision.
tPhaser.Physics.Ninja.Tile The Tile involved in the collision.
Returns:
number -The result of the collision.
- Source - physics/ninja/Circle.js, line 2307
-
projCircle_67DegS(x, y, oH, oV, obj, t) → {number}
-
Resolves 67 Degree tile collision.
Parameters:
Name Type Description xnumber Penetration depth on the x axis.
ynumber Penetration depth on the y axis.
oHnumber Grid / voronoi region.
oVnumber Grid / voronoi region.
objPhaser.Physics.Ninja.Circle The Circle involved in the collision.
tPhaser.Physics.Ninja.Tile The Tile involved in the collision.
Returns:
number -The result of the collision.
- Source - physics/ninja/Circle.js, line 2022
-
projCircle_Concave(x, y, oH, oV, obj, t) → {number}
-
Resolves Concave tile collision.
Parameters:
Name Type Description xnumber Penetration depth on the x axis.
ynumber Penetration depth on the y axis.
oHnumber Grid / voronoi region.
oVnumber Grid / voronoi region.
objPhaser.Physics.Ninja.Circle The Circle involved in the collision.
tPhaser.Physics.Ninja.Tile The Tile involved in the collision.
Returns:
number -The result of the collision.
- Source - physics/ninja/Circle.js, line 717
-
projCircle_Convex(x, y, oH, oV, obj, t) → {number}
-
Resolves Convex tile collision.
Parameters:
Name Type Description xnumber Penetration depth on the x axis.
ynumber Penetration depth on the y axis.
oHnumber Grid / voronoi region.
oVnumber Grid / voronoi region.
objPhaser.Physics.Ninja.Circle The Circle involved in the collision.
tPhaser.Physics.Ninja.Tile The Tile involved in the collision.
Returns:
number -The result of the collision.
- Source - physics/ninja/Circle.js, line 951
-
projCircle_Full(x, y, oH, oV, obj, t) → {number}
-
Resolves Full tile collision.
Parameters:
Name Type Description xnumber Penetration depth on the x axis.
ynumber Penetration depth on the y axis.
oHnumber Grid / voronoi region.
oVnumber Grid / voronoi region.
objPhaser.Physics.Ninja.Circle The Circle involved in the collision.
tPhaser.Physics.Ninja.Tile The Tile involved in the collision.
Returns:
number -The result of the collision.
- Source - physics/ninja/Circle.js, line 335
-
projCircle_Half(x, y, oH, oV, obj, t) → {number}
-
Resolves Half tile collision.
Parameters:
Name Type Description xnumber Penetration depth on the x axis.
ynumber Penetration depth on the y axis.
oHnumber Grid / voronoi region.
oVnumber Grid / voronoi region.
objPhaser.Physics.Ninja.Circle The Circle involved in the collision.
tPhaser.Physics.Ninja.Tile The Tile involved in the collision.
Returns:
number -The result of the collision.
- Source - physics/ninja/Circle.js, line 1193
-
render(context, xOffset, yOffset, color, filled)
-
Render this circle for debugging purposes.
Parameters:
Name Type Description contextobject The context to render to.
xOffsetnumber X offset from circle's position to render at.
yOffsetnumber Y offset from circle's position to render at.
colorstring color of the debug shape to be rendered. (format is css color string).
filledboolean Render the shape as solid (true) or hollow (false).
- Source - physics/ninja/Circle.js, line 2622
-
reportCollisionVsWorld(px, py, dx, dy, obj)
-
Process a world collision and apply the resulting forces.
Parameters:
Name Type Description pxnumber The tangent velocity
pynumber The tangent velocity
dxnumber Collision normal
dynumber Collision normal
objnumber Object this Circle collided with
- Source - physics/ninja/Circle.js, line 132
-
resolveCircleTile(x, y, oH, oV, obj, t) → {number}
-
Resolves tile collision.
Parameters:
Name Type Description xnumber Penetration depth on the x axis.
ynumber Penetration depth on the y axis.
oHnumber Grid / voronoi region.
oVnumber Grid / voronoi region.
objPhaser.Physics.Ninja.Circle The Circle involved in the collision.
tPhaser.Physics.Ninja.Tile The Tile involved in the collision.
Returns:
number -The result of the collision.
- Source - physics/ninja/Circle.js, line 310
