public unsafe bool ConfigureContactManifold(int workerIndex, CollidablePair pair, int childIndexA, int childIndexB, ConvexContactManifold *manifold) { return(true); }
//TODO: Arguably, this could be handled within the streaming batcher. The main advantage of doing so would be CCD-like queries being available. //On the other hand, we may want to simply modularize it. Something like a low level convex batcher, which is used by the more general purpose discrete batcher //(which handles compounds, meshes, and boundary smoothing), which is used by the CCD batcher. unsafe static void ResolveLinearManifold <TMainManifold>(void *mainManifoldPointer, ConvexContactManifold *linearManifold, NonconvexContactManifold *outManifold) { //This function is responsible for prioritizing which contacts to include when there are more contacts than slots. //Note that the linear manifold is constructed from sphere-convex tests whose depths are guaranteed to be less than the deepest contact //of the main manifold by virtue of the contributing spheres being smaller than the containing shape. //Further, while it's possible for the sphere-sourced contacts to be deeper than some of the main manifold contacts due to speculative contact generation, //there is no strong reason to prefer the sphere source contacts just because their depth happens to be greater- in fact, if we trust the main manifold //contact generation logic, they should tend to be more representative of the true manifold. //In other words, we simply trust that all contacts in the main manifold are good choices, and the linear manifold's responsibility is simply to fill in gaps. //If there are no gaps, then we don't use the linear manifold at all. //So first, copy all main manifold contacts. Debug.Assert(linearManifold->Count == 2, "Inner sphere derived contacts should only ever contribute one contact per involved body, no more, no less."); var outContacts = &outManifold->Contact0; if (typeof(TMainManifold) == typeof(ConvexContactManifold)) { var mainManifold = (ConvexContactManifold *)mainManifoldPointer; outManifold->OffsetB = mainManifold->OffsetB; outManifold->Count = mainManifold->Count; var mainManifoldContacts = &mainManifold->Contact0; for (int i = 0; i < outManifold->Count; ++i) { ref var outContact = ref outContacts[i]; ref var mainContact = ref mainManifoldContacts[i]; outContact.Offset = mainContact.Offset; outContact.Depth = mainContact.Depth; outContact.Normal = mainManifold->Normal; outContact.FeatureId = mainContact.FeatureId; }
public unsafe bool ConfigureContactManifold(int workerIndex, CollidablePair pair, ConvexContactManifold *manifold, out PairMaterialProperties pairMaterial) { pairMaterial = new PairMaterialProperties(); return(false); }
public unsafe bool ConfigureContactManifold(int workerIndex, CollidablePair pair, ConvexContactManifold *manifold, out PairMaterialProperties pairMaterial) { GetMaterial(out pairMaterial); return(true); }
public unsafe void OnChildPairCompleted(int pairId, int childA, int childB, ConvexContactManifold *manifold) { }
public unsafe void OnPairCompleted(int pairId, ConvexContactManifold *manifold) { Manifolds.ConvexManifolds[pairId] = *manifold; Manifolds.ManifoldIsConvex[pairId] = true; }
public unsafe void OnPairCompleted(int pairId, ConvexContactManifold *manifold) { ref var contact = ref manifold->Contact0;
public unsafe bool ConfigureContactManifold(int workerIndex, CollidablePair pair, ConvexContactManifold *manifold, out PairMaterialProperties pairMaterial) { GetMaterial(out pairMaterial); Characters.TryReportContacts(pair, ref *manifold, workerIndex, ref pairMaterial); return(true); }
public unsafe bool ConfigureContactManifold(int workerIndex, CollidablePair pair, int childIndexA, int childIndexB, ConvexContactManifold *manifold) { //Console.WriteLine("ConfigureContactManifold3"); return(true); }
public unsafe bool ConfigureContactManifold(int workerIndex, CollidablePair pair, ConvexContactManifold *manifold, out PairMaterialProperties pairMaterial) { GetMaterial(out pairMaterial); //Console.WriteLine("ConfigureContactManifold2"); //Console.WriteLine(pair.A.Handle); //Console.WriteLine(pair.B.Handle); return(true); }
public unsafe void OnChildCompleted <TCallbacks>(ref PairContinuation report, ConvexContactManifold *manifold, ref CollisionBatcher <TCallbacks> batcher) where TCallbacks : struct, ICollisionCallbacks { Inner.OnChildCompleted(ref report, manifold, ref batcher); }
public bool ConfigureContactManifold(int workerIndex, CollidablePair pair, int childIndexA, int childIndexB, ConvexContactManifold *manifold) { if (manifold->Count > 0) { Console.WriteLine($"SUBPAIR: {pair.A} child {childIndexA} versus {pair.B} child {childIndexB}"); } return(true); }
public unsafe bool ConfigureContactManifold(int workerIndex, CollidablePair pair, ConvexContactManifold *manifold, out PairMaterialProperties pairMaterial) { if (manifold->Count > 0) { Console.WriteLine($"CONVEX PAIR: {pair.A} versus {pair.B}"); } ConfigureMaterial(out pairMaterial); return(true); }