@@ -22,45 +22,43 @@ public class ShapeDistance : Sample
2222
2323 public const int m_simplexCapacity = 20 ;
2424
25- B2Polygon m_box ;
26- B2Polygon m_triangle ;
27- B2Vec2 m_point ;
28- B2Segment m_segment ;
29-
30- ShapeType m_typeA ;
31- ShapeType m_typeB ;
32- float m_radiusA ;
33- float m_radiusB ;
34- B2ShapeProxy m_proxyA ;
35- B2ShapeProxy m_proxyB ;
36-
37- B2SimplexCache m_cache ;
38- B2Simplex [ ] m_simplexes = new B2Simplex [ m_simplexCapacity ] ;
39- int m_simplexCount ;
40- int m_simplexIndex ;
41-
42-
43- B2Transform m_transform ;
44- float m_angle ;
45-
46- B2Vec2 m_basePosition ;
47- B2Vec2 m_startPoint ;
48- float m_baseAngle ;
49-
50- bool m_dragging ;
51- bool m_rotating ;
52- bool m_showIndices ;
53- bool m_useCache ;
54- bool m_drawSimplex ;
55-
25+ private B2Polygon m_box ;
26+ private B2Polygon m_triangle ;
27+ private B2Vec2 m_point ;
28+ private B2Segment m_segment ;
29+
30+ private ShapeType m_typeA ;
31+ private ShapeType m_typeB ;
32+ private float m_radiusA ;
33+ private float m_radiusB ;
34+ private B2ShapeProxy m_proxyA ;
35+ private B2ShapeProxy m_proxyB ;
36+
37+ private B2SimplexCache m_cache ;
38+ private B2Simplex [ ] m_simplexes = new B2Simplex [ m_simplexCapacity ] ;
39+ private int m_simplexCount ;
40+ private int m_simplexIndex ;
41+
42+ private B2Transform m_transform ;
43+ private float m_angle ;
44+
45+ private B2Vec2 m_basePosition ;
46+ private B2Vec2 m_startPoint ;
47+ private float m_baseAngle ;
48+
49+ private bool m_dragging ;
50+ private bool m_rotating ;
51+ private bool m_showIndices ;
52+ private bool m_useCache ;
53+ private bool m_drawSimplex ;
5654
5755 //
58- public B2Vec2 _outputPointA ;
59- public B2Vec2 _outputPointB ;
60- public B2Vec2 _outputNormal ;
56+ private B2Vec2 _outputPointA ;
57+ private B2Vec2 _outputPointB ;
58+ private B2Vec2 _outputNormal ;
6159
62- public float _outputDistance ;
63- public int _outputIterations ;
60+ private float _outputDistance ;
61+ private int _outputIterations ;
6462
6563
6664 private static Sample Create ( SampleContext context )
@@ -218,9 +216,9 @@ public override void UpdateGui()
218216 base . UpdateGui ( ) ;
219217
220218 float fontSize = ImGui . GetFontSize ( ) ;
221- float height = 310 .0f;
219+ float height = 21 .0f * fontSize ;
222220 ImGui . SetNextWindowPos ( new Vector2 ( 0.5f * fontSize , m_camera . height - height - 2.0f * fontSize ) , ImGuiCond . Once ) ;
223- ImGui . SetNextWindowSize ( new Vector2 ( 240 .0f, height ) ) ;
221+ ImGui . SetNextWindowSize ( new Vector2 ( 19 .0f * fontSize , height ) ) ;
224222
225223 ImGui . Begin ( "Shape Distance" , ImGuiWindowFlags . NoMove | ImGuiWindowFlags . NoResize ) ;
226224
0 commit comments