Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IceTriangle.cpp File Reference
#include "Stdafx.h"

Go to the source code of this file.

Functions

static sdword VPlaneSideEps (const Point &v, const Plane &plane, float epsilon)
 

Detailed Description

Contains a handy triangle class.

Author
Pierre Terdiman
Date
January, 17, 2000

Definition in file IceTriangle.cpp.

Function Documentation

static sdword VPlaneSideEps ( const Point v,
const Plane plane,
float  epsilon 
)
static

Definition at line 28 of file IceTriangle.cpp.

References Opcode::Plane::Distance().

Referenced by Opcode::Triangle::TestAgainstPlane().

29 {
30  // Compute distance from current vertex to the plane
31  float Dist = plane.Distance(v);
32  // Compute side:
33  // 1 = the vertex is on the positive side of the plane
34  // -1 = the vertex is on the negative side of the plane
35  // 0 = the vertex is on the plane (within epsilon)
36  return Dist > epsilon ? 1 : Dist < -epsilon ? -1 : 0;
37 }