3es  0.7
tes::Plane Class Reference

Defines a rectangular planar section to display. More...

#include <3esplane.h>

Inheritance diagram for tes::Plane:
tes::Shape

Public Member Functions

 Plane (uint32_t id=0u, const V3Arg &position=V3Arg(0, 0, 0), const V3Arg &normal=DefaultNormal, float scale=1.0f, float normalLength=1.0f)
 
 Plane (uint32_t id, uint16_t category, const V3Arg &position=V3Arg(0, 0, 0), const V3Arg &normal=DefaultNormal, float scale=1.0f, float normalLength=1.0f)
 Create a plane. More...
 
PlanesetNormal (const V3Arg &normal)
 Set the plane normal. More...
 
Vector3f normal () const
 Get the plane normal. More...
 
PlanesetScale (float scale)
 Set the plane "scale", which controls the render size. More...
 
float scale () const
 Get the plane scaling values. More...
 
PlanesetNormalLength (float length)
 Set the plane normal's display length. More...
 
float normalLength () const
 Get the plane normal display length. 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 DefaultNormal
 Defines the default plane normal orientation. 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 rectangular planar section to display.

A plane is defined by:

Component Description
position() Where to display a planar section.
normal() The plane normal.
scale() Defines the size of the plane rectangle (X,Y) and normalLength() (Z).

Constructor & Destructor Documentation

◆ Plane() [1/2]

tes::Plane::Plane ( uint32_t  id = 0u,
const V3Arg position = V3Arg(0, 0, 0),
const V3Arg normal = DefaultNormal,
float  scale = 1.0f,
float  normalLength = 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 setNormal().

◆ Plane() [2/2]

tes::Plane::Plane ( uint32_t  id,
uint16_t  category,
const V3Arg position = V3Arg(0, 0, 0),
const V3Arg normal = DefaultNormal,
float  scale = 1.0f,
float  normalLength = 1.0f 
)
inline

Create a plane.

Parameters
idThe shape ID, unique among Plane objects, or zero for a transient shape.
categoryThe category grouping for the shape used for filtering.
positionDefines the plane origin and where the plane's square is display.
normalDefines the plane normal.
scaleDefines the size of the square to display.
normalLengthAdjusts the display length of the normal.

References setNormal().

Member Function Documentation

◆ normal()

Vector3f tes::Plane::normal ( ) const
inline

Get the plane normal.

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

Returns
The plane normal.

References DefaultNormal.

◆ normalLength()

float tes::Plane::normalLength ( ) const
inline

Get the plane normal display length.

Returns
The normal display length.

◆ scale()

float tes::Plane::scale ( ) const
inline

Get the plane scaling values.

Returns
The plane scaling values.

Referenced by setScale().

◆ setNormal()

Plane & tes::Plane::setNormal ( const V3Arg normal)
inline

Set the plane normal.

Affects rotation().

Parameters
axisThe new axis to set.
Returns
*this

Referenced by Plane().

◆ setNormalLength()

Plane & tes::Plane::setNormalLength ( float  length)
inline

Set the plane normal's display length.

Alias for scale().z

Parameters
lengthDisplay length to set.
Returns
*this

◆ setScale()

Plane & tes::Plane::setScale ( float  scale)
inline

Set the plane "scale", which controls the render size.

The X,Y axes control the size of the rectangle used to display the plane at position(). The Z is the same as the normalLength(). Note there is non guarantee on the orientation of the plane rectangle.

Parameters
scaleThe scaling values to set.
Returns
*this

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

Member Data Documentation

◆ DefaultNormal

const Vector3f tes::Plane::DefaultNormal
static

Defines the default plane normal orientation.

The rotation() value is relative to this vector.

The default is (0, 0, 1)

Referenced by normal().


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