3es  0.7
tes::Sphere Class Reference

Defines a sphere to display. More...

#include <3essphere.h>

Inheritance diagram for tes::Sphere:
tes::Shape

Public Member Functions

 Sphere (uint32_t id=0u, const V3Arg &centre=V3Arg(0, 0, 0), float radius=1.0f)
 
 Sphere (uint32_t id, uint16_t category, const V3Arg &centre=V3Arg(0, 0, 0), float radius=1.0f)
 Create a sphere. More...
 
Sphere & setRadius (float radius)
 Set the sphere radius. More...
 
float radius () const
 Get the sphere radius. More...
 
Sphere & setCentre (const V3Arg &centre)
 Set the sphere centre coordinate. More...
 
Vector3f centre () const
 Get the sphere centre coordinate. 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
 
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...
 

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 sphere to display.

A sphere is defined by:

Component Description
centre() The sphere centre. An alias for position().
radius() The sphere radius.

Constructor & Destructor Documentation

◆ Sphere() [1/2]

tes::Sphere::Sphere ( uint32_t  id = 0u,
const V3Arg &  centre = V3Arg(0, 0, 0),
float  radius = 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.

◆ Sphere() [2/2]

tes::Sphere::Sphere ( uint32_t  id,
uint16_t  category,
const V3Arg &  centre = V3Arg(0, 0, 0),
float  radius = 1.0f 
)
inline

Create a sphere.

Parameters
idThe shape ID, unique among Sphere objects, or zero for a transient shape.
categoryThe category grouping for the shape used for filtering.
centreDefines the sphere centre coordinate.
radiusThe sphere radius.

Member Function Documentation

◆ centre()

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

Get the sphere centre coordinate.

Returns
The sphere centre.

◆ radius()

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

Get the sphere radius.

Returns
The sphere radius.

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

◆ setCentre()

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

Set the sphere centre coordinate.

Parameters
centreThe new sphere centre.
Returns
*this

◆ setRadius()

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

Set the sphere radius.

Parameters
radiusThe sphere radius.
Returns
*this

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