nvidia-texture-tools/src/nvmath/Plane.h

47 lines
928 B
C
Raw Normal View History

2011-09-01 22:16:37 +00:00
// This code is in the public domain -- Ignacio Casta<74>o <castano@gmail.com>
2008-04-17 06:58:43 +00:00
2010-05-27 23:19:24 +00:00
#pragma once
2008-04-17 06:58:43 +00:00
#ifndef NV_MATH_PLANE_H
#define NV_MATH_PLANE_H
2011-09-01 22:16:37 +00:00
#include "nvmath.h"
#include "Vector.h"
2008-04-17 06:58:43 +00:00
namespace nv
{
2010-05-27 23:19:24 +00:00
class Matrix;
class NVMATH_CLASS Plane
{
public:
typedef Plane const & Arg;
Plane();
Plane(float x, float y, float z, float w);
Plane(Vector4::Arg v);
Plane(Vector3::Arg v, float d);
Plane(Vector3::Arg normal, Vector3::Arg point);
const Plane & operator=(Plane::Arg v);
Vector3 vector() const;
scalar offset() const;
const Vector4 & asVector() const;
Vector4 & asVector();
void operator*=(scalar s);
private:
Vector4 p;
};
Plane transformPlane(const Matrix&, Plane::Arg);
Vector3 planeIntersection(Plane::Arg a, Plane::Arg b, Plane::Arg c);
2008-04-17 06:58:43 +00:00
} // nv namespace
#endif // NV_MATH_PLANE_H