Files
TeslaRel410/CODE/RP/MUNGA/POINT2D.HPP
T
CydandClaude Fable 5 fdd9ac9d97 Initial import: Tesla Release 4.10 (Tesla:BattleTech & Tesla:Red Planet)
Archival snapshot of the Virtual World Entertainment Tesla cockpit
software, 1994-1996: MUNGA engine and L4 pod layer source (Borland
C++ 5.0), BT/RP game code, and game content (models, audio, maps,
gauges, Division renderer data). Includes third-party libraries:
Division dVS/DPL graphics, HMI SOS audio, WATTCP networking.

Files are preserved byte-for-byte (.gitattributes disables all
line-ending conversion). README.md documents the layout, target
hardware, and toolchain.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 13:21:58 -05:00

150 lines
3.7 KiB
C++

//===========================================================================//
// File: point.hh //
// Project: MUNGA Brick: Math Library //
// Contents: Interface specification of the point class //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 11/19/94 JMA Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(POINT_HH)
# define POINT_HH
# if !defined(VECTOR3D_HH)
# include "vector3d.hh"
# endif
# if !defined(VECTOR4D_HH)
# include "vector4d.hh"
# endif
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Point2D ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
template <class T> class Point2DOf:
public Vector2DOf<T>
{
public:
//
// Constructors
//
Point2DOf()
{}
Point2DOf(
T x,
T y
):
Vector2DOf<T>(x,y)
{}
Point2DOf(const Vector2DOf<T> &v):
Vector2DOf<T>(v)
{}
//
// Assignment operators
//
Point2DOf<T>& operator=(const Vector2DOf<T>& v)
{Vector2DOf<T>::operator=(v); return *this;}
//
// Math operators
//
Point2DOf<T>&
Negate(const Vector2DOf<T> &v)
{Vector2DOf<T>::Negate(v); return *this;}
Point2DOf<T>&
Add(
const Vector2DOf<T>& v1,
const Vector2DOf<T>& v2
)
{Vector2DOf<T>::Add(v1,v2); return *this;}
Point2DOf<T>&
operator+=(const Vector2DOf<T>& v)
{return Add(*this,v);}
Point2DOf<T>&
Subtract(
const Point2DOf<T>& p,
const Vector2DOf<T>& v
)
{Vector2DOf<T>::Subtract(p,v); return *this;}
Point2DOf<T>&
operator-=(const Vector2DOf<T>& v)
{return Subtract(*this,v);}
float
operator*(const Vector2DOf<T>& v) const
{return Vector2DOf<T>::operator*(v);}
Point2DOf<T>&
Multiply(
const Point2DOf<T>& p,
float scale
)
{Vector2DOf<T>::Multiply(p,scale); return *this;}
Point2DOf<T>&
operator*=(float value)
{return Multiply(*this,value);}
Point2DOf<T>&
Multiply(
const Point2DOf<T>& p,
const Vector2DOf<T>& v
)
{Vector2DOf<T>::Multiply(p,v); return *this;}
Point2DOf<T>&
operator*=(const Vector2DOf<T> &v)
{return Multiply(*this,v);}
Point2DOf<T>&
Divide(
const Vector2DOf<T>& v,
float scale
)
{Vector2DOf<T>::Divide(v,scale); return *this;}
Point2DOf<T>&
operator/=(float value)
{return Divide(*this,value);}
Point2DOf<T>&
Divide(
const Vector2DOf<T>& v1,
const Vector2DOf<T>& v2
)
{Vector2DOf<T>::Divide(v1,v2); return *this;}
Point2DOf<T>&
operator/=(const Vector2DOf<T> &v)
{return Divide(*this,v);}
//
// Miscellaneous functions
//
Point2DOf<T>&
Combine(
const Vector2DOf<T>& v1,
float t1,
const Vector2DOf<T>& v2,
float t2
)
{Vector2DOf<T>::Combine(v1,t1,v2,t2); return *this;}
//
// Template support functions
//
Point2DOf<T>&
Lerp(
const Vector2DOf<T>& v1,
const Vector2DOf<T>& v2,
float t
)
{Vector2DOf<T>::Lerp(v1,v2,t); return *this;}
};
#endif