/*
Copyright (C) 2003, 2010 - Wolfire Games
+Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file)
This file is part of Lugaru.
-Lugaru is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
+Lugaru is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
-This program is distributed in the hope that it will be useful,
+Lugaru is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-See the GNU General Public License for more details.
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+along with Lugaru. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Quaternions.h"
bool LineFacet(Vector p1, Vector p2, Vector pa, Vector pb, Vector pc, Vector *p)
{
static float d;
- static float a1, a2, a3;
- static float total, denom, mu;
- static Vector n, pa1, pa2, pa3;
+ static float denom, mu;
+ static Vector n;
//Calculate the parameters for the plane
n.x = (pb.y - pa.y) * (pc.z - pa.z) - (pb.z - pa.z) * (pc.y - pa.y);
bool LineFacet(XYZ p1, XYZ p2, XYZ pa, XYZ pb, XYZ pc, XYZ *p)
{
static float d;
- static float a1, a2, a3;
- static float total, denom, mu;
- static XYZ n, pa1, pa2, pa3;
+ static float denom, mu;
+ static XYZ n;
//Calculate the parameters for the plane
n.x = (pb.y - pa.y) * (pc.z - pa.z) - (pb.z - pa.z) * (pc.y - pa.y);
float LineFacetd(XYZ p1, XYZ p2, XYZ pa, XYZ pb, XYZ pc, XYZ *p)
{
static float d;
- static float a1, a2, a3;
- static float total, denom, mu;
- static XYZ n, pa1, pa2, pa3;
+ static float denom, mu;
+ static XYZ n;
//Calculate the parameters for the plane
n.x = (pb.y - pa.y) * (pc.z - pa.z) - (pb.z - pa.z) * (pc.y - pa.y);
float LineFacetd(XYZ p1, XYZ p2, XYZ pa, XYZ pb, XYZ pc, XYZ n, XYZ *p)
{
static float d;
- static float a1, a2, a3;
- static float total, denom, mu;
- static XYZ pa1, pa2, pa3;
+ static float denom, mu;
//Calculate the parameters for the plane
d = - n.x * pa.x - n.y * pa.y - n.z * pa.z;
float LineFacetd(XYZ *p1, XYZ *p2, XYZ *pa, XYZ *pb, XYZ *pc, XYZ *p)
{
static float d;
- static float a1, a2, a3;
- static float total, denom, mu;
- static XYZ pa1, pa2, pa3, n;
+ static float denom, mu;
+ static XYZ n;
//Calculate the parameters for the plane
n.x = (pb->y - pa->y) * (pc->z - pa->z) - (pb->z - pa->z) * (pc->y - pa->y);
float LineFacetd(XYZ *p1, XYZ *p2, XYZ *pa, XYZ *pb, XYZ *pc, XYZ *n, XYZ *p)
{
static float d;
- static float a1, a2, a3;
- static float total, denom, mu;
- static XYZ pa1, pa2, pa3;
+ static float denom, mu;
//Calculate the parameters for the plane
d = - n->x * pa->x - n->y * pa->y - n->z * pa->z;