From 6550d6703ef4a377bbdf8edd21286d93dea97c10 Mon Sep 17 00:00:00 2001 From: Mason Green Date: Sat, 4 Feb 2012 15:49:38 -0500 Subject: [PATCH] updated InScanArea --- poly2tri/common/utils.h | 17 +++++++++++++++++ wscript | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/poly2tri/common/utils.h b/poly2tri/common/utils.h index 88d0c9e..d01b778 100644 --- a/poly2tri/common/utils.h +++ b/poly2tri/common/utils.h @@ -68,6 +68,7 @@ Orientation Orient2d(Point& pa, Point& pb, Point& pc) return CW; } +/* bool InScanArea(Point& pa, Point& pb, Point& pc, Point& pd) { double pdx = pd.x; @@ -99,6 +100,22 @@ bool InScanArea(Point& pa, Point& pb, Point& pc, Point& pd) return true; } +*/ + +bool InScanArea(Point& pa, Point& pb, Point& pc, Point& pd) +{ + double oadb = (pa.x - pb.x)*(pd.y - pb.y) - (pd.x - pb.x)*(pa.y - pb.y); + if (oadb >= EPSILON) { + return false; + } + + double oadc = (pa.x - pc.x)*(pd.y - pc.y) - (pd.x - pc.x)*(pa.y - pc.y); + if (oadc <= EPSILON) { + return false; + } + return true; +} + } #endif diff --git a/wscript b/wscript index a206278..7b04fc3 100644 --- a/wscript +++ b/wscript @@ -1,6 +1,6 @@ #! /usr/bin/env python # encoding: utf-8 -# waf 1.6.2 +# waf 1.6.10 VERSION='0.3.3' import sys