improve friction quality, add shader-only support, improve debug drawing facilities, fix couple things
This commit is contained in:
		| @@ -61,10 +61,10 @@ public: | ||||
| 		 | ||||
| 		if (b3Distance(pointA, pointB) > 0.0f) | ||||
| 		{ | ||||
| 			g_debugDraw->DrawPoint(pointA, b3Color(1.0f, 0.0f, 0.0f)); | ||||
| 			g_debugDraw->DrawPoint(pointB, b3Color(1.0f, 0.0f, 0.0f)); | ||||
| 			g_debugDraw->DrawPoint(pointA, 4.0f, b3Color(0.0f, 1.0f, 0.0f)); | ||||
| 			g_debugDraw->DrawPoint(pointB, 4.0f, b3Color(0.0f, 1.0f, 0.0f)); | ||||
| 			 | ||||
| 			g_debugDraw->DrawSegment(pointA, pointB, b3Color(1.0f, 1.0f, 0.0f)); | ||||
| 			g_debugDraw->DrawSegment(pointA, pointB, b3Color(1.0f, 1.0f, 1.0f)); | ||||
| 		} | ||||
|  | ||||
| 		g_debugDraw->DrawTransform(m_xfA); | ||||
|   | ||||
| @@ -63,14 +63,14 @@ public: | ||||
| 		for (u32 i = 0; i < m_clusters.Count(); ++i) | ||||
| 		{ | ||||
| 			g_debugDraw->DrawSegment(b3Vec3(0, 0, 0), m_clusters[i].centroid, b3Color(1, 1, 1)); | ||||
| 			g_debugDraw->DrawPoint(m_clusters[i].centroid, m_colors[i]); | ||||
| 			g_debugDraw->DrawPoint(m_clusters[i].centroid, 4.0f, m_colors[i]); | ||||
|  | ||||
| 			for (u32 j = 0; j < m_observs.Count(); ++j) | ||||
| 			{ | ||||
| 				b3Observation obs = m_observs[j]; | ||||
| 				if (obs.cluster == i) | ||||
| 				{ | ||||
| 					g_debugDraw->DrawPoint(obs.point, m_colors[i]); | ||||
| 					g_debugDraw->DrawPoint(obs.point, 4.0f, m_colors[i]); | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
|   | ||||
| @@ -51,13 +51,13 @@ public: | ||||
| 			b3Vec3 pw = wmp->point; | ||||
| 			b3Vec2 ps = g_camera.ConvertWorldToScreen(pw); | ||||
| 			 | ||||
| 			g_debugDraw->DrawPoint(pw, b3Color(0.0f, 1.0f, 0.0f)); | ||||
| 			g_debugDraw->DrawPoint(pw, 4.0f, b3Color(0.0f, 1.0f, 0.0f)); | ||||
| 			g_debugDraw->DrawSegment(pw, pw + wmp->normal, b3Color(1.0f, 1.0f, 1.0f)); | ||||
| 		} | ||||
|  | ||||
| 		if (wm.pointCount > 0) | ||||
| 		{ | ||||
| 			g_debugDraw->DrawPoint(wm.center, b3Color(1.0f, 1.0f, 0.0f)); | ||||
| 			g_debugDraw->DrawPoint(wm.center, 4.0f, b3Color(1.0f, 1.0f, 0.0f)); | ||||
| 			g_debugDraw->DrawSegment(wm.center, wm.center + wm.normal, b3Color(1.0f, 1.0f, 0.0f)); | ||||
| 			g_debugDraw->DrawSegment(wm.center, wm.center + wm.tangent1, b3Color(1.0f, 1.0f, 0.0f)); | ||||
| 			g_debugDraw->DrawSegment(wm.center, wm.center + wm.tangent2, b3Color(1.0f, 1.0f, 0.0f)); | ||||
|   | ||||
| @@ -57,18 +57,18 @@ public: | ||||
| 			for (u32 i = 0; i < featurePair.countA; ++i) | ||||
| 			{ | ||||
| 				u32 index = featurePair.indexA[i]; | ||||
| 				g_debugDraw->DrawPoint(m_xfA * m_proxyA.GetVertex(index), b3Color(1.0f, 1.0f, 0.0f)); | ||||
| 				g_debugDraw->DrawPoint(m_xfA * m_proxyA.GetVertex(index), 4.0f, b3Color(1.0f, 1.0f, 0.0f)); | ||||
| 			} | ||||
|  | ||||
| 			for (u32 i = 0; i < featurePair.countB; ++i) | ||||
| 			{ | ||||
| 				u32 index = featurePair.indexB[i]; | ||||
| 				g_debugDraw->DrawPoint(m_xfB * m_proxyB.GetVertex(index), b3Color(1.0f, 1.0f, 0.0f)); | ||||
| 				g_debugDraw->DrawPoint(m_xfB * m_proxyB.GetVertex(index), 4.0f, b3Color(1.0f, 1.0f, 0.0f)); | ||||
| 			} | ||||
| 		} | ||||
| 		 | ||||
| 		g_debugDraw->DrawPoint(out.pointA, b3Color(0.0f, 1.0f, 0.0f)); | ||||
| 		g_debugDraw->DrawPoint(out.pointB, b3Color(0.0f, 1.0f, 0.0f)); | ||||
| 		g_debugDraw->DrawPoint(out.pointA, 4.0f, b3Color(0.0f, 1.0f, 0.0f)); | ||||
| 		g_debugDraw->DrawPoint(out.pointB, 4.0f, b3Color(0.0f, 1.0f, 0.0f)); | ||||
| 		g_debugDraw->DrawSegment(out.pointA, out.pointB, b3Color(1.0f, 1.0f, 1.0f)); | ||||
|  | ||||
| 		g_debugDraw->DrawTransform(m_xfA); | ||||
|   | ||||
| @@ -214,7 +214,7 @@ public: | ||||
| 		{ | ||||
| 			// Replace current hit | ||||
| 			g_debugDraw->DrawSegment(p1, hit.point, b3Color(0.0f, 1.0f, 0.0f)); | ||||
| 			g_debugDraw->DrawPoint(hit.point, b3Color(1.0f, 0.0f, 0.0f)); | ||||
| 			g_debugDraw->DrawPoint(hit.point, 4.0f, b3Color(1.0f, 0.0f, 0.0f)); | ||||
| 			g_debugDraw->DrawSegment(hit.point, hit.point + hit.normal, b3Color(1.0f, 1.0f, 1.0f)); | ||||
| 		} | ||||
| 		else | ||||
|   | ||||
| @@ -36,7 +36,8 @@ struct Settings | ||||
| 		warmStart = true; | ||||
| 		convexCache = true; | ||||
| 		drawCenterOfMasses = false; | ||||
| 		drawShapes = true; | ||||
| 		drawVerticesEdges = true; | ||||
| 		drawFaces = true; | ||||
| 		drawBounds = false; | ||||
| 		drawJoints = true; | ||||
| 		drawContactPoints = true; | ||||
| @@ -62,7 +63,8 @@ struct Settings | ||||
| 	bool convexCache; | ||||
| 	bool drawCenterOfMasses; | ||||
| 	bool drawBounds; | ||||
| 	bool drawShapes; | ||||
| 	bool drawVerticesEdges; | ||||
| 	bool drawFaces; | ||||
| 	bool drawSolidShapes; | ||||
| 	bool drawJoints; | ||||
| 	bool drawContactPoints; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user