3es  0.7
tes::Cone Class Reference

Defines a cone shape to display. More...

#include <3escone.h>

Inheritance diagram for tes::Cone:
tes::Shape

Public Member Functions

 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)
 
 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)
 Construct a cone object. More...
 
ConesetAngle (float angle)
 Sets the cone angle at the apex (radians). More...
 
float angle () const
 Get the cone angle at the apex (radians). More...
 
ConesetLength (float length)
 Set the cone length, apex to base. More...
 
float length () const
 Get the cone length, apex to base. More...
 
ConesetPoint (const V3Arg &point)
 Set the position of the cone apex. More...
 
Vector3f point () const
 Get the position of the cone apex. More...
 
ConesetDirection (const V3Arg &dir)
 Set the cone direction vector. More...
 
Vector3f direction () const
 Get the cone direction vector. More...
 
- Public Member Functions inherited from tes::Shape
 Shape (uint16_t routingId, uint32_t id=0)
 
 Shape (uint16_t routingId, uint32_t id, uint16_t category)
 Construct a box object. More...
 
uint16_t routingId () const
 
uint32_t id () const
 
ShapesetId (uint32_t id)
 
uint16_t category () const
 
ShapesetCategory (uint16_t category)
 
ShapesetWireframe (bool wire)
 Sets the wireframe flag value for this shape. More...
 
bool isWireframe () const
 Returns true if the wireframe flag is set. More...
 
ShapesetTransparent (bool transparent)
 Sets the transparent flag value for this shape. More...
 
bool isTransparent () const
 Returns true if the transparent flag is set. More...
 
ShapesetTwoSided (bool twoSided)
 Sets the two sided shader flag value for this shape. More...
 
bool isTwoSided () const
 Returns true if the two sided shader flag is set. More...
 
ShapesetFlags (uint16_t flags)
 Set the full set of ObjectFlag values. More...
 
uint16_t flags () const
 Retrieve the full set of ObjectFlag values. More...
 
ShapesetPosition (const V3Arg &pos)
 
Vector3f position () const
 
ShapesetPosX (float p)
 
ShapesetPosY (float p)
 
ShapesetPosZ (float p)
 
ShapesetRotation (const QuaternionArg &rot)
 
Quaternionf rotation () const
 
ShapesetScale (const V3Arg &scale)
 
Vector3f scale () const
 
ShapesetColour (const Colour &colour)
 
Colour colour () const
 
virtual void updateFrom (const Shape &other)
 Update the attributes of this shape to match other. More...
 
virtual bool writeCreate (PacketWriter &stream) const
 Writes the create message to stream. More...
 
virtual int writeData (PacketWriter &stream, unsigned &progressMarker) const
 Called only for complex shapes to write additional creation data. More...
 
bool writeUpdate (PacketWriter &stream) const
 
bool writeDestroy (PacketWriter &stream) const
 
virtual bool isComplex () const
 Is this a complex shape? Complex shapes have writeData() called. More...
 
virtual int enumerateResources (const Resource **resources, int capacity, int fetchOffset=0) const
 Enumerate the resources used by this shape. More...
 
virtual Shapeclone () const
 Deep copy clone. More...
 

Static Public Attributes

static const Vector3f DefaultDir
 Default direction used as a reference orientation for packing the rotation. More...
 

Additional Inherited Members

- Protected Member Functions inherited from tes::Shape
void onClone (Shape *copy) const
 Called when copy is created from this object to copy appropriate attributes to copy. More...
 
void init (uint32_t id, uint16_t cat=0, uint16_t flags=0)
 
- Protected Attributes inherited from tes::Shape
uint16_t _routingId
 
CreateMessage _data
 

Detailed Description

Defines a cone shape to display.

A cone is defined by:

Component Description
point() The cone apex position. Alias for position().
direction() The direction from the apex the cone flanges out.
length() Scaling value for the arrow. Defines the true length when direction() is unit length.
angle() Angle cone axis to the walls at the apex.

Constructor & Destructor Documentation

◆ Cone()

tes::Cone::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 
)
inline

Construct a cone object.

Parameters
idThe shape ID, unique among Cone objects, or zero for a transient shape.
categoryThe category grouping for the shape used for filtering.
pointDefines the cone apex.
dirCone direction.
angleAngle from cone axis to walls at the apex (radians).
lengthLength of the cone from apex to base.

References setAngle(), setDirection(), and setLength().

Member Function Documentation

◆ angle()

float tes::Cone::angle ( ) const
inline

Get the cone angle at the apex (radians).

Returns
The cone angle (radians).

References tes::Vector3< T >::x.

Referenced by setLength().

◆ direction()

Vector3f tes::Cone::direction ( ) const
inline

Get the cone direction vector.

May not exactly match the axis given via setDirection() as the direction is defined by the quaternion rotation().

Returns
The arrow direction vector.

References DefaultDir.

◆ length()

float tes::Cone::length ( ) const
inline

Get the cone length, apex to base.

Returns
The cone length.

Referenced by setLength().

◆ point()

Vector3f tes::Cone::point ( ) const
inline

Get the position of the cone apex.

Returns
point The apex coordinate.

◆ setAngle()

Cone & tes::Cone::setAngle ( float  angle)
inline

Sets the cone angle at the apex (radians).

Parameters
angleThe angle to set (radians).
Returns
*this

References tes::Vector3< T >::x.

Referenced by Cone(), and setLength().

◆ setDirection()

Cone & tes::Cone::setDirection ( const V3Arg dir)
inline

Set the cone direction vector.

Parameters
directionThe direction vector to set. Must be unit length.
Returns
*this

References tes::Vector3< T >::axisx, tes::Vector3< T >::dot(), tes::Quaternion< T >::setAxisAngle(), and tes::V3Arg::v3.

Referenced by Cone().

◆ setLength()

Cone & tes::Cone::setLength ( float  length)
inline

Set the cone length, apex to base.

Parameters
lengthThe length to set.
Returns
*this

References angle(), tes::CreateMessage::attributes, length(), tes::ObjectAttributes::scale, and setAngle().

Referenced by Cone().

◆ setPoint()

Cone & tes::Cone::setPoint ( const V3Arg point)
inline

Set the position of the cone apex.

Parameters
pointThe apex coordinate.
Returns
*this

Member Data Documentation

◆ DefaultDir

const Vector3f tes::Cone::DefaultDir
static

Default direction used as a reference orientation for packing the rotation.

The rotation() value is relative to this vector.

The default is (0, 0, 1)

Referenced by direction().


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