コード例 #1
0
ファイル: ConvexPoly2.cs プロジェクト: weimingtom/Sakura
 public void Translate(Vector2 dx, ConvexPoly2 poly)
 {
     this.Planes = new Plane2[poly.Planes.Length];
     for (int num = 0; num != poly.Planes.Length; num++)
     {
         this.Planes[num] = poly.Planes[num];
         Plane2[] expr_49_cp_0 = this.Planes;
         int      expr_49_cp_1 = num;
         expr_49_cp_0[expr_49_cp_1].Base = expr_49_cp_0[expr_49_cp_1].Base + dx;
     }
     this.m_sphere        = poly.m_sphere;
     this.m_sphere.Center = this.m_sphere.Center + dx;
 }
コード例 #2
0
ファイル: DrawHelpers.cs プロジェクト: weimingtom/Sakura
 public void DrawConvexPoly2(ConvexPoly2 convex_poly)
 {
     if (convex_poly.Planes.Length != 0)
     {
         this.ShaderPush();
         this.ImmBegin((DrawMode)2, (uint)(convex_poly.Planes.Length + 1));
         Plane2[] planes = convex_poly.Planes;
         for (int i = 0; i < planes.Length; i++)
         {
             Plane2 plane = planes[i];
             this.ImmVertex(new DrawHelpers.Vertex(plane.Base, this.m_current_color));
         }
         this.ImmVertex(new DrawHelpers.Vertex(convex_poly.Planes[0].Base, this.m_current_color));
         this.ImmEnd();
         this.ShaderPop();
     }
 }