Beispiel #1
0
        public void Scatter(ref Vector3Wide offsetB, ref ContactManifold target)
        {
            var count = Count[0];

            target.SetConvexityAndCount(count, true);
            target.OffsetB.X  = offsetB.X[0];
            target.OffsetB.Y  = offsetB.Y[0];
            target.OffsetB.Z  = offsetB.Z[0];
            target.Offset0.X  = OffsetA0.X[0];
            target.Offset0.Y  = OffsetA0.Y[0];
            target.Offset0.Z  = OffsetA0.Z[0];
            target.Depth0     = Depth0[0];
            target.FeatureId0 = FeatureId0[0];
            if (count > 1)
            {
                target.Offset1.X  = OffsetA1.X[0];
                target.Offset1.Y  = OffsetA1.Y[0];
                target.Offset1.Z  = OffsetA1.Z[0];
                target.Depth1     = Depth1[0];
                target.FeatureId1 = FeatureId1[0];
            }
            target.ConvexNormal.X = Normal.X[0];
            target.ConvexNormal.Y = Normal.Y[0];
            target.ConvexNormal.Z = Normal.Z[0];
        }
 private unsafe void FillLinearManifoldSlotB(ref ContactManifold linearManifold, ContactManifold *manifold)
 {
     Debug.Assert(manifold->ContactCount == 1);
     linearManifold.Offset1    = manifold->Offset0;
     linearManifold.Depth1     = manifold->Depth0;
     linearManifold.FeatureId1 = CCDFeatureIdOffsets.LinearB;
     linearManifold.Normal1    = manifold->Normal0;
 }
Beispiel #3
0
 public void Scatter(ref Vector3Wide offsetB, ref ContactManifold target)
 {
     target.OffsetB.X      = offsetB.X[0];
     target.OffsetB.Y      = offsetB.Y[0];
     target.OffsetB.Z      = offsetB.Z[0];
     target.Offset0.X      = OffsetA0.X[0];
     target.Offset0.Y      = OffsetA0.Y[0];
     target.Offset0.Z      = OffsetA0.Z[0];
     target.Depth0         = Depth[0];
     target.ConvexNormal.X = Normal.X[0];
     target.ConvexNormal.Y = Normal.Y[0];
     target.ConvexNormal.Z = Normal.Z[0];
 }
 private unsafe void FillLinearManifoldSlotA(ref ContactManifold linearManifold, ContactManifold *manifold)
 {
     //Note that linear A is always in slot 0, and linear B is always in slot 1.
     //This is allowed because a linear pair is guaranteed to have two contacts generated from CCD.
     //There is no separation limit on inner sphere pairs, and you never just create one sphere-collidable pair- it's always bilateral.
     //Also note that offsetB is only used from linear A, not linear B. They should be identical.
     Debug.Assert(manifold->ContactCount == 1);
     linearManifold.OffsetB    = manifold->OffsetB;
     linearManifold.Offset0    = manifold->Offset0;
     linearManifold.Depth0     = manifold->Depth0;
     linearManifold.FeatureId0 = CCDFeatureIdOffsets.LinearA;
     linearManifold.Normal0    = manifold->Normal0;
 }
Beispiel #5
0
 public void PrepareManifoldForScatter(out ContactManifold manifold)
 {
     manifold = default;
 }
Beispiel #6
0
 public void PrepareManifoldForScatter(out ContactManifold manifold)
 {
     manifold = default;
     manifold.SetConvexityAndCount(1, true);
 }