Ion: gfxutils/shapeutils.h Source File

1 

18 #ifndef ION_GFXUTILS_SHAPEUTILS_H_

19 #define ION_GFXUTILS_SHAPEUTILS_H_

20 

23 

24 #include <functional>

25 #include <istream>

26 

34 

35 namespace ion {

36 namespace gfxutils {

37 

49  };

54  usage_mode(gfx::BufferObject::kStaticDraw) {}

57  math::Point3f translation;

58  float scale;

64 };

65 

67 

72 

73 

83 

85 

90 

91 

96  k3ds,

97  kDae,

98  kLwo,

99  kObj,

100  kOff,

101  kUnknown,

102  };

106  k16Bit,

107  k32Bit,

108  };

118 };

119 

126  std::istream& in);

127 

129 

134 

135 

145  kPositiveX,

146  kNegativeX,

147  kPositiveY,

148  kNegativeY,

149  kPositiveZ,

150  kNegativeZ,

151  };

154 };

155 

157 

162 

163 

169  math::Vector2f size;

170 };

171 

175 

177 

182 

183 

190  int sides;

191 };

192 

196 

198 

203 

204 

209  math::Vector3f size;

210 };

211 

214 

216 

221 

222 

246  size(1.f, 1.f, 1.f) {}

247 

252  size_t band_count;

253  size_t sector_count;

254  math::Vector3f size;

255 };

256 

259 

261 

266 

267 

293  bool has_top_cap;

294  bool has_bottom_cap;

297  size_t sector_count;

298  float top_radius;

300  float height;

301 };

302 

305 

306 }

307 }

308 

309 #endif // ION_GFXUTILS_SHAPEUTILS_H_

This struct contains specifications common to all basic shapes.

math::Anglef latitude_start

math::Anglef latitude_end

IndexSize index_size

The size of the vertex index data type.

Angle< float > Anglef

Type-specific typedefs.

Matrix< 3, float > Matrix3f

External geometry formats.

const gfx::ShapePtr BuildEllipsoidShape(const EllipsoidSpec &spec)

Builds and returns a Shape representing an axis-aligned ellipsoid.

gfx::BufferObject::UsageMode usage_mode

UsageMode for all created BufferObject instances.

const gfx::ShapePtr BuildCylinderShape(const CylinderSpec &spec)

Builds and returns a Shape representing an axis-aligned cylinder.

math::Anglef longitude_start

const gfx::IndexBufferPtr BuildWireframeIndexBuffer(const gfx::IndexBufferPtr &tri_index_buffer)

Public functions.

const gfx::ShapePtr LoadExternalShape(const ExternalShapeSpec &spec, std::istream &in)

Loads a Shape with the specified format from the passed stream.

math::Anglef longitude_end

VertexType

This enum is used to specify what per-vertex attributes should be included in a Shape.

const gfx::ShapePtr BuildRegularPolygonShape(const RegularPolygonSpec &spec)

Builds and returns a Shape representing a flat regular polygon.

Format

The set of external geometry file formats that can be read with LoadExternalShape().

const gfx::ShapePtr BuildBoxShape(const BoxSpec &spec)

Builds and returns a Shape representing an axis-aligned box.

IndexSize

The size of the vertex index data type.

PlaneNormal

This enum specifies the principal Cartesian plane containing the rectangle by its directed normal...

bool center_at_origin

Whether to center the loaded object at the origin (defaults to true).

math::Point3f translation

The order of operations is: scale, then rotate, then translate.

base::AllocatorPtr allocator

const gfx::ShapePtr BuildRectangleShape(const RectangleSpec &spec)

Builds and returns a Shape representing a rectangle in one of the principal Cartesian planes...