Panda3D
Public Member Functions | Public Attributes | List of all members
PhysxSphere Class Reference

Represents a sphere defined by its center point and radius. More...

#include "physxSphere.h"

Public Member Functions

 PhysxSphere (const PhysxSphere &sphere)
 
bool contains (const LPoint3f &p) const
 Tests if a point is contained within the sphere. More...
 
bool contains (const PhysxSphere &sphere) const
 Tests if a sphere is contained within the sphere. More...
 
bool contains (const LPoint3f &min, const LPoint3f &max) const
 Tests if an axis aligned box is contained within the sphere. More...
 
LPoint3f get_center () const
 Returns the center of the sphere. More...
 
float get_radius () const
 Returns the sphere's radius. More...
 
bool intersect (const PhysxSphere &sphere) const
 Tests if the sphere intersects another sphere. More...
 
bool is_valid () const
 Returns TRUE if this sphere is valid. More...
 
void set_center (LPoint3f value)
 Sets the center of the sphere. More...
 
void set_radius (float value)
 Sets the sphere's radius. More...
 

Public Attributes

NxSphere _sphere
 

Detailed Description

Represents a sphere defined by its center point and radius.

Definition at line 28 of file physxSphere.h.

Member Function Documentation

◆ contains() [1/3]

bool PhysxSphere::contains ( const LPoint3f p) const

Tests if a point is contained within the sphere.

Definition at line 35 of file physxSphere.cxx.

References LVecBase3f::is_nan(), and PhysxManager::vec3_to_nxVec3().

Referenced by contains(), and is_valid().

◆ contains() [2/3]

bool PhysxSphere::contains ( const PhysxSphere sphere) const

Tests if a sphere is contained within the sphere.

Definition at line 48 of file physxSphere.cxx.

References contains().

◆ contains() [3/3]

bool PhysxSphere::contains ( const LPoint3f min,
const LPoint3f max 
) const

Tests if an axis aligned box is contained within the sphere.

The axis aligned box is defined by the minimum corner and the maximum corner.

Definition at line 61 of file physxSphere.cxx.

References intersect(), LVecBase3f::is_nan(), and PhysxManager::vec3_to_nxVec3().

◆ get_center()

LPoint3f PhysxSphere::get_center ( ) const

Returns the center of the sphere.

Definition at line 88 of file physxSphere.cxx.

References PhysxManager::nxVec3_to_vec3(), and set_center().

Referenced by intersect().

◆ get_radius()

float PhysxSphere::get_radius ( ) const

Returns the sphere's radius.

Definition at line 112 of file physxSphere.cxx.

References set_radius().

Referenced by set_center().

◆ intersect()

bool PhysxSphere::intersect ( const PhysxSphere sphere) const

Tests if the sphere intersects another sphere.

Returns TRUE if the spheres overlap.

Definition at line 77 of file physxSphere.cxx.

References get_center().

Referenced by contains().

◆ is_valid()

bool PhysxSphere::is_valid ( ) const

Returns TRUE if this sphere is valid.

Definition at line 24 of file physxSphere.cxx.

References contains().

◆ set_center()

void PhysxSphere::set_center ( LPoint3f  value)

Sets the center of the sphere.

Definition at line 99 of file physxSphere.cxx.

References get_radius(), LVecBase3f::is_nan(), and PhysxManager::vec3_to_nxVec3().

Referenced by get_center().

◆ set_radius()

void PhysxSphere::set_radius ( float  value)

Sets the sphere's radius.

Definition at line 123 of file physxSphere.cxx.

Referenced by get_radius().


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