Subversion Repositories AndroidProjects

Rev

Blame | Last modification | View Log | RSS feed

package com.gebauz.bauzoid.math.collision;

import com.gebauz.bauzoid.graphics.sprite.SpriteTransform;
import com.gebauz.bauzoid.math.collision.Shape;

/** Interface for shape element. */
public abstract class BaseShapeElement
{
        // Constants========================================================================================

        // Embedded Types===================================================================================

        // Fields===========================================================================================
       
        private Shape mOwner = null;
       

        // Methods==========================================================================================

        public BaseShapeElement(Shape shape)
        {
                mOwner = shape;        
        }
       
        //public abstract boolean isInside(float x, float y);
       
        /** Returns true if the shape intersects with this shape element.
         *  @param shape The shape tested against.
         *  @param transform Transformation matrix that brings this shape element's points into shape's space.
         */

        //public abstract boolean intersects(Shape shape, Matrix4 transform);
       
        /** Returns true if the shape intersects with this shape element. Returns a displacement vector
         *  that specifies by how much this shape element needs to be displaced in order to become non-colliding.
         *  @param shape The shape tested against.  
         *  @param transform Transformation matrix that brings this shape element's points into shape's space.
         */

        /*public abstract boolean intersects(Shape shape, Matrix4 transform, Vector2 displaceResult);
       
        public abstract boolean intersectsLine(Line2 line);

        public abstract void debugRender(Sprite sprite);*/


        // Getters/Setters==================================================================================
       
        public final SpriteTransform getTransform()
        {
                return mOwner.transform;
        }
       

}