Cocos2d-x  v3.10
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
Plane Class Reference

Defines plane. More...

Public Member Functions

 Plane (const Vec3 &p1, const Vec3 &p2, const Vec3 &p3)
 Create plane from tree point. More...
 
 Plane (const Vec3 &normal, float dist)
 Create plane from normal and dist. More...
 
 Plane (const Vec3 &normal, const Vec3 &point)
 Create plane from normal and a point on plane. More...
 
 Plane ()
 Create a default plan whose normal is (0, 0, 1), and _dist is 0, xoy plan in fact.
 
void initPlane (const Vec3 &p1, const Vec3 &p2, const Vec3 &p3)
 Init plane from tree point. More...
 
void initPlane (const Vec3 &normal, float dist)
 Init plane from normal and dist. More...
 
void initPlane (const Vec3 &normal, const Vec3 &point)
 Init plane from normal and a point on plane. More...
 
float dist2Plane (const Vec3 &p) const
 Get the specified point's distance to the plane. More...
 
const Vec3getNormal () const
 Gets the plane's normal. More...
 
float getDist () const
 Gets the distance which origin along its normal reach the plane. More...
 
PointSide getSide (const Vec3 &point) const
 Return the side where the point is. More...
 

Detailed Description

Defines plane.

Constructor & Destructor Documentation

Plane ( const Vec3 p1,
const Vec3 p2,
const Vec3 p3 
)

Create plane from tree point.

The point #1 which's in the plane. The point #2 which's in the plane. The point #3 which's in the plane.

Plane ( const Vec3 normal,
float  dist 
)

Create plane from normal and dist.

The normal vector of the plane. The distance from the origin along the normal.

Plane ( const Vec3 normal,
const Vec3 point 
)

Create plane from normal and a point on plane.

The normal vector of the plane. The point which's in the plane.

Member Function Documentation

void initPlane ( const Vec3 p1,
const Vec3 p2,
const Vec3 p3 
)

Init plane from tree point.

The point #1 which's in the plane. The point #2 which's in the plane. The point #3 which's in the plane.

void initPlane ( const Vec3 normal,
float  dist 
)

Init plane from normal and dist.

The normal vector of the plane. The distance from the origin.

void initPlane ( const Vec3 normal,
const Vec3 point 
)

Init plane from normal and a point on plane.

The normal vector of the plane. The point which's in the plane.

float dist2Plane ( const Vec3 p) const

Get the specified point's distance to the plane.

The specified point. The distance, > 0 in the normal side.

const Vec3& getNormal ( ) const
inline

Gets the plane's normal.

The normal of the plane.

float getDist ( ) const
inline

Gets the distance which origin along its normal reach the plane.

The distance to the origin.

PointSide getSide ( const Vec3 point) const

Return the side where the point is.

The side.


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