3es
0.7
|
Defines a cone shape to display. More...
#include <3escone.h>
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... | |
Cone & | setAngle (float angle) |
Sets the cone angle at the apex (radians). More... | |
float | angle () const |
Get the cone angle at the apex (radians). More... | |
Cone & | setLength (float length) |
Set the cone length, apex to base. More... | |
float | length () const |
Get the cone length, apex to base. More... | |
Cone & | setPoint (const V3Arg &point) |
Set the position of the cone apex. More... | |
Vector3f | point () const |
Get the position of the cone apex. More... | |
Cone & | setDirection (const V3Arg &dir) |
Set the cone direction vector. More... | |
Vector3f | direction () const |
Get the cone 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 | DefaultDir |
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 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. |
|
inline |
Construct a cone object.
id | The shape ID, unique among Cone objects, or zero for a transient shape. |
category | The category grouping for the shape used for filtering. |
point | Defines the cone apex. |
dir | Cone direction. |
angle | Angle from cone axis to walls at the apex (radians). |
length | Length of the cone from apex to base. |
References setAngle(), setDirection(), and setLength().
|
inline |
Get the cone angle at the apex (radians).
References tes::Vector3< T >::x.
Referenced by setLength().
|
inline |
Get the cone direction vector.
May not exactly match the axis given via setDirection()
as the direction is defined by the quaternion rotation()
.
References DefaultDir.
|
inline |
|
inline |
Get the position of the cone apex.
|
inline |
Sets the cone angle at the apex (radians).
angle | The angle to set (radians). |
*this
References tes::Vector3< T >::x.
Referenced by Cone(), and setLength().
Set the cone 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 Cone().
|
inline |
Set the cone length, apex to base.
length | The length to set. |
*this
References angle(), tes::CreateMessage::attributes, length(), tes::ObjectAttributes::scale, and setAngle().
Referenced by Cone().
Set the position of the cone apex.
point | The apex coordinate. |
*this
|
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().