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
VertexPointers Class Reference

#include <OPC_MeshInterface.h>

Public Member Functions

bool BackfaceCulling (const Point &source)
 

Public Attributes

const PointVertex [3]
 

Detailed Description

This structure holds 3 vertex-pointers. It's mainly used by collision callbacks so that the app doesn't have to return 3 vertices to OPCODE (36 bytes) but only 3 pointers (12 bytes). It seems better but I never profiled the alternative.

Author
Pierre Terdiman
Version
1.3
Date
March, 20, 2001

Definition at line 23 of file OPC_MeshInterface.h.

Member Function Documentation

bool VertexPointers::BackfaceCulling ( const Point source)
inline

Definition at line 27 of file OPC_MeshInterface.h.

References f, and Vertex.

28  {
29  const Point& p0 = *Vertex[0];
30  const Point& p1 = *Vertex[1];
31  const Point& p2 = *Vertex[2];
32 
33  // Compute normal direction
34  Point Normal = (p2 - p1)^(p0 - p1);
35 
36  // Backface culling
37  return (Normal | (source - p0)) >= 0.0f;
38  }

Member Data Documentation

const Point* VertexPointers::Vertex[3]

Definition at line 25 of file OPC_MeshInterface.h.

Referenced by BackfaceCulling().


The documentation for this class was generated from the following file: