clothing patterns
This commit is contained in:
		| @@ -35,6 +35,40 @@ struct b3Garment | |||||||
| 	b3SewingLine* sewingLines; | 	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 | struct b3ShirtGarment : public b3Garment | ||||||
| { | { | ||||||
| 	b3RectanglePattern frontBody; | 	b3RectanglePattern frontBody; | ||||||
|   | |||||||
| @@ -55,8 +55,10 @@ struct b3CirclePattern : public b3SewingPattern | |||||||
| { | { | ||||||
| 	b3Vec2 circleVertices[E]; | 	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 x = 2.0f * B3_PI / float32(E); | ||||||
| 		float32 c = cos(x); | 		float32 c = cos(x); | ||||||
| 		float32 s = sin(x); | 		float32 s = sin(x); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user