source: GTP/trunk/App/Games/Jungle_Rumble/src/Plane.cpp @ 1378

Revision 1378, 986 bytes checked in by giegl, 18 years ago (diff)

GTPD - Jungle Rumble - integrate into GTP SVN structure

Line 
1#include "dxstdafx.h"
2#include ".\plane.h"
3
4Plane::Plane(void)
5{
6}
7
8Plane::~Plane(void)
9{
10}
11
12void Plane::setPoint(Vector p)
13{
14        this->point = p;
15}
16
17void Plane::setPoint(float _x, float _y, float _z)
18{
19        this->point.x = _x;
20        this->point.y = _y;
21        this->point.z = _z;
22}
23
24Vector Plane::getPoint()
25{
26        return this->point;
27}
28
29void Plane::setNormal(Vector &n)
30{
31        this->normal = n;
32        this->normal.normalize();
33}
34
35void Plane::setNormal(float _nx, float _ny, float _nz)
36{
37        this->normal.x = _nx;
38    this->normal.y = _ny;
39        this->normal.z = _nz;
40        this->normal.normalize();
41}
42
43Vector Plane::getNormal()
44{
45        return this->normal;
46}
47
48bool Plane::inFront(Vector p)
49{
50        Vector diff;
51        diff = p - this->point;
52        diff.normalize();
53        float cosa = diff.dotProd(this->normal);
54        if(cosa>=0)
55                return true;
56        return false;
57}
58
59bool Plane::inFront(float x, float y, float z)
60{
61        Vector p;
62        p.x = x;
63        p.y = y;
64        p.z = z;
65        return this->inFront(p);
66}
67
Note: See TracBrowser for help on using the repository browser.