Преглед изворни кода

easymesh: fix the non-uniform sphere scaling and enforce odd numbers

of capsule divisions.
legacy
Sam Hocevar sam пре 12 година
родитељ
комит
fdf946042a
1 измењених фајлова са 9 додато и 1 уклоњено
  1. +9
    -1
      src/easymesh/easymesh.cpp

+ 9
- 1
src/easymesh/easymesh.cpp Прегледај датотеку

@@ -366,6 +366,11 @@ void EasyMesh::AppendCapsule(int ndivisions, float h, float r)

Array<vec3> vertices;

/* FIXME: we don't know how to handle even-divided capsules, so we
* force the count to be odd. */
if (h)
ndivisions |= 1;

/* Fill in the icosahedron vertices, rotating them so that there
* is a vertex at [0 1 0] and [0 -1 0] after normalisation. */
float phi = 0.5f + 0.5f * sqrt(5.f);
@@ -453,7 +458,10 @@ void EasyMesh::AppendCapsule(int ndivisions, float h, float r)

void EasyMesh::AppendSphere(int ndivisions, vec3 const &size)
{
AppendCapsule(ndivisions, 0.f, size.x);
OpenBrace();
AppendCapsule(ndivisions, 0.f, 1.f);
Scale(size);
CloseBrace();
}

void EasyMesh::AppendBox(vec3 const &size, float chamf)


Loading…
Откажи
Сачувај