| 1 |
NAME SbPlane SbPln "" { oriented plane in 3D } |
| 2 |
INCLUDE SbLinear.h |
| 3 |
DESC { |
| 4 |
Represents an oriented plane in 3D. This is a lightweight |
| 5 |
class/datatype that is used for arguments to some Inventor objects. |
| 6 |
\- |
| 7 |
Note that there are no \mCreate\. or \mDelete\. functions available for |
| 8 |
this class. \cSbPlane\.'s should be declared and/or malloc'd as standard |
| 9 |
C structs: |
| 10 |
\b\k |
| 11 |
/* This is defined in Inventor_c/SbLinear.h: */ |
| 12 |
struct SbPlane \{ |
| 13 |
struct SbVec3f normalVec; |
| 14 |
float distance; |
| 15 |
\}; |
| 16 |
typedef SbPlane SbPln; |
| 17 |
|
| 18 |
|
| 19 |
/* This is what your code should look like: */ |
| 20 |
SbPlane p; |
| 21 |
|
| 22 |
SbV3fSetX_Y_Z( p.normalVec, 1.0, 0.0, 0.0 ); |
| 23 |
p.distance = 3.0; |
| 24 |
\.\. |
| 25 |
\. |
| 26 |
} |
| 27 |
BEGIN C++ |
| 28 |
METHOD "" SbPlane() {} |
| 29 |
METHOD "" SbPlane(const SbVec3f &p0, const SbVec3f &p1, const SbVec3f &p2) {} |
| 30 |
METHOD "" SbPlane(const SbVec3f &normal, float distance) {} |
| 31 |
METHOD "" SbPlane(const SbVec3f &normal, const SbVec3f &point) { |
| 32 |
Constructors. \ap0\., \ap1\., and \ap2\. represent three points in the plane. |
| 33 |
\anormal\. is a normal vector, \adistance\. is distance from origin to plane |
| 34 |
along normal vector, and \apoint\. is a point in 3-space for the plane to pass |
| 35 |
through. |
| 36 |
} |
| 37 |
END |
| 38 |
METHOD "" void offset(float d) { |
| 39 |
Offset a plane by a given distance. |
| 40 |
} |
| 41 |
METHOD "" SbBool intersect(const SbLine &l, SbVec3f &intersection) const { |
| 42 |
Intersect line and plane, returning TRUE if there is an intersection, |
| 43 |
FALSE if line is parallel to plane. |
| 44 |
} |
| 45 |
METHOD "" void transform(const SbMatrix &matrix) { |
| 46 |
Transforms the plane by the given matrix. |
| 47 |
} |
| 48 |
METHOD "" SbBool isInHalfSpace(const SbVec3f &point) const { |
| 49 |
Returns TRUE if the given point is within the half-space |
| 50 |
defined by the plane. |
| 51 |
} |
| 52 |
BEGIN C++ |
| 53 |
METHOD "" const SbVec3f & getNormal() const { |
| 54 |
Returns normal vector to plane. |
| 55 |
} |
| 56 |
METHOD "" float getDistanceFromOrigin() const { |
| 57 |
Returns distance from origin to plane. |
| 58 |
} |
| 59 |
END |
| 60 |
METHOD "" int operator ==(const SbPlane &p1, const SbPlane &p2) {} |
| 61 |
METHOD "" int operator !=(const SbPlane &p1, const SbPlane &p2) { |
| 62 |
Equality/inequality comparison operators. |
| 63 |
} |
| 64 |
ALSO { SbVec3f, SbLine } |
| 65 |
|
| 66 |
|