3es  0.7
tes::Cylinder Class Reference

Defines a cylinder shape to display. More...

#include <3escylinder.h>

Inheritance diagram for tes::Cylinder:
tes::Shape

Public Member Functions

 Cylinder (uint32_t id=0u, const V3Arg &centre=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 &centre=V3Arg(0, 0, 0), const V3Arg &axis=DefaultAxis, float radius=1.0f, float length=1.0f)
 Construct a cylinder object. More...
 
CylindersetRadius (float radius)
 Set the cylinder body radius. More...
 
float radius () const
 Get the cylinder radius. More...
 
CylindersetLength (float radius)
 Set the cylinder body length. More...
 
float length () const
 Get the cylinder body length. More...
 
CylindersetCentre (const V3Arg &centre)
 Set the position fo the cylinder centre. More...
 
Vector3f centre () const
 Get the cylinder centre position. More...
 
CylindersetAxis (const V3Arg &axis)
 Set the cylinder primary axis. More...
 
Vector3f axis () const
 Get the cylinder primary axis. 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 DefaultAxis
 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 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.

Constructor & Destructor Documentation

◆ Cylinder() [1/2]

tes::Cylinder::Cylinder ( uint32_t  id = 0u,
const V3Arg centre = V3Arg(0, 0, 0),
const V3Arg axis = DefaultAxis,
float  radius = 1.0f,
float  length = 1.0f 
)
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().

◆ Cylinder() [2/2]

tes::Cylinder::Cylinder ( uint32_t  id,
uint16_t  category,
const V3Arg centre = V3Arg(0, 0, 0),
const V3Arg axis = DefaultAxis,
float  radius = 1.0f,
float  length = 1.0f 
)
inline

Construct a cylinder object.

Parameters
idThe shape ID, unique among Capsule objects, or zero for a transient shape.
categoryThe category grouping for the shape used for filtering.
centreCentre position() of the cylindef.
axisDefines the cylinder's primary axis.
radiusRadius of the cylinder walls.
lengthLength of the cylinder body.

References setAxis().

Member Function Documentation

◆ axis()

Vector3f tes::Cylinder::axis ( ) const
inline

Get the cylinder primary axis.

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

Returns
The primary axis.

References DefaultAxis.

◆ centre()

Vector3f tes::Cylinder::centre ( ) const
inline

Get the cylinder centre position.

Returns
The centre coordinate.

◆ length()

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

Get the cylinder body length.

Parameters
Thebody length.

Referenced by setLength().

◆ radius()

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

Get the cylinder radius.

Returns
The cylinder radius.

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

Referenced by setRadius().

◆ setAxis()

Cylinder & tes::Cylinder::setAxis ( const V3Arg axis)
inline

Set the cylinder primary axis.

Affects rotation().

Parameters
axisThe new axis to set.
Returns
*this

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

Referenced by Cylinder().

◆ setCentre()

Cylinder & tes::Cylinder::setCentre ( const V3Arg centre)
inline

Set the position fo the cylinder centre.

Parameters
centreThe centre coordinate.
Returns
*this

◆ setLength()

Cylinder & tes::Cylinder::setLength ( float  radius)
inline

Set the cylinder body length.

Parameters
lengthThe body length to set.
Returns
*this

References length().

◆ setRadius()

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

Set the cylinder body radius.

Parameters
radiusThe radius to set.
Returns
*this

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

Member Data Documentation

◆ DefaultAxis

const Vector3f tes::Cylinder::DefaultAxis
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().


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