Blame shape.h

e31ea0
e31ea0
#ifndef SHAPE_H
e31ea0
#define SHAPE_H
e31ea0
e31ea0
e31ea0
#include "geometry.h"
e31ea0
#include "model.h"
e31ea0
e31ea0
e31ea0
class Shape {
e31ea0
public:
e31ea0
    virtual ~Shape() { }
e31ea0
    virtual Real distance_to_triangle(const Triangle &triangle) const = 0;
e31ea0
};
e31ea0
b2ca59
class PointShape: public Shape {
b2ca59
public:
b2ca59
    Matrix4 matrix;
b2ca59
    PointShape(const Vector3 &pos, const Vector3 &dir);
b2ca59
    Real distance_to_triangle(const Triangle &triangle) const override;
b2ca59
    static Real base_distance_to_triangle(const Vector3 *v);
b2ca59
};
b2ca59
e31ea0
class CilinderShape: public Shape {
e31ea0
public:
e31ea0
    Matrix4 matrix;
b2ca59
    CilinderShape(const Vector3 &pos, const Vector3 &dir, Real radius);
b2ca59
    Real distance_to_triangle(const Triangle &triangle) const override;
b2ca59
    static Real base_distance_to_triangle(const Vector3 *v);
b2ca59
};
b2ca59
b2ca59
class ConeShape: public Shape {
b2ca59
public:
b2ca59
    Matrix4 matrix;
b2ca59
    Real cut_radius;
b2ca59
    Real height;
b2ca59
b2ca59
    ConeShape(const Vector3 &pos, const Vector3 &dir, Real radius, Real height, Real cut_radius = 0);
e31ea0
    Real distance_to_triangle(const Triangle &triangle) const override;
b2ca59
    static Real base_distance_to_triangle(const Vector3 *v, Real height, Real cut_radius = 0);
e31ea0
};
e31ea0
e31ea0
e31ea0
#endif