This reference page is linked to from the following overview
topics: IK
Concepts.
Detailed Description
- See also:
- Class IPoint2.
- Description:
- This class describes a 2D point using float x and y
coordinates. Methods are provided to add and subtract points,
multiply and divide by scalars, normalize and compute the dot
product of two Point2s. All methods are implemented by the
system.
- Data Members:
- float x,y;
The x and y components of the point.
static const Point2
Origin;
This data member is available in release 3.0 and later only.
This is equivalent to Point2(0.0f, 0.0f);
static const Point2
XAxis;
This data member is available in release 3.0 and later only.
This is equivalent to Point2(1.0f, 0.0f);
static const Point2
YAxis;
This data member is available in release 3.0 and later only.
This is equivalent to Point2(0.0f, 1.0f);
Constructors
#include <point2.h>
List of all members.
Constructor & Destructor Documentation
Point2 |
( |
float |
X, |
|
|
float |
Y |
|
) |
|
[inline] |
Point2 |
( |
double |
X, |
|
|
double |
Y |
|
) |
|
[inline] |
{
x = (float)X; y = (float)Y;
}
Point2 |
( |
int |
X, |
|
|
int |
Y |
|
) |
|
[inline] |
{
x = (float)X; y = (float)Y;
}
Point2 |
( |
float |
af[2] |
) |
[inline] |
{
x = af[0]; y = af[1];
}
Member Function Documentation
float& operator[] |
( |
int |
i |
) |
[inline] |
- Returns:
- A value for i of 0 will return x, 1 will return y.
const float& operator[] |
( |
int |
i |
) |
const [inline] |
- Returns:
- A value for i of 0 will return x, 1 will return y.
operator float * |
( |
|
) |
[inline] |
Point2 operator- |
( |
|
) |
const [inline] |
- Returns:
- A Point2 with -x,
-y.
Point2 operator+ |
( |
|
) |
const [inline] |
- Returns:
- Returns the Point2
unaltered.
float Length |
( |
|
) |
const [inline] |
{
return (float)sqrt(x*x+y*y);
}
int MaxComponent |
( |
|
) |
const |
- Returns:
- 0 for X, 1 for Y, 2 for Z.
int MinComponent |
( |
|
) |
const |
- Returns:
- 0 for X, 1 for Y, 2 for Z.
- Returns:
- A Point2 that is the
difference between two Point2s.
{
x -= a.x; y -= a.y;
return *this;
}
- Returns:
- A Point2 that is the
sum of two Point2's.
{
x += a.x; y += a.y;
return *this;
}
Point2 & operator*= |
( |
float |
f |
) |
[inline] |
- Returns:
- A Point2 multiplied
by a float.
{
x *= f; y *= f;
return *this;
}
Point2 & operator/= |
( |
float |
f |
) |
[inline] |
- Returns:
- A Point2 divided by
a float.
{
x /= f; y /= f;
return *this;
}
Point2 & Set |
( |
float |
X, |
|
|
float |
Y |
|
) |
|
[inline] |
- Parameters:
- float X
The new x value.
float Y
The new y value.
- Returns:
- A reference to this Point2.
{
x = X; y = Y;
return *this;
}
- Returns:
- A Point2 that is the
difference between two Point2's.
- Returns:
- The sum of two Point2's.
float DotProd |
( |
const Point2 & |
b |
) |
const [inline] |
float operator* |
( |
const Point2 & |
b |
) |
const [inline] |
int operator== |
( |
const Point2 & |
p |
) |
const [inline] |
- Returns:
- Nonzero if the Point2's are equal; otherwise 0.
{ return (x == p.x && y == p.y); }
int operator!= |
( |
const Point2 & |
p |
) |
const [inline] |
{ return ( (x != p.x) || (y != p.y) ); }
int Equals |
( |
const Point2 & |
p, |
|
|
float |
epsilon =
1E-6f |
|
) |
|
|
- Parameters:
- const Point2&
p
The point to compare.
float epsilon = 1E-6f
The tolerance to use in the comparison.
- Returns:
- Nonzero if the points are 'equal'; otherwise zero.
Member Data Documentation