createTorusMesh can now create a partial torus

Capping the torus also supported.
Bit arguably if caps belong in this function, but default for caps is off and they can be useful.
(one could also code partial minor circles ... but I'm stopping there)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6225 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2021-06-28 14:33:08 +00:00
parent 28fd5f8a4f
commit 38e2aa1338
3 changed files with 68 additions and 16 deletions

View File

@ -186,12 +186,22 @@ public:
//! Create a torus mesh
/** Note: Segments might get reduced to ensure it fits into 16-bit meshbuffer.
With 255 segments for minor and major circle you'll hit the maximum.
When using caps 2 more vertices are added.
Note: UV's for caps are probably not useful
\param majorRadius Starting from mesh center
\param minorRadius Starting from a circle at majorRadius distance around center
\param majorSegments Segments for major circle. Will use at least 3 segments.
\param minorSegments Segments for minor circle. Will use at least 3 segments.
\param angleStart Start major circle between 0 and 360<36> and < angleEnd
\param angleEnd End major circle between 0 and 360<36> and > angleStart
\param capEnds When you don't create a full major circle you might want caps
0 = no caps (default)
Bit 1: add cap at angleStart
Bit 2: add cap at angleEnd
*/
virtual IMesh* createTorusMesh(f32 majorRadius, f32 minorRadius, u32 majorSegments = 32, u32 minorSegments = 16) const = 0;
virtual IMesh* createTorusMesh(f32 majorRadius, f32 minorRadius,
u32 majorSegments = 32, u32 minorSegments = 16,
f32 angleStart=0.f, f32 angleEnd=360.f, int capEnds=0) const = 0;
//! Create a volume light mesh.
/**