31 Cone(uint32_t
id = 0u,
const V3Arg &point =
V3Arg(0, 0, 0),
const V3Arg &dir = DefaultDir,
float angle = 45.0f / 360.0f *
float(M_PI),
float length = 1.0f);
39 Cone(uint32_t
id, uint16_t category,
const V3Arg &point =
V3Arg(0, 0, 0),
const V3Arg &dir = DefaultDir,
float angle = 45.0f / 360.0f *
float(M_PI),
float length = 1.0f);
44 Cone &setAngle(
float angle);
52 Cone &setLength(
float length);
78 inline Cone::Cone(uint32_t
id,
const V3Arg &point,
const V3Arg &dir,
float angle,
float length)
83 setScale(
Vector3f(angle, angle, length));
87 inline Cone::Cone(uint32_t
id, uint16_t category,
const V3Arg &point,
const V3Arg &dir,
float angle,
float length)
88 :
Shape(SIdCone, id, category)
101 s.
x = s.y = s.z * std::tan(angle);
115 const float length = s.z;
116 const float radius = s.
x;
117 return (length != 0.0f) ? std::atan(radius/ length) : 0.0f;
124 const float angle = this->
angle();
153 if (dir.
v3.
dot(DefaultDir) > -0.9998f)
173 #endif // _3ESCONE_H_ A base class for encapsulating a shape which is to be represented remotely.
Definition: 3esshape.h:39
float scale[3]
Object scale.
Definition: 3esmessages.h:358
Cone & setPoint(const V3Arg &point)
Set the position of the cone apex.
Definition: 3escone.h:137
Cone & setLength(float length)
Set the cone length, apex to base.
Definition: 3escone.h:121
Vector3f direction() const
Get the cone direction vector.
Definition: 3escone.h:166
float length() const
Get the cone length, apex to base.
Definition: 3escone.h:131
static const Vector3< T > axisx
The vector (1, 0, 0).
Definition: 3esvector3.h:44
Cone & setAngle(float angle)
Sets the cone angle at the apex (radians).
Definition: 3escone.h:98
Vector3f point() const
Get the position of the cone apex.
Definition: 3escone.h:144
static const Vector3f DefaultDir
Default direction used as a reference orientation for packing the rotation.
Definition: 3escone.h:29
float angle() const
Get the cone angle at the apex (radians).
Definition: 3escone.h:107
Definition: 3esbounds.h:13
Cone & setDirection(const V3Arg &dir)
Set the cone direction vector.
Definition: 3escone.h:150
Vector3< float > Vector3f
Defines a single precision vector.
Definition: 3esvector3.h:14
Quaternion< T > & setAxisAngle(const Vector3< T > &axis, const T &angle)
Sets this quaternion from an axis of rotation and the angle of rotation about that axis (radians)...
Defines a cone shape to display.
Definition: 3escone.h:21
Vector3f v3
Vector 3 value.
Definition: 3esv3arg.h:45
Represents a vector in R3.
Definition: 3esvector3.h:14
A helper structure used to convert from float or double pointers to Vector3f arguments.
Definition: 3esv3arg.h:14
T x
Direct data member access.
Definition: 3esvector3.h:30
Quaternion< float > Quaternionf
Defines a single precision quaternion.
Definition: 3esquaternion.h:198
ObjectAttributes attributes
Initial transformation and colour.
Definition: 3esmessages.h:408
T dot(const Vector3< T > &other) const
Calculates the dot product of this.other.
Definition: 3esvector3.h:422