From e0eddb8741b840df97380e557abd51b47a5e2eee Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 8 Nov 2018 22:26:11 +0100 Subject: Implement circle collidables --- src/controller/collision.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/controller') diff --git a/src/controller/collision.ts b/src/controller/collision.ts index e1bd9f9..a44ffa4 100644 --- a/src/controller/collision.ts +++ b/src/controller/collision.ts @@ -1,5 +1,6 @@ import { Collision } from '../model/data/collision'; +import { Circle } from '../math/circle'; import { Collidable } from '../math/collision'; import { LineSegment, Movement } from '../math/line'; import { Point } from '../math/point'; @@ -26,6 +27,11 @@ export function mkCollision(collision: Collision[]): Collidable[] { ret.push(new Point(vec2.clone(v))); prev = v; } + break; + + case 'circle': + ret.push(new Circle(vec2.clone(c.center), c.radius)); + break; } } -- cgit v1.2.3