本文整理汇总了Java中com.bulletphysics.collision.broadphase.Dispatcher类的典型用法代码示例。如果您正苦于以下问题:Java Dispatcher类的具体用法?Java Dispatcher怎么用?Java Dispatcher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Dispatcher类属于com.bulletphysics.collision.broadphase包,在下文中一共展示了Dispatcher类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateActivationState
import com.bulletphysics.collision.broadphase.Dispatcher; //导入依赖的package包/类
public void updateActivationState(CollisionWorld colWorld, Dispatcher dispatcher) {
initUnionFind(colWorld.getCollisionObjectArray().size());
// put the index into m_controllers into m_tag
{
int index = 0;
int i;
for (i = 0; i < colWorld.getCollisionObjectArray().size(); i++) {
CollisionObject collisionObject = colWorld.getCollisionObjectArray().getQuick(i);
collisionObject.setIslandTag(index);
collisionObject.setCompanionId(-1);
collisionObject.setHitFraction(1f);
index++;
}
}
// do the union find
findUnions(dispatcher, colWorld);
}
示例2: DiscreteDynamicsWorld
import com.bulletphysics.collision.broadphase.Dispatcher; //导入依赖的package包/类
public DiscreteDynamicsWorld (Dispatcher dispatcher, BroadphaseInterface pairCache, ConstraintSolver constraintSolver,
CollisionConfiguration collisionConfiguration) {
super(dispatcher, pairCache, collisionConfiguration);
this.constraintSolver = constraintSolver;
if (this.constraintSolver == null) {
this.constraintSolver = new SequentialImpulseConstraintSolver();
ownsConstraintSolver = true;
} else {
ownsConstraintSolver = false;
}
{
islandManager = new SimulationIslandManager();
}
ownsIslandManager = true;
}
示例3: DiscreteDynamicsWorld
import com.bulletphysics.collision.broadphase.Dispatcher; //导入依赖的package包/类
public DiscreteDynamicsWorld(Dispatcher dispatcher, BroadphaseInterface pairCache, ConstraintSolver constraintSolver, CollisionConfiguration collisionConfiguration) {
super(dispatcher, pairCache, collisionConfiguration);
this.constraintSolver = constraintSolver;
if (this.constraintSolver == null) {
this.constraintSolver = new SequentialImpulseConstraintSolver();
ownsConstraintSolver = true;
}
else {
ownsConstraintSolver = false;
}
{
islandManager = new SimulationIslandManager();
}
ownsIslandManager = true;
}
示例4: updateActivationState
import com.bulletphysics.collision.broadphase.Dispatcher; //导入依赖的package包/类
public void updateActivationState(CollisionWorld colWorld, Dispatcher dispatcher) {
initUnionFind(colWorld.getCollisionObjectArray().size());
// put the index into m_controllers into m_tag
{
int index = 0;
int i;
for (i = 0; i < colWorld.getCollisionObjectArray().size(); i++) {
CollisionObject collisionObject = colWorld.getCollisionObjectArray().get(i);
collisionObject.setIslandTag(index);
collisionObject.setCompanionId(-1);
collisionObject.setHitFraction(1f);
index++;
}
}
// do the union find
findUnions(dispatcher, colWorld);
}
示例5: removeOverlappingObjectInternal
import com.bulletphysics.collision.broadphase.Dispatcher; //导入依赖的package包/类
/**
* This method is mainly for expert/internal use only.
*/
public void removeOverlappingObjectInternal(BroadphaseProxy otherProxy, Dispatcher dispatcher, BroadphaseProxy thisProxy) {
CollisionObject otherObject = (CollisionObject) otherProxy.clientObject;
assert(otherObject != null);
int index = overlappingObjects.indexOf(otherObject);
if (index != -1) {
overlappingObjects.set(index, overlappingObjects.getQuick(overlappingObjects.size()-1));
overlappingObjects.removeQuick(overlappingObjects.size()-1);
}
}
示例6: findUnions
import com.bulletphysics.collision.broadphase.Dispatcher; //导入依赖的package包/类
public void findUnions(Dispatcher dispatcher, CollisionWorld colWorld) {
ObjectArrayList<BroadphasePair> pairPtr = colWorld.getPairCache().getOverlappingPairArray();
for (int i=0; i<pairPtr.size(); i++) {
BroadphasePair collisionPair = pairPtr.getQuick(i);
CollisionObject colObj0 = (CollisionObject) collisionPair.pProxy0.clientObject;
CollisionObject colObj1 = (CollisionObject) collisionPair.pProxy1.clientObject;
if (((colObj0 != null) && ((colObj0).mergesSimulationIslands())) &&
((colObj1 != null) && ((colObj1).mergesSimulationIslands()))) {
unionFind.unite((colObj0).getIslandTag(), (colObj1).getIslandTag());
}
}
}
示例7: performDiscreteCollisionDetection
import com.bulletphysics.collision.broadphase.Dispatcher; //导入依赖的package包/类
public void performDiscreteCollisionDetection () {
BulletStats.pushProfile("performDiscreteCollisionDetection");
try {
// DispatcherInfo dispatchInfo = getDispatchInfo();
updateAabbs();
BulletStats.pushProfile("calculateOverlappingPairs");
try {
broadphasePairCache.calculateOverlappingPairs(dispatcher1);
} finally {
BulletStats.popProfile();
}
Dispatcher dispatcher = getDispatcher();
{
BulletStats.pushProfile("dispatchAllCollisionPairs");
try {
if (dispatcher != null) {
dispatcher.dispatchAllCollisionPairs(broadphasePairCache.getOverlappingPairCache(), dispatchInfo, dispatcher1);
}
} finally {
BulletStats.popProfile();
}
}
} finally {
BulletStats.popProfile();
}
}
示例8: ConvexTriangleCallback
import com.bulletphysics.collision.broadphase.Dispatcher; //导入依赖的package包/类
public ConvexTriangleCallback(Dispatcher dispatcher, CollisionObject body0, CollisionObject body1, boolean isSwapped) {
this.dispatcher = dispatcher;
this.dispatchInfoPtr = null;
convexBody = isSwapped ? body1 : body0;
triBody = isSwapped ? body0 : body1;
//
// create the manifold from the dispatcher 'manifold pool'
//
manifoldPtr = dispatcher.getNewManifold(convexBody, triBody);
clearCache();
}
示例9: removeOverlappingObjectInternal
import com.bulletphysics.collision.broadphase.Dispatcher; //导入依赖的package包/类
@Override
public void removeOverlappingObjectInternal(BroadphaseProxy otherProxy, Dispatcher dispatcher, BroadphaseProxy thisProxy1) {
CollisionObject otherObject = (CollisionObject)otherProxy.clientObject;
BroadphaseProxy actualThisProxy = thisProxy1 != null? thisProxy1 : getBroadphaseHandle();
assert(actualThisProxy != null);
assert (otherObject != null);
int index = overlappingObjects.indexOf(otherObject);
if (index != -1) {
overlappingObjects.setQuick(index, overlappingObjects.getQuick(overlappingObjects.size()-1));
overlappingObjects.removeQuick(overlappingObjects.size()-1);
hashPairCache.removeOverlappingPair(actualThisProxy, otherProxy, dispatcher);
}
}
示例10: dispatchAllCollisionPairs
import com.bulletphysics.collision.broadphase.Dispatcher; //导入依赖的package包/类
@Override
public void dispatchAllCollisionPairs(OverlappingPairCache pairCache, DispatcherInfo dispatchInfo, Dispatcher dispatcher) {
//m_blockedForChanges = true;
collisionPairCallback.init(dispatchInfo, this);
pairCache.processAllOverlappingPairs(collisionPairCallback, dispatcher);
//m_blockedForChanges = false;
}
示例11: removeOverlappingPair
import com.bulletphysics.collision.broadphase.Dispatcher; //导入依赖的package包/类
public Object removeOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1, Dispatcher dispatcher) {
CollisionObject colObj0 = (CollisionObject)proxy0.clientObject;
CollisionObject colObj1 = (CollisionObject)proxy1.clientObject;
GhostObject ghost0 = GhostObject.upcast(colObj0);
GhostObject ghost1 = GhostObject.upcast(colObj1);
if (ghost0 != null) {
ghost0.removeOverlappingObjectInternal(proxy1, dispatcher, proxy0);
}
if (ghost1 != null) {
ghost1.removeOverlappingObjectInternal(proxy0, dispatcher, proxy1);
}
return null;
}
示例12: init
import com.bulletphysics.collision.broadphase.Dispatcher; //导入依赖的package包/类
public void init (ContactSolverInfo solverInfo, ConstraintSolver solver,
ObjectArrayList<TypedConstraint> sortedConstraints, int numConstraints, IDebugDraw debugDrawer, Dispatcher dispatcher) {
this.solverInfo = solverInfo;
this.solver = solver;
this.sortedConstraints = sortedConstraints;
this.numConstraints = numConstraints;
this.debugDrawer = debugDrawer;
this.dispatcher = dispatcher;
}
示例13: ClosestNotMeConvexResultCallback
import com.bulletphysics.collision.broadphase.Dispatcher; //导入依赖的package包/类
public ClosestNotMeConvexResultCallback (CollisionObject me, Vector3 fromA, Vector3 toA, OverlappingPairCache pairCache,
Dispatcher dispatcher) {
super(fromA, toA);
this.me = me;
this.pairCache = pairCache;
this.dispatcher = dispatcher;
}
示例14: performDiscreteCollisionDetection
import com.bulletphysics.collision.broadphase.Dispatcher; //导入依赖的package包/类
public void performDiscreteCollisionDetection() {
BulletStats.pushProfile("performDiscreteCollisionDetection");
try {
//DispatcherInfo dispatchInfo = getDispatchInfo();
updateAabbs();
BulletStats.pushProfile("calculateOverlappingPairs");
try {
broadphasePairCache.calculateOverlappingPairs(dispatcher1);
}
finally {
BulletStats.popProfile();
}
Dispatcher dispatcher = getDispatcher();
{
BulletStats.pushProfile("dispatchAllCollisionPairs");
try {
if (dispatcher != null) {
dispatcher.dispatchAllCollisionPairs(broadphasePairCache.getOverlappingPairCache(), dispatchInfo, dispatcher1);
}
}
finally {
BulletStats.popProfile();
}
}
}
finally {
BulletStats.popProfile();
}
}
示例15: init
import com.bulletphysics.collision.broadphase.Dispatcher; //导入依赖的package包/类
public void init(ContactSolverInfo solverInfo, ConstraintSolver solver, ObjectArrayList<TypedConstraint> sortedConstraints, int numConstraints, IDebugDraw debugDrawer, Dispatcher dispatcher) {
this.solverInfo = solverInfo;
this.solver = solver;
this.sortedConstraints = sortedConstraints;
this.numConstraints = numConstraints;
this.debugDrawer = debugDrawer;
this.dispatcher = dispatcher;
}