Cocos2d-x  v3.10
PUSphere Class Reference

Internal class£¬A sphere primitive, mostly used for bounds checking”£ A sphere in math texts is normally represented by the function x^2 + y^2 + z^2 = r^2 (for sphere's centered on the origin). More...

## Public Member Functions

PUSphere ()
Standard constructor - creates a unit sphere around the origin. More...

PUSphere (const Vec3 &center, float radius)
Constructor allowing arbitrary spheres. More...

PUSphere ( var center, var radius)
Constructor allowing arbitrary spheres. More...

PUSphere ( local center, local radius)
Constructor allowing arbitrary spheres. More...

Returns the radius of the sphere. More...

Sets the radius of the sphere. More...

const Vec3getCenter (void) const
Returns the center point of the sphere The center point of the sphere.

void setCenter (const Vec3 &center)
Sets the center point of the sphere. More...

bool intersects (const PUSphere &s) const
Returns whether or not this sphere intersects another sphere. More...

bool intersects (const Vec3 &v) const
Returns whether or not this sphere intersects a box. More...

void merge (const PUSphere &oth)
Merges another Sphere into the current sphere. More...

## Detailed Description

Internal class£¬A sphere primitive, mostly used for bounds checking”£ A sphere in math texts is normally represented by the function x^2 + y^2 + z^2 = r^2 (for sphere's centered on the origin).

this stores spheres simply as a center point and a radius.

## Constructor & Destructor Documentation

 PUSphere ( )

Standard constructor - creates a unit sphere around the origin.

 var PUSphere ( )

Standard constructor - creates a unit sphere around the origin.

 local PUSphere ( )

Standard constructor - creates a unit sphere around the origin.

 PUSphere ( const Vec3 & center, float radius )

Constructor allowing arbitrary spheres.

The center point of the sphere. The radius of the sphere.

 var PUSphere ( var center, var radius )

Constructor allowing arbitrary spheres.

The center point of the sphere. The radius of the sphere.

 local PUSphere ( local center, local radius )

Constructor allowing arbitrary spheres.

The center point of the sphere. The radius of the sphere.

## Member Function Documentation

 float getRadius ( void ) const
inline

Returns the radius of the sphere.

inline

Returns the radius of the sphere.

inline

Returns the radius of the sphere.

inline

Sets the radius of the sphere.

inline

Sets the radius of the sphere.

inline

Sets the radius of the sphere.

 void setCenter ( const Vec3 & center )
inline

Sets the center point of the sphere.

The center point of the sphere.

 var setCenter ( var center )
inline

Sets the center point of the sphere.

The center point of the sphere.

 local setCenter ( local center )
inline

Sets the center point of the sphere.

The center point of the sphere.

 bool intersects ( const PUSphere & s ) const
inline

Returns whether or not this sphere intersects another sphere.

The another sphere.

 var intersects ( var s )
inline

Returns whether or not this sphere intersects another sphere.

The another sphere.

 local intersects ( local s )
inline

Returns whether or not this sphere intersects another sphere.

The another sphere.

 bool intersects ( const Vec3 & v ) const
inline

Returns whether or not this sphere intersects a box.

Returns whether or not this sphere intersects a plane. Returns whether or not this sphere intersects a point. The Point.

 var intersects ( var v )
inline

Returns whether or not this sphere intersects a box.

Returns whether or not this sphere intersects a plane. Returns whether or not this sphere intersects a point. The Point.

 local intersects ( local v )
inline

Returns whether or not this sphere intersects a box.

Returns whether or not this sphere intersects a plane. Returns whether or not this sphere intersects a point. The Point.

 void merge ( const PUSphere & oth )

Merges another Sphere into the current sphere.

The another sphere.

 var merge ( var oth )

Merges another Sphere into the current sphere.

The another sphere.

 local merge ( local oth )

Merges another Sphere into the current sphere.

The another sphere.

The documentation for this class was generated from the following file:
• CCPUSphere.h