pikmin2/include/Plane.h
EpochFlame 4bca5a00cd progress for #50
use f32 and f64 in most headers
2023-01-16 15:23:01 -05:00

37 lines
542 B
C

#ifndef _PLANE_H
#define _PLANE_H
#include "Vector3.h"
struct Plane {
Plane()
: a(0.0f)
, b(1.0f)
, c(0.0f)
, d(0.0f)
{
}
void read(Stream&);
void write(Stream&);
f32 calcDist(const Vector3f& vec) const { return (vec.x * a + vec.y * b + vec.z * c - d); }
inline void setVec(Plane& plane)
{
a = plane.a;
b = plane.b;
c = plane.c;
}
inline void setDist(Plane& plane) { d = plane.d; }
void calcProjection(Vector3f&);
void intersectRay(Vector3f&, Vector3f&);
f32 a;
f32 b;
f32 c;
f32 d;
};
#endif