ソースを参照

added missing collider changes

Nicolas Cannasse 2 年 前
コミット
e62387f02e
3 ファイル変更26 行追加3 行削除
  1. 9 1
      h2d/col/PixelsCollider.hx
  2. 8 1
      h2d/col/RoundRect.hx
  3. 9 1
      h2d/col/Triangle.hx

+ 9 - 1
h2d/col/PixelsCollider.hx

@@ -5,7 +5,7 @@ package h2d.col;
 
 	Note that it checks as `channel > cutoff`, not `channel >= cutoff`, hence cutoff value of 255 would never pass the test.
 **/
-class PixelsCollider implements Collider {
+class PixelsCollider extends Collider {
 
 	/**
 		The source pixel data which is tested against.
@@ -96,4 +96,12 @@ class PixelsCollider implements Collider {
 		}
 	}
 
+	public function collideCircle( c : Circle ) : Bool {
+		throw "Not implemented";
+	}
+
+	public function collideBounds( b : Bounds ) : Bool {
+		throw "Not implemented";
+	}
+
 }

+ 8 - 1
h2d/col/RoundRect.hx

@@ -3,7 +3,7 @@ package h2d.col;
 /**
 	A Collider representing the rectangle with the rounded edges, forming a 2D capsule.
 **/
-class RoundRect implements Collider {
+class RoundRect extends Collider {
 	/**
 		The horizontal position of the rectangle center.
 	**/
@@ -110,4 +110,11 @@ class RoundRect implements Collider {
 		return inside(p);
 	}
 
+	public function collideCircle( c : Circle ) : Bool {
+		throw "Not implemented";
+	}
+
+	public function collideBounds( b : Bounds ) : Bool {
+		throw "Not implemented";
+	}
 }

+ 9 - 1
h2d/col/Triangle.hx

@@ -2,7 +2,7 @@ package h2d.col;
 /**
 	A simple triangle collider.
 **/
-class Triangle implements Collider {
+class Triangle extends Collider {
 
 	static inline var UNDEF = 1.1315e-17;
 
@@ -84,4 +84,12 @@ class Triangle implements Collider {
 		return s >= 0 && t >= 0 && s + t < 1;
 	}
 
+	public function collideCircle( c : Circle ) : Bool {
+		throw "Not implemented";
+	}
+
+	public function collideBounds( b : Bounds ) : Bool {
+		throw "Not implemented";
+	}
+
 }