Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1051 | chris | 1 | package com.gebauz.bauzoid.math.collisionx; |
| 2 | |||
| 3 | import com.gebauz.bauzoid.graphics.spritex.Sprite; |
||
| 4 | import com.gebauz.bauzoid.math.Line2; |
||
| 5 | import com.gebauz.bauzoid.math.Matrix4; |
||
| 6 | import com.gebauz.bauzoid.math.Vector2; |
||
| 7 | |||
| 8 | public abstract class BaseShapeElement |
||
| 9 | { |
||
| 10 | |||
| 11 | // Constants======================================================================================== |
||
| 12 | |||
| 13 | // Embedded Types=================================================================================== |
||
| 14 | |||
| 15 | // Fields=========================================================================================== |
||
| 16 | |||
| 17 | // Methods========================================================================================== |
||
| 18 | |||
| 19 | public BaseShapeElement() |
||
| 20 | { |
||
| 21 | |||
| 22 | } |
||
| 23 | |||
| 24 | public abstract boolean isInside(float x, float y); |
||
| 25 | |||
| 26 | /** Returns true if the shape intersects with this shape element. |
||
| 27 | * @param shape The shape tested against. |
||
| 28 | * @param transform Transformation matrix that brings this shape element's points into shape's space. |
||
| 29 | */ |
||
| 30 | public abstract boolean intersects(Shape shape, Matrix4 transform); |
||
| 31 | |||
| 32 | /** Returns true if the shape intersects with this shape element. Returns a displacement vector |
||
| 33 | * that specifies by how much this shape element needs to be displaced in order to become non-colliding. |
||
| 34 | * @param shape The shape tested against. |
||
| 35 | * @param transform Transformation matrix that brings this shape element's points into shape's space. |
||
| 36 | */ |
||
| 37 | public abstract boolean intersects(Shape shape, Matrix4 transform, Vector2 displaceResult); |
||
| 38 | |||
| 39 | public abstract boolean intersectsLine(Line2 line); |
||
| 40 | |||
| 41 | public abstract void debugRender(Sprite sprite); |
||
| 42 | |||
| 43 | // Getters/Setters================================================================================== |
||
| 44 | |||
| 45 | } |