public void Translate( Vector2 dx, ConvexPoly2 poly ) { Planes = new Plane2[ poly.Planes.Length ]; for ( int i=0; i != poly.Planes.Length; ++i ) { Planes[i] = poly.Planes[i]; Planes[i].Base += dx; } m_sphere = poly.m_sphere; m_sphere.Center += dx; }
/// <summary> /// Draw convex polygon. /// </summary> public void DrawConvexPoly2( ConvexPoly2 convex_poly ) { if ( convex_poly.Planes.Length == 0 ) return; ShaderPush(); ImmBegin( DrawMode.LineStrip, (uint)convex_poly.Planes.Length + 1 ); foreach ( Plane2 p in convex_poly.Planes ) ImmVertex( new Vertex( p.Base, m_current_color ) ); ImmVertex( new Vertex( convex_poly.Planes[0].Base, m_current_color ) ); ImmEnd(); ShaderPop(); }