You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
1.1 KiB
71 lines
1.1 KiB
16 years ago
|
#ifndef __GEOTYPES_H
|
||
|
#define __GEOTYPES_H
|
||
|
|
||
|
#include "punkt3d.h"
|
||
|
|
||
|
namespace segl {
|
||
|
|
||
|
class Ray;
|
||
|
class Box
|
||
|
class Plane;
|
||
|
|
||
|
|
||
|
class Sphere {
|
||
|
public:
|
||
|
Punkt3D pos;
|
||
|
float radius;
|
||
|
|
||
|
Sphere(Punkt3D _pos, float radius);
|
||
|
Sphere();
|
||
|
|
||
|
bool collision(const Sphere &s);
|
||
|
bool collision(const Ray &r);
|
||
|
bool collision(const Box & b);
|
||
|
bool collision(const Plane &p);
|
||
|
};
|
||
|
|
||
|
class Ray {
|
||
|
public:
|
||
|
Punkt3D pos;
|
||
|
Punkt3D dir;
|
||
|
|
||
|
Ray();
|
||
|
Ray(Punkt3D _pos, Punkt3D _dir);
|
||
|
|
||
|
bool collision(const Sphere &s);
|
||
|
bool collision(const Ray &r);
|
||
|
bool collision(const Box & b);
|
||
|
bool collision(const Plane &p);
|
||
|
};
|
||
|
|
||
|
class Box {
|
||
|
public:
|
||
|
Punkt3D min;
|
||
|
Punkt3D max;
|
||
|
|
||
|
Box();
|
||
|
Box(Punkt3D _min, Punkt3D _max);
|
||
|
|
||
|
bool collision(const Sphere &s);
|
||
|
bool collision(const Ray &r);
|
||
|
bool collision(const Box & b);
|
||
|
bool collision(const Plane &p);
|
||
|
};
|
||
|
|
||
|
class Plane {
|
||
|
public:
|
||
|
Punkt3D pos;
|
||
|
Punkt3D norm;
|
||
|
|
||
|
Plane();
|
||
|
Plane(Punkt3D _pos, Punkt3D _norm);
|
||
|
Plane(float x, float y, float z, float a);
|
||
|
|
||
|
bool collision(const Sphere &s);
|
||
|
bool collision(const Ray &r);
|
||
|
bool collision(const Box & b);
|
||
|
bool collision(const Plane &p);
|
||
|
};
|
||
|
|
||
|
} // namespace segl
|