示例#1
0
        private LineSeg CalcNormal()
        {
            var vT = new Vertex2D(V1.X - V2.X, V1.Y - V2.Y);

            // Set up line normal
            Length = vT.Length();
            var invLength = 1.0f / Length;

            Normal.Set(vT.Y * invLength, -vT.X * invLength);
            return(this);
        }
 public CollisionEvent Set(CollisionEvent coll)
 {
     Ball        = coll.Ball;
     Obj         = coll.Obj;
     IsContact   = coll.IsContact;
     HitTime     = coll.HitTime;
     HitDistance = coll.HitDistance;
     HitNormal.Set(coll.HitNormal);
     HitVel.Set(coll.HitVel.X, coll.HitVel.Y);
     HitOrgNormalVelocity = coll.HitOrgNormalVelocity;
     HitMomentBit         = coll.HitMomentBit;
     HitFlag = coll.HitFlag;
     return(this);
 }