Defines a plane in 3D space.
More...
#include <CCPUPlane.h>
|
| PUPlane () |
| Default constructor - sets everything to 0. More...
|
|
| PUPlane (const PUPlane &rhs) |
| PUPlane (const Vec3 &rkNormal, float fConstant) |
| Construct a plane through a normal, and a distance to move the plane along the normal. More...
|
|
| PUPlane (float a, float b, float c, float d) |
| Construct a plane using the 4 constants directly. More...
|
|
| PUPlane (const Vec3 &rkNormal, const Vec3 &rkPoint) |
| PUPlane (const Vec3 &rkPoint0, const Vec3 &rkPoint1, const Vec3 &rkPoint2) |
float | getDistance (const Vec3 &rkPoint) const |
| Returns the side where the alignedBox is. More...
|
|
void | redefine (const Vec3 &rkPoint0, const Vec3 &rkPoint1, const Vec3 &rkPoint2) |
| Redefine this plane based on 3 points. More...
|
|
void | redefine (const Vec3 &rkNormal, const Vec3 &rkPoint) |
| Redefine this plane based on a normal and a point. More...
|
|
Vec3 | projectVector (const Vec3 &v) const |
| Project a vector onto the plane. More...
|
|
float | normalize (void) |
| Normalises the plane. More...
|
|
bool | operator== (const PUPlane &rhs) const |
| Comparison operator. More...
|
|
bool | operator!= (const PUPlane &rhs) const |
Defines a plane in 3D space.
- This equates to a vector (the normal of the plane, whose x, y and z components equate to the coefficients A, B and C respectively), and a constant (D) which is the distance along the normal you have to go to move the plane back to the origin.
The "positive side" of the plane is the half space to which the plane normal points.
The "negative side" is the other half space. The flag "no side" indicates the plane itself.
Enumerator |
---|
NO_SIDE |
|
POSITIVE_SIDE |
|
NEGATIVE_SIDE |
|
BOTH_SIDE |
|
The "positive side" of the plane is the half space to which the plane normal points.
The "negative side" is the other half space. The flag "no side" indicates the plane itself.
Enumerator |
---|
NO_SIDE |
|
POSITIVE_SIDE |
|
NEGATIVE_SIDE |
|
BOTH_SIDE |
|
The "positive side" of the plane is the half space to which the plane normal points.
The "negative side" is the other half space. The flag "no side" indicates the plane itself.
Enumerator |
---|
NO_SIDE |
|
POSITIVE_SIDE |
|
NEGATIVE_SIDE |
|
BOTH_SIDE |
|
Default constructor - sets everything to 0.
Default constructor - sets everything to 0.
Default constructor - sets everything to 0.
Construct a plane through a normal, and a distance to move the plane along the normal.
var PUPlane |
( |
var |
rkNormal, |
|
|
var |
fConstant |
|
) |
| |
Construct a plane through a normal, and a distance to move the plane along the normal.
local PUPlane |
( |
local |
rkNormal, |
|
|
local |
fConstant |
|
) |
| |
Construct a plane through a normal, and a distance to move the plane along the normal.
PUPlane |
( |
float |
a, |
|
|
float |
b, |
|
|
float |
c, |
|
|
float |
d |
|
) |
| |
Construct a plane using the 4 constants directly.
var PUPlane |
( |
var |
a, |
|
|
var |
b, |
|
|
var |
c, |
|
|
var |
d |
|
) |
| |
Construct a plane using the 4 constants directly.
local PUPlane |
( |
local |
a, |
|
|
local |
b, |
|
|
local |
c, |
|
|
local |
d |
|
) |
| |
Construct a plane using the 4 constants directly.
var PUPlane |
( |
var |
rkNormal, |
|
|
var |
rkPoint |
|
) |
| |
local PUPlane |
( |
local |
rkNormal, |
|
|
local |
rkPoint |
|
) |
| |
var PUPlane |
( |
var |
rkPoint0, |
|
|
var |
rkPoint1, |
|
|
var |
rkPoint2 |
|
) |
| |
local PUPlane |
( |
local |
rkPoint0, |
|
|
local |
rkPoint1, |
|
|
local |
rkPoint2 |
|
) |
| |
float getDistance |
( |
const Vec3 & |
rkPoint | ) |
const |
Returns the side where the alignedBox is.
The flag BOTH_SIDE indicates an intersecting box. One corner ON the plane is sufficient to consider the box and the plane intersecting. Returns which side of the plane that the given box lies on. The box is defined as centre/half-size pairs for effectively.
- Parameters
-
centre | The centre of the box. |
halfSize | The half-size of the box. |
- Returns
- POSITIVE_SIDE if the box complete lies on the "positive side" of the plane, NEGATIVE_SIDE if the box complete lies on the "negative side" of the plane, and BOTH_SIDE if the box intersects the plane.This is a pseudodistance. The sign of the return value is positive if the point is on the positive side of the plane, negative if the point is on the negative side, and zero if the point is on the plane.
- The absolute value of the return value is the true distance only when the plane normal is a unit length vector.
var getDistance |
( |
var |
rkPoint | ) |
|
Returns the side where the alignedBox is.
The flag BOTH_SIDE indicates an intersecting box. One corner ON the plane is sufficient to consider the box and the plane intersecting. Returns which side of the plane that the given box lies on. The box is defined as centre/half-size pairs for effectively.
- Parameters
-
centre | The centre of the box. |
halfSize | The half-size of the box. |
- Returns
- POSITIVE_SIDE if the box complete lies on the "positive side" of the plane, NEGATIVE_SIDE if the box complete lies on the "negative side" of the plane, and BOTH_SIDE if the box intersects the plane.This is a pseudodistance. The sign of the return value is positive if the point is on the positive side of the plane, negative if the point is on the negative side, and zero if the point is on the plane.
- The absolute value of the return value is the true distance only when the plane normal is a unit length vector.
local getDistance |
( |
local |
rkPoint | ) |
|
Returns the side where the alignedBox is.
The flag BOTH_SIDE indicates an intersecting box. One corner ON the plane is sufficient to consider the box and the plane intersecting. Returns which side of the plane that the given box lies on. The box is defined as centre/half-size pairs for effectively.
- Parameters
-
centre | The centre of the box. |
halfSize | The half-size of the box. |
- Returns
- POSITIVE_SIDE if the box complete lies on the "positive side" of the plane, NEGATIVE_SIDE if the box complete lies on the "negative side" of the plane, and BOTH_SIDE if the box intersects the plane.This is a pseudodistance. The sign of the return value is positive if the point is on the positive side of the plane, negative if the point is on the negative side, and zero if the point is on the plane.
- The absolute value of the return value is the true distance only when the plane normal is a unit length vector.
Normalises the plane.
- Note
- This function will not crash for zero-sized vectors, but there will be no changes made to their components.
- Returns
- The previous length of the plane's normal.
Normalises the plane.
- Note
- This function will not crash for zero-sized vectors, but there will be no changes made to their components.
- Returns
- The previous length of the plane's normal.
Normalises the plane.
- Note
- This function will not crash for zero-sized vectors, but there will be no changes made to their components.
- Returns
- The previous length of the plane's normal.
bool operator!= |
( |
const PUPlane & |
rhs | ) |
const |
|
inline |
bool operator!= |
( |
var |
rhs | ) |
|
|
inline |
bool operator!= |
( |
local |
rhs | ) |
|
|
inline |
bool operator== |
( |
const PUPlane & |
rhs | ) |
const |
|
inline |
bool operator== |
( |
var |
rhs | ) |
|
|
inline |
bool operator== |
( |
local |
rhs | ) |
|
|
inline |
Vec3 projectVector |
( |
const Vec3 & |
v | ) |
const |
Project a vector onto the plane.
- Parameters
-
var projectVector |
( |
var |
v | ) |
|
Project a vector onto the plane.
- Parameters
-
local projectVector |
( |
local |
v | ) |
|
Project a vector onto the plane.
- Parameters
-
void redefine |
( |
const Vec3 & |
rkPoint0, |
|
|
const Vec3 & |
rkPoint1, |
|
|
const Vec3 & |
rkPoint2 |
|
) |
| |
Redefine this plane based on 3 points.
var redefine |
( |
var |
rkPoint0, |
|
|
var |
rkPoint1, |
|
|
var |
rkPoint2 |
|
) |
| |
Redefine this plane based on 3 points.
local redefine |
( |
local |
rkPoint0, |
|
|
local |
rkPoint1, |
|
|
local |
rkPoint2 |
|
) |
| |
Redefine this plane based on 3 points.
void redefine |
( |
const Vec3 & |
rkNormal, |
|
|
const Vec3 & |
rkPoint |
|
) |
| |
Redefine this plane based on a normal and a point.
var redefine |
( |
var |
rkNormal, |
|
|
var |
rkPoint |
|
) |
| |
Redefine this plane based on a normal and a point.
local redefine |
( |
local |
rkNormal, |
|
|
local |
rkPoint |
|
) |
| |
Redefine this plane based on a normal and a point.
The documentation for this class was generated from the following file:
- /Users/minggo/SourceCode/cocos2d-x/extensions/Particle3D/PU/CCPUPlane.h