TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Cone.h
Go to the documentation of this file.
1 
16 #ifndef G3D_CONE_H
17 #define G3D_CONE_H
18 
19 #include "G3D/platform.h"
20 #include "G3D/g3dmath.h"
21 #include "G3D/Vector3.h"
22 
23 namespace G3D {
24 
28 class Cone {
29 
30 private:
33 
35  float angle;
36 
37 public:
38 
42  Cone(const Vector3& tip, const Vector3& direction, float angle);
43 
48  Cone(const Vector3& tip, const class Box& box);
49 
50  virtual ~Cone() {}
51 
58  bool intersects(const class Sphere& s) const;
59 
63  bool contains(const class Vector3& v) const;
64 
65 
67  static float solidAngleFromHalfAngle(float halfAngle);
68  static double solidAngleFromHalfAngle(double halfAngle);
69 
71  static float halfAngleFromSolidAngle(float solidAngle);
72  static double halfAngleFromSolidAngle(double solidAngle);
73 
74 
76 
77 };
78 
79 } // namespace
80 
81 #endif
static float halfAngleFromSolidAngle(float solidAngle)
Definition: Cone.cpp:29
Vector3 direction
Definition: Cone.h:32
Definition: AABox.h:25
Cone(const Vector3 &tip, const Vector3 &direction, float angle)
Definition: Cone.cpp:38
An arbitrary (oriented) 3D box, useful as a bounding box.
Definition: Box.h:35
Vector3 randomDirectionInCone(Random &rng) const
Definition: Cone.cpp:47
Definition: Vector3.h:58
float angle
Definition: Cone.h:35
Definition: Sphere.h:24
Vector3 tip
Definition: Cone.h:31
bool intersects(const class Sphere &s) const
Definition: Cone.cpp:108
bool contains(const class Vector3 &v) const
Definition: Cone.cpp:124
Definition: Cone.h:28
virtual ~Cone()
Definition: Cone.h:50
static float solidAngleFromHalfAngle(float halfAngle)
Definition: Cone.cpp:21
Definition: Random.h:39