/*
 *  Copyright 2015-present Lucas Nelaupe and Ferrand
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package kit.scyla.core.facets.collision;

import android.graphics.Region;

import kit.scyla.core.facets.Facet;
import kit.scyla.core.shapes.Shape;

/**
 * Created with IntelliJ
 * Created by Ferrand
 * Date 04/10/2014
 */
public abstract class CollisionFacet<TShape extends Shape<TShape, ?>> extends Facet<TShape> {

    private transient Region m_region;

    public CollisionFacet() {
        super();
    }

    @Override
    public void onShapeDefined(TShape shape) {
        this.m_region = determineRegion();
    }

    public boolean fingerOn(int x, int y){
        return getHitBox().contains(x, y);
    }

    protected abstract Region determineRegion();

    public final Region getHitBox() {
        return m_region;
    }

    public final void recalculateContactArea() {
        m_region = determineRegion();
    }

    public final boolean intersect(Shape other) {
        return (!m_region.quickReject(other.collisionFacet().getHitBox()) && m_region.op(other.collisionFacet().getHitBox(), Region.Op.INTERSECT));
    }
}

@@ -953,18 +953,8 @@
 ate 
-transient 
 Regi
@@ -964,16 +964,63 @@
 m_region
+HitBox;%0A    private Region m_regionFingerHitBox
 ;%0A%0A    p
@@ -1142,32 +1142,38 @@
    this.m_region
+HitBox
  = determineRegi
@@ -1242,24 +1242,29 @@
   return get
+Touch
 HitBox().con
@@ -1342,64 +1342,236 @@
    p
-ublic final Region getHitBox() %7B%0A        return m_region
+rotected Region determineFingerRegion() %7B%0A        return m_regionHitBox;%0A    %7D%0A%0A    public final Region getHitBox() %7B%0A        return m_regionHitBox;%0A    %7D%0A%0A    public Region getTouchHitBox() %7B%0A        return m_regionFingerHitBox
 ;%0A  
@@ -1640,16 +1640,22 @@
 m_region
+HitBox
  = deter
@@ -1660,32 +1660,88 @@
 ermineRegion();%0A
+        m_regionFingerHitBox = determineFingerRegion();%0A
     %7D%0A%0A    publi
@@ -1806,16 +1806,22 @@
 m_region
+HitBox
 .quickRe
@@ -1872,16 +1872,22 @@
 m_region
+HitBox
 .op(othe

Define different region for collision and finger