Files
RP412/MUNGA/POINT3D.h
T
CydandClaude Opus 4.8 4abbf8879f Initial import of Red Planet v4.10 Win32 source
Imports the current Win32 source for the pod-racing game 'Red Planet',
built on the MUNGA engine and its L4 (Win32/DirectX) platform layer:

- MUNGA / MUNGA_L4: cross-platform engine core and Win32 backend
- RP / RP_L4: Red Planet game logic and Win32 application
- DivLoader, Setup1: asset loader and installer project
- lib, MUNGA_L4/openal, MUNGA_L4/sos: third-party audio dependencies

Removed stale Subversion metadata and added .gitignore/.gitattributes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 07:59:51 -05:00

126 lines
2.3 KiB
C++

#pragma once
#include "vector3d.h"
class Origin;
class Vector4D;
class AffineMatrix;
class Point3D : public Vector3D
{
public:
static const Point3D Identity;
Point3D() {}
Point3D(Scalar x, Scalar y, Scalar z) : Vector3D(x, y, z) {}
Point3D& operator=(const Vector3D& v)
{
Vector3D::operator =(v);
return *this;
}
Point3D& operator=(const Vector4D& v);
Point3D& operator=(const Origin &p);
Point3D& operator=(const AffineMatrix &matrix);
Point3D& Negate(const Vector3D &v)
{
Vector3D::Negate(v);
return *this;
}
Point3D& Add(const Vector3D& v1, const Vector3D& v2)
{
Vector3D::Add(v1, v2);
return *this;
}
Point3D& operator+=(const Vector3D& v)
{
return Add(*this, v);
}
Point3D& Subtract(const Point3D& p, const Vector3D& v)
{
Vector3D::Subtract(p, v);
return *this;
}
Point3D& operator-=(const Vector3D& v)
{
return Subtract(*this, v);
}
Scalar operator*(const Vector3D& v) const
{
return Vector3D::operator*(v);
}
Point3D& Multiply(const Point3D& p, Scalar scale)
{
Vector3D::Multiply(p, scale);
return *this;
}
Point3D& operator *=(Scalar value)
{
return Multiply(*this, value);
}
Point3D& Multiply(const Point3D& p, const Vector3D& v)
{
Vector3D::Multiply(p, v);
return *this;
}
Point3D& operator*=(const Vector3D &v)
{
return Multiply(*this, v);
}
Point3D& Divide(const Vector3D& v, Scalar scale)
{
Vector3D::Divide(v, scale);
return *this;
}
Point3D& Divide(const Vector3D& v1, const Vector3D& v2)
{
Vector3D::Divide(v1, v2);
return *this;
}
Point3D& operator/=(const Vector3D &v)
{
return Divide(*this, v);
}
Point3D& Multiply(const Vector3D &v, const AffineMatrix &m)
{
Vector3D::Multiply(v, m);
return *this;
}
Point3D& Multiply(const Point3D &p, const AffineMatrix &m);
Point3D& operator*=(const AffineMatrix &m)
{
Point3D src(*this);
return Multiply(src, m);
}
Point3D& MultiplyByInverse(const Vector3D &v, const LinearMatrix &m)
{
Vector3D::MultiplyByInverse(v, m);
return *this;
}
Point3D& MultiplyByInverse(const Point3D &p, const LinearMatrix &m);
Point3D& Combine(const Vector3D& v1, Scalar t1, const Vector3D& v2, Scalar t2)
{
Vector3D::Combine(v1, t1, v2, t2);
return *this;
}
Point3D& Lerp(const Vector3D& v1, const Vector3D& v2, Scalar t)
{
Vector3D::Lerp(v1, v2, t);
return *this;
}
static Logical TestClass();
};
#include "affnmtrx.h"