3ds Max C++ API Reference
point2.h File Reference
#include "maxheap.h"
#include "GeomExport.h"
#include "strbasic.h"
#include "ipoint2.h"
#include "assert1.h"
#include <iosfwd>
#include <math.h>

Classes

class  Point2
 

Functions

Point2 operator+ (const Point2 &a, float f)
 
float Length (const Point2 &)
 
int MaxComponent (const Point2 &)
 
int MinComponent (const Point2 &)
 
Point2 Normalize (const Point2 &)
 
Point2 operator* (float, const Point2 &)
 
Point2 operator* (const Point2 &, float)
 
Point2 operator/ (const Point2 &, float)
 
M_STD_OSTREAMoperator<< (M_STD_OSTREAM &, const Point2 &)
 
float LengthSquared (const Point2 &v)
 

Function Documentation

◆ operator+()

Point2 operator+ ( const Point2 a,
float  f 
)
inline
Remarks
Returns a copy of the Point2 argument offset by (f, f).
217 {
218  return (Point2(a.x + f, a.y + f));
219 }
Definition: point2.h:44
float y
Definition: point2.h:49
float x
Definition: point2.h:48

◆ Length()

float Length ( const Point2 v)
inline
Remarks
Returns the length of the Point2, ie:

sqrt(v.x*v.x+v.y*v.y);
247 {
248  return (float)sqrt(v.x * v.x + v.y * v.y);
249 }

◆ MaxComponent()

int MaxComponent ( const Point2 )
Remarks
Returns the component with the maximum absolute value. 0=x, 1=y.

◆ MinComponent()

int MinComponent ( const Point2 )
Remarks
Returns the component with the minimum absolute value. 0=x, 1=y.

◆ Normalize()

Point2 Normalize ( const Point2 )
Remarks
Returns a unit vector. This is a Point2 with each component divided by the point Length().

◆ operator*() [1/2]

Point2 operator* ( float  f,
const Point2 a 
)
inline
Remarks
Returns a Point2 multiplied by a scalar.
328 {
329  return (Point2(a.x * f, a.y * f));
330 }

◆ operator*() [2/2]

Point2 operator* ( const Point2 a,
float  f 
)
inline
Remarks
Returns a Point2 multiplied by a scalar.
333 {
334  return (Point2(a.x * f, a.y * f));
335 }

◆ operator/()

Point2 operator/ ( const Point2 a,
float  f 
)
inline
Remarks
Returns a Point2 whose x and y members are divided by a scalar.
338 {
339  DbgAssert(f != 0.0f);
340  float invF = 1.0f / f; // Mimic 2019 behavior
341  return (Point2(a.x * invF, a.y * invF));
342 }
#define DbgAssert(expr)
Definition: assert1.h:82

◆ operator<<()

M_STD_OSTREAM& operator<< ( M_STD_OSTREAM ,
const Point2  
)

◆ LengthSquared()

float LengthSquared ( const Point2 v)
inline
Remarks
The 'Length' squared of the point. This is v.x*v.x+v.y*v.y.
259 {
260  return (float)(v.x * v.x + v.y * v.y);
261 }