public override void CleanUp() { base.CleanUp(); mesh = null; mobile = null; }
public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB) { if (noRecurse) { return; } noRecurse = true; mesh = entryA as MobileChunkCollidable; mobile = entryB as MobileChunkCollidable; if (mesh == null || mobile == null) { mesh = entryB as MobileChunkCollidable; mobile = entryA as MobileChunkCollidable; if (mesh == null || mobile == null) { throw new ArgumentException("Inappropriate types used to initialize pair."); } } broadPhaseOverlap = new BroadPhaseOverlap(mobile, mesh, broadPhaseOverlap.CollisionRule); UpdateMaterialProperties(mobile.Entity?.Material, mesh.Entity?.Material); base.Initialize(entryA, entryB); noRecurse = false; }
public override void CleanUp() { base.CleanUp(); mesh = null; convex = null; }
public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB) { if (noRecurse) { return; } noRecurse = true; mesh = entryA as MobileChunkCollidable; convex = entryB as ConvexCollidable; if (mesh == null || convex == null) { mesh = entryB as MobileChunkCollidable; convex = entryA as ConvexCollidable; if (mesh == null || convex == null) { throw new ArgumentException("Inappropriate types used to initialize pair."); } } broadPhaseOverlap = new BroadPhaseOverlap(convex, mesh, broadPhaseOverlap.CollisionRule); UpdateMaterialProperties(convex.Entity != null ? convex.Entity.Material : null, mesh.Entity != null ? mesh.Entity.Material: null); base.Initialize(entryA, entryB); noRecurse = false; }