1 #include <G3D/G3DAll.h>
2 #include <GLG3D/GLG3D.h>
7 TextShape::TextShape(const std::string text
, GFont::Ref font
, float size
) :
15 Shape::Type
TextShape::type() const {
19 void TextShape::render(class RenderDevice
* rd
,
20 const CoordinateFrame
& cframe
,
24 font_
->draw3D(rd
, string_
, cframe
, size_
, solidColor
, wireColor
);
27 float TextShape::area() const {
28 G3D::Vector2 bounds
= font_
->bounds(string_
, size_
);
29 return bounds
.x
* bounds
.y
;
32 float TextShape::volume() const {
33 G3D::Vector2 bounds
= font_
->bounds(string_
, size_
);
34 return bounds
.x
* bounds
.y
;
37 G3D::Vector3
TextShape::center() const {
38 return G3D::Vector3(0.0, 0.0, 0.0);
41 Sphere
TextShape::boundingSphere() const {
42 G3D::Vector2 bounds
= font_
->bounds(string_
, size_
);
43 if (bounds
.x
> bounds
.y
)
44 return Sphere(G3D::Vector3::zero(), bounds
.x
);
46 return Sphere(G3D::Vector3::zero(), bounds
.y
);
50 AABox
TextShape::boundingAABox() const
52 G3D::Vector2 bounds
= font_
->bounds(string_
, size_
);
53 return AABox(G3D::Vector3::zero(), G3D::Vector3::zero());
56 void TextShape::getRandomSurfacePoint(G3D::Vector3
& P
, G3D::Vector3
& N
) const
58 P
= G3D::Vector3::zero();
59 N
= G3D::Vector3::unitZ();
62 Vector3
TextShape::randomInteriorPoint() const
64 return G3D::Vector3::zero();