Support Forum       G3D Web Page     
Public Member Functions | Static Public Member Functions | List of all members
G3D::Cone Class Reference


An infinite cone. More...

Public Member Functions

 Cone (const Vector3 &tip, const Vector3 &direction, float angle)
 
More...
 
 Cone (const Vector3 &tip, const class Box &box)
 
Forms the smallest cone that contains the box. More...
 
virtual ~Cone ()
 
bool contains (const class Vector3 &v) const
 
True if v is a point inside the cone. More...
 
bool intersects (const class Sphere &s) const
 
Returns true if the cone touches, intersects, or contains b. More...
 
Vector3 randomDirectionInCone (Random &rng) const
 

Static Public Member Functions

static float halfAngleFromSolidAngle (float solidAngle)
 Returns the half-angle (in radians) of a cone that subtends solidAngle (in steradians) More...
 
static double halfAngleFromSolidAngle (double solidAngle)
 
static float solidAngleFromHalfAngle (float halfAngle)
 Returns the solid angle (in steradians) subtended by a cone with half-angle halfAngle. More...
 
static double solidAngleFromHalfAngle (double halfAngle)
 

Detailed Description


An infinite cone.

Constructor & Destructor Documentation

◆ Cone() [1/2]

G3D::Cone::Cone ( const Vector3 tip,
const Vector3 direction,
float  angle 
)


Parameters
angleAngle from the center line to the edge, in radians

◆ Cone() [2/2]

G3D::Cone::Cone ( const Vector3 tip,
const class Box box 
)


Forms the smallest cone that contains the box.

Undefined if the tip is inside or on the box.

◆ ~Cone()

virtual G3D::Cone::~Cone ( )
inlinevirtual

Member Function Documentation

◆ contains()

bool G3D::Cone::contains ( const class Vector3 v) const


True if v is a point inside the cone.

◆ halfAngleFromSolidAngle() [1/2]

static float G3D::Cone::halfAngleFromSolidAngle ( float  solidAngle)
static

Returns the half-angle (in radians) of a cone that subtends solidAngle (in steradians)

◆ halfAngleFromSolidAngle() [2/2]

static double G3D::Cone::halfAngleFromSolidAngle ( double  solidAngle)
static

◆ intersects()

bool G3D::Cone::intersects ( const class Sphere s) const


Returns true if the cone touches, intersects, or contains b.

If c.intersects(s) and c.intersects(Sphere(s.center, s.radius * 2) then the sphere s is entirely within cone c.

◆ randomDirectionInCone()

Vector3 G3D::Cone::randomDirectionInCone ( Random rng) const

◆ solidAngleFromHalfAngle() [1/2]

static float G3D::Cone::solidAngleFromHalfAngle ( float  halfAngle)
static

Returns the solid angle (in steradians) subtended by a cone with half-angle halfAngle.

◆ solidAngleFromHalfAngle() [2/2]

static double G3D::Cone::solidAngleFromHalfAngle ( double  halfAngle)
static

documentation generated on Wed Nov 24 2021 08:01:54 using doxygen 1.8.15