31 Text3D(
const char *text,
const V3Arg &pos =
V3Arg(0, 0, 0),
int fontSize = 12);
32 Text3D(
const char *text,
const V3Arg &pos,
const V3Arg &facing,
int fontSize = 12);
33 Text3D(
const char *text, uint32_t
id,
const V3Arg &pos =
V3Arg(0, 0, 0),
int fontSize = 12);
34 Text3D(
const char *text, uint32_t
id,
const V3Arg &pos,
const V3Arg &facing,
int fontSize = 12);
35 Text3D(
const char *text, uint32_t
id, uint16_t category,
const V3Arg &pos =
V3Arg(0, 0, 0),
int fontSize = 12);
39 Text3D(
const char *text, uint32_t
id, uint16_t category,
const V3Arg &pos,
const V3Arg &facing,
int fontSize = 12);
43 bool screenFacing()
const;
44 Text3D &setScreenFacing(
bool worldSpace);
50 Text3D &setFontSize(
int size);
52 inline char *text()
const {
return _text; }
53 inline uint16_t textLength()
const {
return _textLength; }
55 Text3D &setText(
const char *text, uint16_t textLength);
57 virtual bool writeCreate(
PacketWriter &stream)
const override;
59 Shape *clone()
const override;
62 void onClone(
Text3D *copy)
const;
136 inline Text3D::Text3D(
const char *text,
const V3Arg &pos,
int fontSize)
142 setText(text, (uint16_t)strlen(text));
143 setFontSize(fontSize);
147 inline Text3D::Text3D(
const char *text,
const V3Arg &pos,
const V3Arg &facing,
int fontSize)
153 setText(text, (uint16_t)strlen(text));
154 setFontSize(fontSize);
158 inline Text3D::Text3D(
const char *text, uint32_t
id,
const V3Arg &pos,
int fontSize)
159 :
Shape(SIdText3D,
id)
164 setText(text, (uint16_t)strlen(text));
165 setFontSize(fontSize);
169 inline Text3D::Text3D(
const char *text, uint32_t
id,
const V3Arg &pos,
const V3Arg &facing,
int fontSize)
170 :
Shape(SIdText3D,
id)
175 setText(text, (uint16_t)strlen(text));
176 setFontSize(fontSize);
180 inline Text3D::Text3D(
const char *text, uint32_t
id, uint16_t category,
const V3Arg &pos,
int fontSize)
181 :
Shape(SIdText3D,
id, category)
186 setText(text, (uint16_t)strlen(text));
187 setFontSize(fontSize);
191 inline Text3D::Text3D(
const char *text, uint32_t
id, uint16_t category,
const V3Arg &pos,
const V3Arg &facing,
int fontSize)
192 :
Shape(SIdText3D, id, category)
197 setText(text, (uint16_t)strlen(text));
198 setFontSize(fontSize);
202 inline bool Text3D::screenFacing()
const 208 inline Text3D &Text3D::setScreenFacing(
bool worldSpace)
216 inline Text3D &Text3D::setFacing(
const V3Arg &toCamera)
218 setScreenFacing(
false);
220 if (toCamera.
v3.
dot(DefaultFacing) > -0.9998f)
233 inline Vector3f Text3D::facing()
const 236 return rot * DefaultFacing;
240 inline int Text3D::fontSize()
const 246 inline Text3D &Text3D::setFontSize(
int size)
253 #endif // _3ESTEXT3D_H_ A base class for encapsulating a shape which is to be represented remotely.
Definition: 3esshape.h:39
float scale[3]
Object scale.
Definition: 3esmessages.h:358
Text is oriented to face the screen.
Definition: 3esmessages.h:126
static const Vector3< T > axisx
The vector (1, 0, 0).
Definition: 3esvector3.h:44
Definition: 3esbounds.h:13
Quaternion< T > & setAxisAngle(const Vector3< T > &axis, const T &angle)
Sets this quaternion from an axis of rotation and the angle of rotation about that axis (radians)...
Vector3f v3
Vector 3 value.
Definition: 3esv3arg.h:45
Represents a vector in R3.
Definition: 3esvector3.h:14
A helper structure used to convert from float or double pointers to Vector3f arguments.
Definition: 3esv3arg.h:14
uint16_t flags
Flags controlling the appearance and creation of the object.
Definition: 3esmessages.h:406
Quaternion< float > Quaternionf
Defines a single precision quaternion.
Definition: 3esquaternion.h:198
ObjectAttributes attributes
Initial transformation and colour.
Definition: 3esmessages.h:408
A utility class for writing payload data to a PacketHeader.
Definition: 3espacketwriter.h:34
T dot(const Vector3< T > &other) const
Calculates the dot product of this.other.
Definition: 3esvector3.h:422
A shape 3D world position and perspective adjusted text, optionally screen facing.
Definition: 3estext3d.h:20