3es
0.7
|
Defines a cylinder shape to display. More...
#include <3escylinder.h>
Public Member Functions | |
Cylinder (uint32_t id=0u, const V3Arg ¢re=V3Arg(0, 0, 0), const V3Arg &axis=DefaultAxis, float radius=1.0f, float length=1.0f) | |
Cylinder (uint32_t id, uint16_t category, const V3Arg ¢re=V3Arg(0, 0, 0), const V3Arg &axis=DefaultAxis, float radius=1.0f, float length=1.0f) | |
Construct a cylinder object. More... | |
Cylinder & | setRadius (float radius) |
Set the cylinder body radius. More... | |
float | radius () const |
Get the cylinder radius. More... | |
Cylinder & | setLength (float radius) |
Set the cylinder body length. More... | |
float | length () const |
Get the cylinder body length. More... | |
Cylinder & | setCentre (const V3Arg ¢re) |
Set the position fo the cylinder centre. More... | |
Vector3f | centre () const |
Get the cylinder centre position. More... | |
Cylinder & | setAxis (const V3Arg &axis) |
Set the cylinder primary axis. More... | |
Vector3f | axis () const |
Get the cylinder primary axis. 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 | DefaultAxis |
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 cylinder shape to display.
An arrow is defined by:
Component | Description |
---|---|
centre() | The centre of the cylinder. Alias for position() . |
axis() | Defines the cylinder primary axis. Affects rotation() . |
length() | The length of the cylinder body. |
radius() | Radius of the cylinder walls. |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References setAxis().
|
inline |
Construct a cylinder object.
id | The shape ID, unique among Capsule objects, or zero for a transient shape. |
category | The category grouping for the shape used for filtering. |
centre | Centre position() of the cylindef. |
axis | Defines the cylinder's primary axis. |
radius | Radius of the cylinder walls. |
length | Length of the cylinder body. |
References setAxis().
|
inline |
Get the cylinder primary axis.
May not exactly match the axis given via setAxis()
as the axis is defined by the quaternion rotation()
.
References DefaultAxis.
|
inline |
Get the cylinder centre position.
|
inline |
|
inline |
Get the cylinder radius.
References tes::Vector3< T >::x.
Referenced by setRadius().
Set the cylinder primary axis.
Affects rotation()
.
axis | The new axis to set. |
*this
References tes::Vector3< T >::axisx, tes::Vector3< T >::dot(), tes::Quaternion< T >::setAxisAngle(), and tes::V3Arg::v3.
Referenced by Cylinder().
Set the position fo the cylinder centre.
centre | The centre coordinate. |
*this
|
inline |
Set the cylinder body length.
length | The body length to set. |
*this
References length().
|
inline |
Set the cylinder body radius.
radius | The radius to set. |
*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 axis().