public class

ShapeCollisionChecker

extends BaseCollisionChecker
java.lang.Object
   ↳ org.andengine.util.algorithm.collision.BaseCollisionChecker
     ↳ org.andengine.util.algorithm.collision.ShapeCollisionChecker
Known Direct Subclasses

Class Overview

(c) 2010 Nicolas Gramlich (c) 2011 Zynga Inc.

Summary

Public Constructors
ShapeCollisionChecker()
Public Methods
static boolean checkCollision(float[] pVerticesA, int pVertexCountA, float[] pVerticesB, int pVertexCountB)
Calls through to ShapeCollisionChecker#checkCollisionSub(float[], int, int, int, int, int, float[], int, int, int, int) with the default parameters internally used by different AndEngine primitives.
static boolean checkCollision(float[] pVerticesA, int pVertexCountA, int pVertexOffsetXA, int pVertexOffsetYA, int pVertexStrideA, float[] pVerticesB, int pVertexCountB, int pVertexOffsetXB, int pVertexOffsetYB, int pVertexStrideB)
static boolean checkContains(float[] pVertices, int pVertexCount, int pVertexOffsetX, int pVertexOffsetY, int pVertexStride, float pX, float pY)
Works with complex polygons!
static boolean checkContains(float[] pVertices, int pVertexCount, float pX, float pY)
Calls through to checkContains(float[], int, int, int, int, float, float) with the default parameters internally used by different AndEngine primitives.
[Expand]
Inherited Methods
From class org.andengine.util.algorithm.collision.BaseCollisionChecker
From class java.lang.Object

Public Constructors

public ShapeCollisionChecker ()

Public Methods

public static boolean checkCollision (float[] pVerticesA, int pVertexCountA, float[] pVerticesB, int pVertexCountB)

Calls through to ShapeCollisionChecker#checkCollisionSub(float[], int, int, int, int, int, float[], int, int, int, int) with the default parameters internally used by different AndEngine primitives.

Parameters
pVertexCountA the number of vertices in pVerticesA
pVertexCountB the number of vertices in pVerticesB

public static boolean checkCollision (float[] pVerticesA, int pVertexCountA, int pVertexOffsetXA, int pVertexOffsetYA, int pVertexStrideA, float[] pVerticesB, int pVertexCountB, int pVertexOffsetXB, int pVertexOffsetYB, int pVertexStrideB)

Parameters
pVertexCountA the number of vertices in pVerticesA
pVertexCountB the number of vertices in pVerticesB

public static boolean checkContains (float[] pVertices, int pVertexCount, int pVertexOffsetX, int pVertexOffsetY, int pVertexStride, float pX, float pY)

Works with complex polygons!

Parameters
pVertexCount the number of vertices in pVertices
Returns
  • true when the point defined by (pX, pY) is inside the polygon defined by pVertices, false. If the point is exactly on the edge of the polygon, the result can be true or false.
See Also
  • http://alienryderflex.com/polygon/

public static boolean checkContains (float[] pVertices, int pVertexCount, float pX, float pY)

Calls through to checkContains(float[], int, int, int, int, float, float) with the default parameters internally used by different AndEngine primitives.

Parameters
pVertexCount the number of vertices in pVertices