3es  0.7
tes::Arrow Class Reference

Defines an arrow shape to display. More...

#include <3esarrow.h>

Inheritance diagram for tes::Arrow:
tes::Shape

Public Member Functions

 Arrow (uint32_t id=0u, const V3Arg &origin=V3Arg(0, 0, 0), const V3Arg &dir=DefaultDirection, float length=1.0f, float radius=0.025f)
 
 Arrow (uint32_t id, uint16_t category, const V3Arg &origin=V3Arg(0, 0, 0), const V3Arg &dir=V3Arg(0, 0, 1), float length=1.0f, float radius=0.025f)
 Construct an arrow object. More...
 
ArrowsetRadius (float radius)
 Set the arrow radius. More...
 
float radius () const
 Get the arrow radius. More...
 
ArrowsetLength (float length)
 Set the arrow length from base to tip. More...
 
float length () const
 Get the arrow length from base to tip. More...
 
ArrowsetOrigin (const V3Arg &origin)
 Set the arrow origin. More...
 
Vector3f origin () const
 Get the arrow base position. More...
 
ArrowsetDirection (const V3Arg &direction)
 Set the arrow direction vector. More...
 
Vector3f direction () const
 Get the arrow 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 DefaultDirection
 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 an arrow shape to display.

An arrow is defined by:

Component Description
origin() The arrow base position. Alias for position().
direction() The arrow direction vector. Must be unit length.
length() Length of the arrow from base to tip.
radius() Radius of the arrow body. The arrow head will be slightly larger.

Constructor & Destructor Documentation

◆ Arrow() [1/2]

tes::Arrow::Arrow ( uint32_t  id = 0u,
const V3Arg origin = V3Arg(0, 0, 0),
const V3Arg dir = DefaultDirection,
float  length = 1.0f,
float  radius = 0.025f 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

References setDirection().

◆ Arrow() [2/2]

tes::Arrow::Arrow ( uint32_t  id,
uint16_t  category,
const V3Arg origin = V3Arg(0, 0, 0),
const V3Arg dir = V3Arg(0, 0, 1),
float  length = 1.0f,
float  radius = 0.025f 
)
inline

Construct an arrow object.

Parameters
idThe shape ID, unique among Arrow objects, or zero for a transient shape.
categoryThe category grouping for the shape used for filtering.
originThe start point for the array.
dirThe direction vector of the arrow.
lengthThe arrow length.
radiusRadius of the arrow body.

References setDirection().

Member Function Documentation

◆ direction()

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

Get the arrow 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 DefaultDirection.

◆ length()

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

Get the arrow length from base to tip.

Returns
The arrow length.

Referenced by setLength().

◆ origin()

Vector3f tes::Arrow::origin ( ) const
inline

Get the arrow base position.

Note: this aliases position().

Returns
The arrow base position.

◆ radius()

float tes::Arrow::radius ( ) const
inline

Get the arrow radius.

Defines the shaft radius, while the head flanges to a sightly larger radius.

Returns
The arrow body radius.

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

Referenced by setRadius().

◆ setDirection()

Arrow & tes::Arrow::setDirection ( const V3Arg direction)
inline

Set the arrow 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 Arrow().

◆ setLength()

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

Set the arrow length from base to tip.

Parameters
lengthSet the length to set.
Returns
*this

References length().

◆ setOrigin()

Arrow & tes::Arrow::setOrigin ( const V3Arg origin)
inline

Set the arrow origin.

This is the arrow base position.

Note: this aliases setPosition().

Parameters
originThe arrow base position.
Returns
*this

◆ setRadius()

Arrow & tes::Arrow::setRadius ( float  radius)
inline

Set the arrow radius.

Parameters
radiusThe new arrow radius.
Returns
*this

References radius(), and tes::Vector3< T >::x.

Member Data Documentation

◆ DefaultDirection

const Vector3f tes::Arrow::DefaultDirection
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: