Torque2D Reference
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Point2I Class Reference

#include <mPoint.h>

Public Member Functions

 Point2I ()
 Create an uninitialized point.
 
 Point2I (const Point2I &)
 Copy constructor.
 
 Point2I (const S32 in_x, const S32 in_y)
 Create point from two co-ordinates.
 
void set (const S32 in_x, const S32 in_y)
 Set (x,y) position.
 
void setMin (const Point2I &)
 Store lesser co-ordinates from parameter in this point.
 
void setMax (const Point2I &)
 Store greater co-ordinates from parameter in this point.
 
void neg ()
 Invert sign of point's co-ordinates.
 
void convolve (const Point2I &)
 Convolve this point by parameter.
 
bool isZero () const
 Is this point at the origin? (No epsilon used)
 
F32 len () const
 Get the length of the point.
 
bool operator== (const Point2I &) const
 
bool operator!= (const Point2I &) const
 
Point2I operator+ (const Point2I &) const
 
Point2I operator- (const Point2I &) const
 
Point2Ioperator+= (const Point2I &)
 
Point2Ioperator-= (const Point2I &)
 
Point2I operator* (const S32) const
 
Point2Ioperator*= (const S32)
 
Point2I operator/ (const S32) const
 
Point2Ioperator/= (const S32)
 
Point2I operator- () const
 

Public Attributes

S32 x
 X position.
 
S32 y
 Y position.
 

Static Public Attributes

static const Point2I One
 
static const Point2I Zero
 
static const Point2I Min
 
static const Point2I Max
 

Detailed Description

2D integer point

Uses S32 internally.

Constructor & Destructor Documentation

◆ Point2I() [1/3]

Point2I ( )
inline

Create an uninitialized point.

◆ Point2I() [2/3]

Point2I ( const Point2I _copy)
inline

Copy constructor.

◆ Point2I() [3/3]

Point2I ( const S32  in_x,
const S32  in_y 
)
inline

Create point from two co-ordinates.

Member Function Documentation

◆ convolve()

void convolve ( const Point2I c)
inline

Convolve this point by parameter.

◆ isZero()

bool isZero ( ) const
inline

Is this point at the origin? (No epsilon used)

◆ len()

F32 len ( ) const
inline

Get the length of the point.

◆ neg()

void neg ( )
inline

Invert sign of point's co-ordinates.

◆ operator!=()

bool operator!= ( const Point2I _test) const
inline

◆ operator*()

Point2I operator* ( const S32  mul) const
inline

◆ operator*=()

Point2I & operator*= ( const S32  mul)
inline

◆ operator+()

Point2I operator+ ( const Point2I _add) const
inline

◆ operator+=()

Point2I & operator+= ( const Point2I _add)
inline

◆ operator-() [1/2]

Point2I operator- ( ) const
inline

◆ operator-() [2/2]

Point2I operator- ( const Point2I _rSub) const
inline

◆ operator-=()

Point2I & operator-= ( const Point2I _rSub)
inline

◆ operator/()

Point2I operator/ ( const S32  div) const
inline

◆ operator/=()

Point2I & operator/= ( const S32  div)
inline

◆ operator==()

bool operator== ( const Point2I _test) const
inline

◆ set()

void set ( const S32  in_x,
const S32  in_y 
)
inline

Set (x,y) position.

◆ setMax()

void setMax ( const Point2I _test)
inline

Store greater co-ordinates from parameter in this point.

◆ setMin()

void setMin ( const Point2I _test)
inline

Store lesser co-ordinates from parameter in this point.

Member Data Documentation

◆ Max

const Point2I Max
static

◆ Min

const Point2I Min
static

◆ One

const Point2I One
static

◆ x

S32 x

X position.

◆ y

S32 y

Y position.

◆ Zero

const Point2I Zero
static

The documentation for this class was generated from the following files: