-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathobjects.hpp
More file actions
executable file
·667 lines (598 loc) · 23.8 KB
/
Copy pathobjects.hpp
File metadata and controls
executable file
·667 lines (598 loc) · 23.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
/** @file objects.hpp
* @brief Helper functions to draw 3D OpenGL 3.0+ objects
* @author Dr. Jeffrey Paone
*
* @copyright MIT License Copyright (c) 2017 Dr. Jeffrey Paone
*
* These functions draw solid (or wireframe) 3D closed OpenGL
* objects. All objects are constructed using triangles that
* have normals and texture coordinates properly set.
*
* @warning NOTE: This header file will only work with OpenGL 3.0+
* @warning NOTE: This header file depends upon GLAD (or alternatively GLEW)
*/
#ifndef CSCI441_OBJECTS_HPP
#define CSCI441_OBJECTS_HPP
#include "constants.h"
#include "objects_impl.hpp"
#include "teapot.hpp" // for teapot()
#ifdef CSCI441_USE_GLEW
#include <GL/glew.h>
#else
#include <glad/gl.h>
#endif
#include <glm/gtc/constants.hpp>
#include <cassert> // for assert()
////////////////////////////////////////////////////////////////////////////////////
/**
* @namespace CSCI441
* @brief CSCI441 Helper Functions for OpenGL
*/
namespace CSCI441 {
/**
* @brief Sets the attribute locations for vertex positions, normals, and texture coordinates
* @param positionLocation location of the vertex position attribute
* @param normalLocation location of the vertex normal attribute
* @param texCoordLocation location of the vertex texture coordinate attribute
* @param tangentLocation location of the vertex tangent attribute
* @note Needs to be called after a shader program is being used and before drawing geometry
*/
void setVertexAttributeLocations( GLint positionLocation, GLint normalLocation = -1, GLint texCoordLocation = -1, GLint tangentLocation = -1 );
/**
* @brief deletes the VAOs stored for all object types
*/
[[maybe_unused]] void deleteObjectVAOs();
/**
* @brief deletes the VBOs stored for all object types
*/
[[maybe_unused]] void deleteObjectVBOs();
/**
* @brief Draws a solid cone
* @param base radius of the base of the cone
* @param height height of the cone from the base to the tip
* @param stacks resolution of the number of steps rotated around the central axis of the cone
* @param slices resolution of the number of steps to take along the height
* @pre base must be greater than zero
* @pre height must be greater than zero
* @pre stacks must be greater than zero
* @pre slices must be greater than two
* @note Cone is oriented along the y-axis with the origin along the base of the cone
*/
[[maybe_unused]] void drawSolidCone( GLfloat base, GLfloat height, GLint stacks, GLint slices );
/**
* @brief Draws a wireframe cone
* @param base radius of the base of the cone
* @param height height of the cone from the base to the tip
* @param stacks resolution of the number of steps rotated around the central axis of the cone
* @param slices resolution of the number of steps to take along the height
* @pre base must be greater than zero
* @pre height must be greater than zero
* @pre stacks must be greater than zero
* @pre slices must be greater than two
* @note Cone is oriented along the y-axis with the origin along the base of the cone
*/
[[maybe_unused]] void drawWireCone( GLfloat base, GLfloat height, GLint stacks, GLint slices );
/**
* @brief Calls through to drawSolidCubeIndexed()
* @param sideLength length of the edge of the cube
* @pre sideLength must be greater than zero
*/
[[maybe_unused]] void drawSolidCube( GLfloat sideLength );
/**
* @brief Draws a solid cube with normals aligned with cube face
* @param sideLength length of the edge of the cube
* @pre sideLength must be greater than zero
* @note The origin is at the cube's center of mass. Cube is oriented with our XYZ axes
*/
void drawSolidCubeFlat( GLfloat sideLength );
/**
* @brief Draws a solid cube
* @param sideLength length of the edge of the cube
* @pre sideLength must be greater than zero
* @note The origin is at the cube's center of mass. Cube is oriented with our XYZ axes
*/
void drawSolidCubeIndexed( GLfloat sideLength );
/**
* @brief Draws a solid textured cube. Calls through to drawSolidCubeFlat()
* @param sideLength length of the edge of the cube
* @pre sideLength must be greater than zero
* @note The origin is at the cube's center of mass. Cube is oriented with our XYZ axes
*/
[[maybe_unused]] void drawSolidCubeTextured( GLfloat sideLength );
/**
* @brief Draws a wireframe cube
* @param sideLength length of the edge of the cube
* @pre sideLength must be greater than zero
* @note The origin is at the cube's center of mass. Cube is oriented with our XYZ axes
*/
[[maybe_unused]] void drawWireCube( GLfloat sideLength );
/**
* @brief Draws a cube with 3D Texture Coordinates to map a cube map texture to it
* @param sideLength length of the edge of the cube
* @pre sideLength must be greater than zero
* @note The origin is at the cube's center of mass. Cube is oriented with our XYZ axes
*/
[[maybe_unused]] void drawCubeMap( GLfloat sideLength );
/**
* @brief Draws a solid open-ended cylinder
* @param base radius of the base of the cylinder
* @param top radius of the top of the cylinder
* @param height height of the cylinder from the base to the top
* @param stacks resolution of the number of steps rotated around the central axis of the cylinder
* @param slices resolution of the number of steps to take along the height
* @pre either: (1) base is greater than zero and top is greater than or equal to zero or (2) base is greater than or equal to zero and top is greater than zero
* @pre height must be greater than zero
* @pre stacks must be greater than zero
* @pre slices must be greater than two
* @note Cylinder is oriented along the y-axis with the origin along the base
*/
[[maybe_unused]] void drawSolidCylinder( GLfloat base, GLfloat top, GLfloat height, GLint stacks, GLint slices );
/**
* @brief Draws a wireframe open-ended cylinder
* @param base radius of the base of the cylinder
* @param top radius of the top of the cylinder
* @param height height of the cylinder from the base to the top
* @param stacks resolution of the number of steps rotated around the central axis of the cylinder
* @param slices resolution of the number of steps to take along the height
* @pre either: (1) base is greater than zero and top is greater than or equal to zero or (2) base is greater than or equal to zero and top is greater than zero
* @pre height must be greater than zero
* @pre stacks must be greater than zero
* @pre slices must be greater than two
* @note Cylinder is oriented along the y-axis with the origin along the base
*/
[[maybe_unused]] void drawWireCylinder( GLfloat base, GLfloat top, GLfloat height, GLint stacks, GLint slices );
/**
* @brief Draws a solid disk
* @param inner equivalent to the width of the disk
* @param outer radius from the center of the disk to the center of the ring
* @param slices resolution of the number of steps rotated along the disk
* @param rings resolution of the number of steps to take along the disk width
* @pre inner is greater than or equal to zero
* @pre outer is greater than zero
* @pre outer is greater than inner
* @pre slices is greater than two
* @pre rings is greater than zero
* @note Disk is drawn in the XY plane with the origin at its center
*/
[[maybe_unused]] void drawSolidDisk( GLfloat inner, GLfloat outer, GLint slices, GLint rings );
/**
* @brief Draws a wireframe disk
* @param inner equivalent to the width of the disk
* @param outer radius from the center of the disk to the center of the ring
* @param slices resolution of the number of steps rotated along the disk
* @param rings resolution of the number of steps to take along the disk width
* @pre inner is greater than or equal to zero
* @pre outer is greater than zero
* @pre outer is greater than inner
* @pre slices is greater than two
* @pre rings is greater than zero
* @note Disk is drawn in the XY plane with the origin at its center
*/
[[maybe_unused]] void drawWireDisk( GLfloat inner, GLfloat outer, GLint slices, GLint rings );
/**
* @brief Draws part of a solid disk
* @param inner equivalent to the width of the disk
* @param outer radius from the center of the disk to the center of the ring
* @param slices resolution of the number of steps rotated along the disk
* @param rings resolution of the number of steps to take along the disk width
* @param start angle in degrees to start the disk at
* @param sweep distance in degrees to rotate through
* @pre inner is greater than or equal to zero
* @pre outer is greater than zero
* @pre outer is greater than inner
* @pre slices is greater than two
* @pre rings is greater than zero
* @pre start is between [0, 360]
* @pre sweep is between [0, 360]
* @note Disk is drawn in the XY plane with the origin at its center
*/
[[maybe_unused]] void drawSolidPartialDisk( GLfloat inner, GLfloat outer, GLint slices, GLint rings, GLfloat start, GLfloat sweep );
/**
* @brief Draws part of a wireframe disk
* @param inner equivalent to the width of the disk
* @param outer radius from the center of the disk to the center of the ring
* @param slices resolution of the number of steps rotated along the disk
* @param rings resolution of the number of steps to take along the disk width
* @param start angle in degrees to start the disk at
* @param sweep distance in degrees to rotate through
* @pre inner is greater than or equal to zero
* @pre outer is greater than zero
* @pre outer is greater than inner
* @pre slices is greater than two
* @pre rings is greater than zero
* @pre start is between [0, 360]
* @pre sweep is between [0, 360]
* @note Disk is drawn in the XY plane with the origin at its center
*/
[[maybe_unused]] void drawWirePartialDisk( GLfloat inner, GLfloat outer, GLint slices, GLint rings, GLfloat start, GLfloat sweep );
/**
* @brief Draws a solid sphere
* @param radius radius of the sphere
* @param stacks resolution of the number of steps to take along theta (rotate around Y-axis)
* @param slices resolution of the number of steps to take along phi (rotate around X- or Z-axis)
* @pre radius must be greater than 0
* @pre stacks must be greater than 2
* @pre slices must be greater than 2
* @note Origin is at the center of the sphere
*/
[[maybe_unused]] void drawSolidSphere( GLfloat radius, GLint stacks, GLint slices );
/**
* @brief Draws a wireframe sphere
* @param radius radius of the sphere
* @param stacks resolution of the number of steps to take along theta (rotate around Y-axis)
* @param slices resolution of the number of steps to take along phi (rotate around X- or Z-axis)
* @pre radius must be greater than 0
* @pre stacks must be greater than 2
* @pre slices must be greater than 2
* @note Origin is at the center of the sphere
*/
[[maybe_unused]] void drawWireSphere( GLfloat radius, GLint stacks, GLint slices );
/**
* @brief Draws a solid half sphere with a bottom
* @param radius radius of the sphere
* @param stacks resolution of the number of steps to take along theta (rotate around Y-axis)
* @param slices resolution of the number of steps to take along phi (rotate around X- or Z-axis)
* @pre radius must be greater than 0
* @pre stacks must be greater than 2
* @pre slices must be greater than 2
* @note Origin is at the center of the sphere
*/
[[maybe_unused]] void drawSolidHalfSphere( GLfloat radius, GLint stacks, GLint slices );
/**
* @brief Draws a wireframe half sphere with a bottom
* @param radius radius of the sphere
* @param stacks resolution of the number of steps to take along theta (rotate around Y-axis)
* @param slices resolution of the number of steps to take along phi (rotate around X- or Z-axis)
* @pre radius must be greater than 0
* @pre stacks must be greater than 2
* @pre slices must be greater than 2
* @note Origin is at the center of the sphere
*/
[[maybe_unused]] void drawWireHalfSphere( GLfloat radius, GLint stacks, GLint slices );
/**
* @brief Draws a solid dome
* @param radius radius of the dome
* @param stacks resolution of the number of steps to take along theta (rotate around Y-axis)
* @param slices resolution of the number of steps to take along phi (rotate around X- or Z-axis)
* @pre radius must be greater than 0
* @pre stacks must be greater than 2
* @pre slices must be greater than 2
* @note Origin is at the center of the dome
*/
[[maybe_unused]] void drawSolidDome( GLfloat radius, GLint stacks, GLint slices );
/**
* @brief Draws a wireframe dome
* @param radius radius of the dome
* @param stacks resolution of the number of steps to take along theta (rotate around Y-axis)
* @param slices resolution of the number of steps to take along phi (rotate around X- or Z-axis)
* @pre radius must be greater than 0
* @pre stacks must be greater than 2
* @pre slices must be greater than 2
* @note Origin is at the center of the dome
*/
[[maybe_unused]] void drawWireDome( GLfloat radius, GLint stacks, GLint slices );
/**
* @brief Draws a solid teapot
* @param unused present for historical compatability
* @pre size must be greater than zero
* @note Oriented with spout and handle running along X-axis, cap and bottom along Y-axis. Origin is at the center of the teapot
*/
[[maybe_unused]] void drawSolidTeapot( GLfloat unused = 0.0f );
/**
* @brief Draws a wireframe teapot
* @param unused present for historical compatability
* @pre size must be greater than zero
* @note Oriented with spout and handle running along X-axis, cap and bottom along Y-axis. Origin is at the center of the teapot
*/
[[maybe_unused]] void drawWireTeapot( GLfloat unused = 0.0f );
/**
* @brief Draws a solid torus
* @param innerRadius equivalent to the width of the torus ring
* @param outerRadius radius from the center of the torus to the center of the ring
* @param sides resolution of steps to take around the band of the ring
* @param rings resolution of steps to take around the torus
* @pre innerRadius must be greater than zero
* @pre outerRadius must be greater than zero
* @pre sides must be greater than two
* @pre rings must be greater than two
* @note Torus is oriented in the XY-plane with the origin at its center
*/
[[maybe_unused]] void drawSolidTorus( GLfloat innerRadius, GLfloat outerRadius, GLint sides, GLint rings );
/**
* @brief Draws a wireframe torus
* @param innerRadius equivalent to the width of the torus ring
* @param outerRadius radius from the center of the torus to the center of the ring
* @param sides resolution of steps to take around the band of the ring
* @param rings resolution of steps to take around the torus
* @pre innerRadius must be greater than zero
* @pre outerRadius must be greater than zero
* @pre sides must be greater than two
* @pre rings must be greater than two
* @note Torus is oriented in the XY-plane with the origin at its center
*/
[[maybe_unused]] void drawWireTorus( GLfloat innerRadius, GLfloat outerRadius, GLint sides, GLint rings );
}
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
// Outward facing function implementations
inline void CSCI441::setVertexAttributeLocations(
const GLint positionLocation,
const GLint normalLocation,
const GLint texCoordLocation,
const GLint tangentLocation
) {
CSCI441_INTERNAL::_positionAttributeLocation = positionLocation;
CSCI441_INTERNAL::_normalAttributeLocation = normalLocation;
CSCI441_INTERNAL::_texCoordAttributeLocation = texCoordLocation;
CSCI441_INTERNAL::_tangentAttributeLocation = tangentLocation;
CSCI441_INTERNAL::setTeapotAttributeLocations(positionLocation, normalLocation, texCoordLocation, tangentLocation);
}
[[maybe_unused]]
inline void CSCI441::deleteObjectVAOs() {
CSCI441_INTERNAL::deleteObjectVAOs();
}
[[maybe_unused]]
inline void CSCI441::deleteObjectVBOs() {
CSCI441_INTERNAL::deleteObjectVBOs();
}
[[maybe_unused]]
inline void CSCI441::drawSolidCone(
const GLfloat base,
const GLfloat height,
const GLint stacks,
const GLint slices
) {
assert( base > 0.0f );
assert( height > 0.0f );
assert( stacks > 0 );
assert( slices > 2 );
CSCI441_INTERNAL::drawCylinder( base, 0.0f, height, stacks, slices, GL_FILL );
}
[[maybe_unused]]
inline void CSCI441::drawWireCone(
const GLfloat base,
const GLfloat height,
const GLint stacks,
const GLint slices
) {
assert( base > 0.0f );
assert( height > 0.0f );
assert( stacks > 0 );
assert( slices > 2 );
CSCI441_INTERNAL::drawCylinder( base, 0.0f, height, stacks, slices, GL_LINE );
}
[[maybe_unused]]
inline void CSCI441::drawSolidCube(
const GLfloat sideLength
) {
drawSolidCubeIndexed(sideLength);
}
[[maybe_unused]]
inline void CSCI441::drawSolidCubeTextured(
const GLfloat sideLength
) {
drawSolidCubeFlat(sideLength);
}
inline void CSCI441::drawSolidCubeIndexed(
const GLfloat sideLength
) {
assert( sideLength > 0.0f );
CSCI441_INTERNAL::drawCube( sideLength, GL_FILL );
}
inline void CSCI441::drawSolidCubeFlat(
const GLfloat sideLength
) {
assert( sideLength > 0.0f );
CSCI441_INTERNAL::drawCubeFlat( sideLength, GL_FILL );
}
[[maybe_unused]]
inline void CSCI441::drawWireCube(
const GLfloat sideLength
) {
assert( sideLength > 0.0f );
CSCI441_INTERNAL::drawCube( sideLength, GL_LINE );
}
[[maybe_unused]]
inline void CSCI441::drawCubeMap(
const GLfloat sideLength
) {
assert(sideLength > 0.0f);
CSCI441_INTERNAL::drawCube( sideLength, GL_FILL );
}
[[maybe_unused]]
inline void CSCI441::drawSolidCylinder(
const GLfloat base,
const GLfloat top,
const GLfloat height,
const GLint stacks,
const GLint slices
) {
assert( (base >= 0.0f && top > 0.0f) || (base > 0.0f && top >= 0.0f) );
assert( height > 0.0f );
assert( stacks > 0 );
assert( slices > 2 );
CSCI441_INTERNAL::drawCylinder( base, top, height, stacks, slices, GL_FILL );
}
[[maybe_unused]]
inline void CSCI441::drawWireCylinder(
const GLfloat base,
const GLfloat top,
const GLfloat height,
const GLint stacks,
const GLint slices
) {
assert( (base >= 0.0f && top > 0.0f) || (base > 0.0f && top >= 0.0f) );
assert( height > 0.0f );
assert( stacks > 0 );
assert( slices > 2 );
CSCI441_INTERNAL::drawCylinder( base, top, height, stacks, slices, GL_LINE );
}
[[maybe_unused]]
inline void CSCI441::drawSolidDisk(
const GLfloat inner,
const GLfloat outer,
const GLint slices,
const GLint rings
) {
assert( inner >= 0.0f );
assert( outer > 0.0f );
assert( outer > inner );
assert( slices > 2 );
assert( rings > 0 );
CSCI441_INTERNAL::drawPartialDisk( inner, outer, slices, rings, 0, glm::two_pi<GLfloat>(), GL_FILL );
}
[[maybe_unused]]
inline void CSCI441::drawWireDisk(
const GLfloat inner,
const GLfloat outer,
const GLint slices,
const GLint rings
) {
assert( inner >= 0.0f );
assert( outer > 0.0f );
assert( outer > inner );
assert( slices > 2 );
assert( rings > 0 );
CSCI441_INTERNAL::drawPartialDisk( inner, outer, slices, rings, 0, glm::two_pi<GLfloat>(), GL_LINE );
}
[[maybe_unused]]
inline void CSCI441::drawSolidPartialDisk(
const GLfloat inner,
const GLfloat outer,
const GLint slices,
const GLint rings,
const GLfloat start,
const GLfloat sweep
) {
assert( inner >= 0.0f );
assert( outer > 0.0f );
assert( outer > inner );
assert( slices > 2 );
assert( rings > 0 );
assert( start >= 0.0f && start <= 360.0f );
assert( sweep >= 0.0f && sweep <= 360.0f );
CSCI441_INTERNAL::drawPartialDisk( inner, outer, slices, rings, start * glm::pi<float>() / 180.0f, sweep * glm::pi<float>() / 180.0f, GL_FILL );
}
[[maybe_unused]]
inline void CSCI441::drawWirePartialDisk(
const GLfloat inner,
const GLfloat outer,
const GLint slices,
const GLint rings,
const GLfloat start,
const GLfloat sweep
) {
assert( inner >= 0.0f );
assert( outer > 0.0f );
assert( outer > inner );
assert( slices > 2 );
assert( rings > 0 );
assert( start >= 0.0f && start <= 360.0f );
assert( sweep >= 0.0f && sweep <= 360.0f );
CSCI441_INTERNAL::drawPartialDisk( inner, outer, slices, rings, start * glm::pi<float>() / 180.0f, sweep * glm::pi<float>() / 180.0f, GL_LINE );
}
[[maybe_unused]]
inline void CSCI441::drawSolidSphere(
const GLfloat radius,
const GLint stacks,
const GLint slices
) {
assert( radius > 0.0f );
assert( stacks > 1 );
assert( slices > 2 );
CSCI441_INTERNAL::drawSphere( radius, stacks, slices, GL_FILL );
}
[[maybe_unused]]
inline void CSCI441::drawWireSphere(
const GLfloat radius,
const GLint stacks,
const GLint slices
) {
assert( radius > 0.0f );
assert( stacks > 1);
assert( slices > 2 );
CSCI441_INTERNAL::drawSphere( radius, stacks, slices, GL_LINE );
}
[[maybe_unused]]
inline void CSCI441::drawSolidHalfSphere(
const GLfloat radius,
const GLint stacks,
const GLint slices
) {
assert( radius > 0.0f );
assert( stacks > 1 );
assert( slices > 2 );
CSCI441_INTERNAL::drawHalfSphere( radius, stacks, slices, GL_FILL );
}
[[maybe_unused]]
inline void CSCI441::drawWireHalfSphere(
const GLfloat radius,
const GLint stacks,
const GLint slices
) {
assert( radius > 0.0f );
assert( stacks > 1);
assert( slices > 2 );
CSCI441_INTERNAL::drawHalfSphere( radius, stacks, slices, GL_LINE );
}
[[maybe_unused]]
inline void CSCI441::drawSolidDome(
const GLfloat radius,
const GLint stacks,
const GLint slices
) {
assert( radius > 0.0f );
assert( stacks > 1 );
assert( slices > 2 );
CSCI441_INTERNAL::drawDome( radius, stacks, slices, GL_FILL );
}
[[maybe_unused]]
inline void CSCI441::drawWireDome(
const GLfloat radius,
const GLint stacks,
const GLint slices
) {
assert( radius > 0.0f );
assert( stacks > 1);
assert( slices > 2 );
CSCI441_INTERNAL::drawDome( radius, stacks, slices, GL_LINE );
}
[[maybe_unused]]
inline void CSCI441::drawSolidTeapot(
[[maybe_unused]] const GLfloat unused
) {
CSCI441_INTERNAL::drawTeapot(GL_FILL);
}
[[maybe_unused]]
inline void CSCI441::drawWireTeapot(
[[maybe_unused]] const GLfloat unused
) {
CSCI441_INTERNAL::drawTeapot(GL_LINE);
}
[[maybe_unused]]
inline void CSCI441::drawSolidTorus(
const GLfloat innerRadius,
const GLfloat outerRadius,
const GLint sides,
const GLint rings
) {
assert( innerRadius > 0.0f );
assert( outerRadius > 0.0f );
assert( sides > 2 );
assert( rings > 2 );
CSCI441_INTERNAL::drawTorus( innerRadius, outerRadius, sides, rings, GL_FILL );
}
[[maybe_unused]]
inline void CSCI441::drawWireTorus(
const GLfloat innerRadius,
const GLfloat outerRadius,
const GLint sides,
const GLint rings
) {
assert( innerRadius > 0.0f );
assert( outerRadius > 0.0f );
assert( sides > 2 );
assert( rings > 2 );
CSCI441_INTERNAL::drawTorus( innerRadius, outerRadius, sides, rings, GL_LINE );
}
#endif // __CSCI441_OBJECTS_HPP__