Пример #1
0
        protected void TryToAdd(int index)
        {
            var entry = new TriangleEntry {
                Index = index
            };

            if (!subPairs.ContainsKey(entry))
            {
                var collidablePair = new CollidablePair(CollidableA, entry.Collidable = GetOpposingCollidable(index));
                var newPair        = (MobileMeshPairHandler)NarrowPhaseHelper.GetPairHandler(ref collidablePair);
                if (newPair != null)
                {
                    newPair.CollisionRule = CollisionRule;
                    newPair.UpdateMaterialProperties(MaterialA, MaterialB);  //Override the materials, if necessary.  Meshes don't currently support custom materials but..
                    newPair.Parent = this;
                    subPairs.Add(entry, newPair);
                }
            }
            containedPairs.Add(entry);
        }
Пример #2
0
 protected override void ConfigureCollidable(TriangleEntry entry, float dt)
 {
 }
Пример #3
0
 /// <summary>
 /// Configure a triangle from CollidableB to represent the object at the given index.
 /// </summary>
 /// <param name="entry">Entry to configure.</param>
 /// <param name="dt">Time step duration.</param>
 protected abstract void ConfigureCollidable(TriangleEntry entry, float dt);