You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nvidia-texture-tools/src/nvmath/Plane.h

47 lines
928 B
C++

// This code is in the public domain -- Ignacio Castańo <castano@gmail.com>
#pragma once
#ifndef NV_MATH_PLANE_H
#define NV_MATH_PLANE_H
#include "nvmath.h"
#include "Vector.h"
namespace nv
{
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);
} // nv namespace
#endif // NV_MATH_PLANE_H