clothing patterns

This commit is contained in:
Irlan 2018-05-24 19:04:01 -03:00
parent 8f106c8037
commit 79765fcaf3
2 changed files with 37 additions and 1 deletions

View File

@ -35,6 +35,40 @@ struct b3Garment
b3SewingLine* sewingLines;
};
struct b3RectangleGarment : public b3Garment
{
b3RectanglePattern rectangle;
b3SewingPattern* rectanglePatterns[1];
b3RectangleGarment(float32 ex = 1.0f, float32 ey = 1.0f) : rectangle(ex, ey)
{
rectanglePatterns[0] = &rectangle;
patternCount = 1;
patterns = rectanglePatterns;
sewingCount = 0;
sewingLines = nullptr;
}
};
struct b3CircleGarment : public b3Garment
{
b3CirclePattern<> circle;
b3SewingPattern* circlePatterns[1];
b3CircleGarment(float32 r = 1.0f) : circle(r)
{
circlePatterns[0] = &circle;
patternCount = 1;
patterns = circlePatterns;
sewingCount = 0;
sewingLines = nullptr;
}
};
struct b3ShirtGarment : public b3Garment
{
b3RectanglePattern frontBody;

View File

@ -55,8 +55,10 @@ struct b3CirclePattern : public b3SewingPattern
{
b3Vec2 circleVertices[E];
b3CirclePattern(b3Vec2 center = b3Vec2_zero, float32 radius = 1.0f)
b3CirclePattern(float32 radius = 1.0f)
{
b3Vec2 center = b3Vec2_zero;
float32 x = 2.0f * B3_PI / float32(E);
float32 c = cos(x);
float32 s = sin(x);