コード例 #1
0
 public ItemContactState(ItemCollision itemCollision, Collision collision, Contact contact, Int32 timesReacted)
 {
     Interactive = itemCollision.Interactive;
     TimesReacted = timesReacted;
     Collision = collision;
     Contact = contact;
     Point = contact.PointB;
     Radius = Point - Interactive.Position;
     Normal = contact.NormalAB;
     Velocity = Interactive.GetVelocityAt(Radius);
     Approach = -Vector3.Dot(Normal, Velocity);
     Momentum = Interactive.GetForceAt(Radius);
     Weight = -Vector3.Dot(Normal, Momentum);
     Orthonormal = Normal.Orthonormal(Velocity);
 }
コード例 #2
0
 public ItemCollision(Item item, Interactive interactive, Collision[] collisions)
 {
     this.Item = item;
     this.Interactive = interactive;
     this.Collisions = collisions;
 }