3es
0.7
|
Defines an arrow shape to display. More...
#include <3esarrow.h>
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... | |
Arrow & | setRadius (float radius) |
Set the arrow radius. More... | |
float | radius () const |
Get the arrow radius. More... | |
Arrow & | setLength (float length) |
Set the arrow length from base to tip. More... | |
float | length () const |
Get the arrow length from base to tip. More... | |
Arrow & | setOrigin (const V3Arg &origin) |
Set the arrow origin. More... | |
Vector3f | origin () const |
Get the arrow base position. More... | |
Arrow & | setDirection (const V3Arg &direction) |
Set the arrow direction vector. More... | |
Vector3f | direction () const |
Get the arrow direction vector. More... | |
![]() | |
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 |
Shape & | setId (uint32_t id) |
uint16_t | category () const |
Shape & | setCategory (uint16_t category) |
Shape & | setWireframe (bool wire) |
Sets the wireframe flag value for this shape. More... | |
bool | isWireframe () const |
Returns true if the wireframe flag is set. More... | |
Shape & | setTransparent (bool transparent) |
Sets the transparent flag value for this shape. More... | |
bool | isTransparent () const |
Returns true if the transparent flag is set. More... | |
Shape & | setTwoSided (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... | |
Shape & | setFlags (uint16_t flags) |
Set the full set of ObjectFlag values. More... | |
uint16_t | flags () const |
Retrieve the full set of ObjectFlag values. More... | |
Shape & | setPosition (const V3Arg &pos) |
Vector3f | position () const |
Shape & | setPosX (float p) |
Shape & | setPosY (float p) |
Shape & | setPosZ (float p) |
Shape & | setRotation (const QuaternionArg &rot) |
Quaternionf | rotation () const |
Shape & | setScale (const V3Arg &scale) |
Vector3f | scale () const |
Shape & | setColour (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 Shape * | clone () 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 | |
![]() | |
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) |
![]() | |
uint16_t | _routingId |
CreateMessage | _data |
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. |
|
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().
|
inline |
Construct an arrow object.
id | The shape ID, unique among Arrow objects, or zero for a transient shape. |
category | The category grouping for the shape used for filtering. |
origin | The start point for the array. |
dir | The direction vector of the arrow. |
length | The arrow length. |
radius | Radius of the arrow body. |
References setDirection().
|
inline |
Get the arrow direction vector.
May not exactly match the axis given via setDirection()
as the direction is defined by the quaternion rotation()
.
References DefaultDirection.
|
inline |
|
inline |
Get the arrow base position.
Note: this aliases position()
.
|
inline |
Get the arrow radius.
Defines the shaft radius, while the head flanges to a sightly larger radius.
References tes::Vector3< T >::x.
Referenced by setRadius().
Set the arrow direction vector.
direction | The direction vector to set. Must be unit length. |
*this
References tes::Vector3< T >::axisx, tes::Vector3< T >::dot(), tes::Quaternion< T >::setAxisAngle(), and tes::V3Arg::v3.
Referenced by Arrow().
|
inline |
Set the arrow length from base to tip.
length | Set the length to set. |
*this
References length().
Set the arrow origin.
This is the arrow base position.
Note: this aliases setPosition()
.
origin | The arrow base position. |
*this
|
inline |
Set the arrow radius.
radius | The new arrow radius. |
*this
References radius(), and tes::Vector3< T >::x.
|
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().