public override CollisionAlgorithm CreateCollisionAlgorithm(CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1) { SphereTriangleCollisionAlgorithm algo = BulletGlobals.SphereTriangleCollisionAlgorithmPool.Get(); algo.Initialize(ci.GetManifold(), ci, body0, body1, m_swapped); return(algo); }
public virtual void Initialize(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1, bool swapped) { base.Initialize(ci, body0, body1); m_ownManifold = false; m_manifoldPtr = mf; m_swapped = swapped; }
} // for pool public SphereTriangleCollisionAlgorithm(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1, bool swapped) : base(ci, body0, body1) { m_ownManifold = false; m_manifoldPtr = mf; m_swapped = swapped; }
public override CollisionAlgorithm CreateCollisionAlgorithm(CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1) { SphereBoxCollisionAlgorithm algo = BulletGlobals.SphereBoxCollisionAlgorithmPool.Get(); algo.Initialize(null, ci, body0, body1, false); return(algo); }
public override CollisionAlgorithm CreateCollisionAlgorithm(CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1) { ConvexConvexAlgorithm cca = BulletGlobals.ConvexConvexAlgorithmPool.Get(); cca.Initialize(ci.GetManifold(), ci, body0, body1, m_simplexSolver, m_pdSolver, m_numPerturbationIterations, m_minimumPointsPerturbationThreshold); return(cca); }
public override CollisionAlgorithm CreateCollisionAlgorithm(CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1) { ConvexConcaveCollisionAlgorithm algo = BulletGlobals.ConvexConcaveCollisionAlgorithmPool.Get(); algo.Inititialize(ci, body0, body1, true); return(algo); }
public CollisionAlgorithm FindAlgorithm(CollisionObject body0, CollisionObject body1, PersistentManifold sharedManifold) { CollisionAlgorithmConstructionInfo ci = new CollisionAlgorithmConstructionInfo(this, -1); ci.SetManifold(sharedManifold); int index1 = (int)body0.GetCollisionShape().GetShapeType(); int index2 = (int)body1.GetCollisionShape().GetShapeType(); return(m_doubleDispatch[index1, index2].CreateCollisionAlgorithm(ci, body0, body1)); }
public Convex2dConvex2dAlgorithm(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1, ISimplexSolverInterface simplexSolver, IConvexPenetrationDepthSolver pdSolver, int numPerturbationIterations, int minimumPointsPerturbationThreshold) : base(ci, body0, body1) { m_simplexSolver = simplexSolver; m_pdSolver = pdSolver; m_ownManifold = false; m_manifoldPtr = mf; m_lowLevelOfDetail = false; m_numPerturbationIterations = numPerturbationIterations; m_minimumPointsPerturbationThreshold = minimumPointsPerturbationThreshold; }
public void Initialize(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1) { base.Initialize(ci); m_ownManifold = false; m_manifoldPtr = mf; if (m_manifoldPtr == null && m_dispatcher.NeedsCollision(body0, body1)) { m_manifoldPtr = m_dispatcher.GetNewManifold(body0, body1); m_ownManifold = true; } }
public virtual void Initialize(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci, CollisionObject colObj0, CollisionObject colObj1) { base.Initialize(ci, colObj0, colObj1); m_ownManifold = false; m_manifoldPtr = mf; if (m_manifoldPtr == null) { m_manifoldPtr = m_dispatcher.GetNewManifold(colObj0, colObj1); m_ownManifold = true; } }
} // for pool public SphereSphereCollisionAlgorithm(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1) : base(ci, body0, body1) { m_ownManifold = false; m_manifoldPtr = mf; // for some reason theres no check in 2.76 or 2.78 for a needs collision, just a check on pointer being null. if (m_manifoldPtr == null) { m_manifoldPtr = m_dispatcher.GetNewManifold(body0, body1); m_ownManifold = true; } }
public void Inititialize(CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1, bool isSwapped) { base.Initialize(ci, body0, body1); m_isSwapped = isSwapped; if (m_convexTriangleCallback == null) { m_convexTriangleCallback = new ConvexTriangleCallback(m_dispatcher, body0, body1, isSwapped); } else { m_convexTriangleCallback.Initialize(m_dispatcher, body0, body1, isSwapped); } }
public virtual void Initialize(CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1, bool isSwapped) { base.Initialize(ci, body0, body1); m_isSwapped = isSwapped; m_sharedManifold = ci.GetManifold(); m_ownsManifold = false; CollisionObject colObj = m_isSwapped ? body1 : body0; Debug.Assert(colObj.GetCollisionShape().IsCompound()); CompoundShape compoundShape = (CompoundShape)(colObj.GetCollisionShape()); m_compoundShapeRevision = compoundShape.GetUpdateRevision(); PreallocateChildAlgorithms(body0, body1); }
public void Initialize(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1, ISimplexSolverInterface simplexSolver, IConvexPenetrationDepthSolver pdSolver, int numPerturbationIterations, int minimumPointsPerturbationThreshold) { base.Initialize(ci, body0, body1); m_simplexSolver = simplexSolver; m_pdSolver = pdSolver; m_ownManifold = false; m_manifoldPtr = mf; m_lowLevelOfDetail = false; #if USE_SEPDISTANCE_UTIL2 m_sepDistance((static_cast <btConvexShape *>(body0.getCollisionShape())).getAngularMotionDisc(), (static_cast <btConvexShape *>(body1.getCollisionShape())).getAngularMotionDisc()), #endif m_numPerturbationIterations = numPerturbationIterations; m_minimumPointsPerturbationThreshold = minimumPointsPerturbationThreshold; }
} // for pool public SphereBoxCollisionAlgorithm(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci, CollisionObject col0, CollisionObject col1, bool isSwapped) : base(ci, col0, col1) { m_isSwapped = isSwapped; m_ownManifold = false; m_manifoldPtr = mf; CollisionObject sphereObj = m_isSwapped ? col1 : col0; CollisionObject boxObj = m_isSwapped ? col0 : col1; if (m_manifoldPtr == null && m_dispatcher.NeedsCollision(sphereObj, boxObj)) { m_manifoldPtr = m_dispatcher.GetNewManifold(sphereObj, boxObj); m_ownManifold = true; } }
public virtual void ProcessTriangle(IndexedVector3[] triangle, int partId, int triangleIndex) { if (!AabbUtil2.TestTriangleAgainstAabb2(triangle, ref m_aabbMin, ref m_aabbMax)) { return; } //aabb filter is already applied! CollisionAlgorithmConstructionInfo ci = new CollisionAlgorithmConstructionInfo(); ci.SetDispatcher(m_dispatcher); CollisionObject ob = m_triBody as CollisionObject; ///debug drawing of the overlapping triangles /// #if false if (m_dispatchInfoPtr != null && m_dispatchInfoPtr.getDebugDraw() != null && ((m_dispatchInfoPtr.getDebugDraw().GetDebugMode() & DebugDrawModes.DBG_DrawWireframe) > 0)) { IndexedVector3 color = new IndexedVector3(1, 1, 0); IndexedMatrix tr = ob.GetWorldTransform(); IndexedVector3[] transformedTriangles = new IndexedVector3[3]; IndexedVector3.Transform(triangle, ref tr, transformedTriangles); m_dispatchInfoPtr.getDebugDraw().DrawLine(ref transformedTriangles[0], ref transformedTriangles[1], ref color); m_dispatchInfoPtr.getDebugDraw().DrawLine(ref transformedTriangles[1], ref transformedTriangles[2], ref color); m_dispatchInfoPtr.getDebugDraw().DrawLine(ref transformedTriangles[2], ref transformedTriangles[0], ref color); } #endif if (m_convexBody.GetCollisionShape().IsConvex()) { using (TriangleShape tm = BulletGlobals.TriangleShapePool.Get()) { tm.Initialize(ref triangle[0], ref triangle[1], ref triangle[2]); tm.SetMargin(m_collisionMarginTriangle); CollisionShape tmpShape = ob.GetCollisionShape(); ob.InternalSetTemporaryCollisionShape(tm); CollisionAlgorithm colAlgo = ci.GetDispatcher().FindAlgorithm(m_convexBody, m_triBody, m_manifoldPtr); ///this should use the btDispatcher, so the actual registered algorithm is used // btConvexConvexAlgorithm cvxcvxalgo(m_manifoldPtr,ci,m_convexBody,m_triBody); if (m_resultOut.GetBody0Internal() == m_triBody) { m_resultOut.SetShapeIdentifiersA(partId, triangleIndex); } else { m_resultOut.SetShapeIdentifiersB(partId, triangleIndex); } colAlgo.ProcessCollision(m_convexBody, m_triBody, m_dispatchInfoPtr, m_resultOut); ci.GetDispatcher().FreeCollisionAlgorithm(colAlgo); colAlgo = null; ob.InternalSetTemporaryCollisionShape(tmpShape); } } }
} // for pool public ConvexConcaveCollisionAlgorithm(CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1, bool isSwapped) : base(ci, body0, body1) { m_isSwapped = isSwapped; m_convexTriangleCallback = new ConvexTriangleCallback(m_dispatcher, body0, body1, isSwapped); }
public GImpactCollisionAlgorithm(CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1) : base(ci, body0, body1) { }
public virtual void Initialize(CollisionAlgorithmConstructionInfo ci) { m_dispatcher = ci.GetDispatcher(); ++BulletGlobals.s_collisionAlgorithmInstanceCount; colAgorithmId = BulletGlobals.s_collisionAlgorithmInstanceCount; }
public override void Initialize(CollisionAlgorithmConstructionInfo ci) { base.Initialize(ci); }
public SphereSphereCollisionAlgorithm(CollisionAlgorithmConstructionInfo ci) : base(ci) { }
public override CollisionAlgorithm CreateCollisionAlgorithm(CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1) { return(new EmptyAlgorithm(ci)); }
} // for pool public BoxBoxCollisionAlgorithm(CollisionAlgorithmConstructionInfo ci) : base(ci) { }
public override CollisionAlgorithm CreateCollisionAlgorithm(CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1) { return(new Box2dBox2dCollisionAlgorithm(null, ci, body0, body1)); }
public override void Initialize(CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1) { base.Initialize(ci, body0, body1); }
public EmptyAlgorithm(CollisionAlgorithmConstructionInfo ci) { }
public override CollisionAlgorithm CreateCollisionAlgorithm(CollisionAlgorithmConstructionInfo ci, CollisionObject body0, CollisionObject body1) { return(new Convex2dConvex2dAlgorithm(ci.GetManifold(), ci, body0, body1, m_simplexSolver, m_pdSolver, m_numPerturbationIterations, m_minimumPointsPerturbationThreshold)); }