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 25 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 30 of file physxSphere.cxx.

◆ contains() [2/3]

bool PhysxSphere::contains ( const PhysxSphere sphere) const

Tests if a sphere is contained within the sphere.

Definition at line 41 of file physxSphere.cxx.

◆ 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 51 of file physxSphere.cxx.

◆ get_center()

LPoint3f PhysxSphere::get_center ( ) const

Returns the center of the sphere.

Definition at line 74 of file physxSphere.cxx.

References PhysxManager::nxVec3_to_vec3().

◆ get_radius()

float PhysxSphere::get_radius ( ) const

Returns the sphere's radius.

Definition at line 94 of file physxSphere.cxx.

◆ intersect()

bool PhysxSphere::intersect ( const PhysxSphere sphere) const

Tests if the sphere intersects another sphere.

Returns TRUE if the spheres overlap.

Definition at line 65 of file physxSphere.cxx.

◆ is_valid()

bool PhysxSphere::is_valid ( ) const

Returns TRUE if this sphere is valid.

Definition at line 21 of file physxSphere.cxx.

◆ set_center()

void PhysxSphere::set_center ( LPoint3f  value)

Sets the center of the sphere.

Definition at line 83 of file physxSphere.cxx.

◆ set_radius()

void PhysxSphere::set_radius ( float  value)

Sets the sphere's radius.

Definition at line 103 of file physxSphere.cxx.


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