A 3D Point with floating point coordinates, used for storing vertices and all sorts of other 3D graphics operations.
Point3s can be transformed by a Matrix4. Example:
std::cout << a << std::endl;
std::cout << b << std::endl;
float option1 = p.x();
float option2 = p[0];
p2[0] = 0.4;
p2[1] = 1.2;
p2[2] = 3.1;
static Matrix4 Translation(const Vector3 &v)
Returns the translation matrix described by the vector.
Point3()
Default point at the origin.
Definition at line 52 of file point3.h.
|
| Point3 () |
| Default point at the origin. More...
|
|
| Point3 (float x, float y, float z) |
| Constructs a point given (x,y,z,1), where the 1 comes from the use of homogeneous coordinates in computer graphics. More...
|
|
| Point3 (float *p) |
| Constructs a point given a pointer to x,y,z data. More...
|
|
| Point3 (const Point3 &p) |
| Copy constructor for point. More...
|
|
virtual | ~Point3 () |
| Point destructor. More...
|
|
bool | operator== (const Point3 &p) const |
| Check for "equality", taking floating point imprecision into account. More...
|
|
bool | operator!= (const Point3 &p) const |
| Check for "inequality", taking floating point imprecision into account. More...
|
|
Point3 & | operator= (const Point3 &p) |
| Assignment operator. More...
|
|
float | operator[] (const int i) const |
| Read only access to the ith coordinate of the point. More...
|
|
float & | operator[] (const int i) |
| Returns a reference to the ith coordinate of the point. Use this accessor if you wish to set the coordinate rather than just request its value. Example: More...
|
|
float | x () const |
| Read only access to the x coordinate. Can also use my_point[0]. Use the my_point[0] = 1.0; form if you need to set the value. More...
|
|
float | y () const |
| Read only access to the y coordinate. Can also use my_point[1]. Use the my_point[1] = 1.0; form if you need to set the value. More...
|
|
float | z () const |
| Read only access to the z coordinate. Can also use my_point[2]. Use the my_point[2] = 1.0; form if you need to set the value. More...
|
|
float | w () const |
| In homogeneous coordinates, the w coordinate for all points is 1.0. More...
|
|
const float * | value_ptr () const |
| Returns a const pointer to the raw data array. More...
|
|
Point3 | Lerp (const Point3 &b, float alpha) const |
| Linear interpolation between this point and another. Alpha=0.0 returns this point, and alpha=1.0 returns the other point, other values blend between the two. More...
|
|
float | DistanceToPlane (const Point3 &plane_origin, const Vector3 &plane_normal) |
| Returns the shortest (i.e., perpendicular) distance from this point to a plane defined by a point and a normal. More...
|
|
Point3 | ClosestPointOnPlane (const Point3 &plane_origin, const Vector3 &plane_normal) |
| Returns the perpendicular projection of this point onto a plane defined by a point and a normal. More...
|
|
Point3 | ClosestPoint (const std::vector< Point3 > &point_list) |
| Given a list of points, returns the closest in the last to the current point. More...
|
|