当前位置: 首页>>代码示例>>Java>>正文


Java ManifoldPoint类代码示例

本文整理汇总了Java中com.bulletphysics.collision.narrowphase.ManifoldPoint的典型用法代码示例。如果您正苦于以下问题:Java ManifoldPoint类的具体用法?Java ManifoldPoint怎么用?Java ManifoldPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ManifoldPoint类属于com.bulletphysics.collision.narrowphase包,在下文中一共展示了ManifoldPoint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: solveCombinedContactFriction

import com.bulletphysics.collision.narrowphase.ManifoldPoint; //导入依赖的package包/类
public float solveCombinedContactFriction (RigidBody body0, RigidBody body1, ManifoldPoint cp, ContactSolverInfo info,
	int iter, IDebugDraw debugDrawer) {
	float maxImpulse = 0f;

	{
		if (cp.getDistance() <= 0f) {
			{
				// btConstraintPersistentData* cpd = (btConstraintPersistentData*) cp.m_userPersistentData;
				float impulse = ContactConstraint.resolveSingleCollisionCombined(body0, body1, cp, info);

				if (maxImpulse < impulse) {
					maxImpulse = impulse;
				}
			}
		}
	}
	return maxImpulse;
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:19,代码来源:SequentialImpulseConstraintSolver.java

示例2: solve

import com.bulletphysics.collision.narrowphase.ManifoldPoint; //导入依赖的package包/类
protected float solve (RigidBody body0, RigidBody body1, ManifoldPoint cp, ContactSolverInfo info, int iter,
	IDebugDraw debugDrawer) {
	float maxImpulse = 0f;

	{
		if (cp.getDistance() <= 0f) {
			{
				ConstraintPersistentData cpd = (ConstraintPersistentData)cp.userPersistentData;
				float impulse = cpd.contactSolverFunc.resolveContact(body0, body1, cp, info);

				if (maxImpulse < impulse) {
					maxImpulse = impulse;
				}
			}
		}
	}

	return maxImpulse;
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:20,代码来源:SequentialImpulseConstraintSolver.java

示例3: solveCombinedContactFriction

import com.bulletphysics.collision.narrowphase.ManifoldPoint; //导入依赖的package包/类
public float solveCombinedContactFriction(RigidBody body0, RigidBody body1, ManifoldPoint cp, ContactSolverInfo info, int iter, IDebugDraw debugDrawer) {
	float maxImpulse = 0f;

	{
		if (cp.getDistance() <= 0f) {
			{
				//btConstraintPersistentData* cpd = (btConstraintPersistentData*) cp.m_userPersistentData;
				float impulse = ContactConstraint.resolveSingleCollisionCombined(body0, body1, cp, info);

				if (maxImpulse < impulse) {
					maxImpulse = impulse;
				}
			}
		}
	}
	return maxImpulse;
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:18,代码来源:SequentialImpulseConstraintSolver.java

示例4: solve

import com.bulletphysics.collision.narrowphase.ManifoldPoint; //导入依赖的package包/类
protected float solve(RigidBody body0, RigidBody body1, ManifoldPoint cp, ContactSolverInfo info, int iter, IDebugDraw debugDrawer) {
	float maxImpulse = 0f;

	{
		if (cp.getDistance() <= 0f) {
			{
				ConstraintPersistentData cpd = (ConstraintPersistentData) cp.userPersistentData;
				float impulse = cpd.contactSolverFunc.resolveContact(body0, body1, cp, info);

				if (maxImpulse < impulse) {
					maxImpulse = impulse;
				}
			}
		}
	}

	return maxImpulse;
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:19,代码来源:SequentialImpulseConstraintSolver.java

示例5: contactProcessed

import com.bulletphysics.collision.narrowphase.ManifoldPoint; //导入依赖的package包/类
@Override
public boolean contactProcessed(ManifoldPoint arg0, Object obj1, Object obj2)
{
  CollisionObject o1 = (CollisionObject) obj1;
  CollisionObject o2 = (CollisionObject) obj2;

  for (PhysicsBody body : watchList)
  {
    if (body.body == o1)
    {

      body.collidedWith(o2);
    }
    else if (body.body == o2)
    {

      body.collidedWith(o1);
    }
  }
  return false;
}
 
开发者ID:l50,项目名称:redrun,代码行数:22,代码来源:PhysicsWorld.java

示例6: contactAdded

import com.bulletphysics.collision.narrowphase.ManifoldPoint; //导入依赖的package包/类
public boolean contactAdded(ManifoldPoint cp, CollisionObject colObj0, int partId0, int index0, CollisionObject colObj1, int partId1, int index1) {
	float friction0 = colObj0.getFriction();
	float friction1 = colObj1.getFriction();
	float restitution0 = colObj0.getRestitution();
	float restitution1 = colObj1.getRestitution();

	if ((colObj0.getCollisionFlags() & CollisionFlags.CUSTOM_MATERIAL_CALLBACK) != 0) {
		friction0 = 1f; //partId0,index0
		restitution0 = 0f;
	}
	if ((colObj1.getCollisionFlags() & CollisionFlags.CUSTOM_MATERIAL_CALLBACK) != 0) {
		if ((index1 & 1) != 0) {
			friction1 = 1f; //partId1,index1
		}
		else {
			friction1 = 0f;
		}
		restitution1 = 0f;
	}

	cp.combinedFriction = calculateCombinedFriction(friction0, friction1);
	cp.combinedRestitution = calculateCombinedRestitution(restitution0, restitution1);

	// this return value is currently ignored, but to be on the safe side: return false if you don't calculate friction
	return true;
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:27,代码来源:ConcaveDemo.java

示例7: update

import com.bulletphysics.collision.narrowphase.ManifoldPoint; //导入依赖的package包/类
public static void update() {
	world.stepSimulation(Time.getDeltaSeconds());
	
	for (PersistentManifold pm : world.getDispatcher().getInternalManifoldPointer()) {
		GameObject objectA = (GameObject)((CollisionObject)pm.getBody0()).getUserPointer();
		GameObject objectB = (GameObject)((CollisionObject)pm.getBody1()).getUserPointer();
		
		if (objectA != null && objectB != null) {
			for (int contactId = 0; contactId < pm.getNumContacts(); contactId++) {
				ManifoldPoint mp = pm.getContactPoint(contactId);
				if (mp.getDistance() < 0.0f) {
					objectA.onCollision(mp,objectB);
				}
			}
		}
	}
}
 
开发者ID:Axodoss,项目名称:Wicken,代码行数:18,代码来源:PhysicsSystem.java

示例8: getEvent

import com.bulletphysics.collision.narrowphase.ManifoldPoint; //导入依赖的package包/类
public PhysicsCollisionEvent getEvent(int type, PhysicsCollisionObject source, PhysicsCollisionObject nodeB, ManifoldPoint cp) {
    PhysicsCollisionEvent event = eventBuffer.poll();
    if (event == null) {
        event = new PhysicsCollisionEvent(type, source, nodeB, cp);
    }else{
        event.refactor(type, source, nodeB, cp);
    }
    return event;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:10,代码来源:PhysicsCollisionEventFactory.java

示例9: PhysicsCollisionEvent

import com.bulletphysics.collision.narrowphase.ManifoldPoint; //导入依赖的package包/类
public PhysicsCollisionEvent(int type, PhysicsCollisionObject source, PhysicsCollisionObject nodeB, ManifoldPoint cp) {
    super(source);
    this.type = type;
    this.nodeA = source;
    this.nodeB = nodeB;
    this.cp = cp;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:8,代码来源:PhysicsCollisionEvent.java

示例10: refactor

import com.bulletphysics.collision.narrowphase.ManifoldPoint; //导入依赖的package包/类
/**
 * used by event factory, called when event reused
 */
public void refactor(int type, PhysicsCollisionObject source, PhysicsCollisionObject nodeB, ManifoldPoint cp) {
    this.source = source;
    this.type = type;
    this.nodeA = source;
    this.nodeB = nodeB;
    this.cp = cp;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:11,代码来源:PhysicsCollisionEvent.java

示例11: solveFriction

import com.bulletphysics.collision.narrowphase.ManifoldPoint; //导入依赖的package包/类
protected float solveFriction (RigidBody body0, RigidBody body1, ManifoldPoint cp, ContactSolverInfo info, int iter,
	IDebugDraw debugDrawer) {
	{
		if (cp.getDistance() <= 0f) {
			ConstraintPersistentData cpd = (ConstraintPersistentData)cp.userPersistentData;
			cpd.frictionSolverFunc.resolveContact(body0, body1, cp, info);
		}
	}
	return 0f;
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:11,代码来源:SequentialImpulseConstraintSolver.java

示例12: resolveSingleFrictionEmpty

import com.bulletphysics.collision.narrowphase.ManifoldPoint; //导入依赖的package包/类
public static float resolveSingleFrictionEmpty(
		RigidBody body1,
		RigidBody body2,
		ManifoldPoint contactPoint,
		ContactSolverInfo solverInfo) {
	return 0f;
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:8,代码来源:ContactConstraint.java

示例13: solveFriction

import com.bulletphysics.collision.narrowphase.ManifoldPoint; //导入依赖的package包/类
protected float solveFriction(RigidBody body0, RigidBody body1, ManifoldPoint cp, ContactSolverInfo info, int iter, IDebugDraw debugDrawer) {
	{
		if (cp.getDistance() <= 0f) {
			ConstraintPersistentData cpd = (ConstraintPersistentData) cp.userPersistentData;
			cpd.frictionSolverFunc.resolveContact(body0, body1, cp, info);
		}
	}
	return 0f;
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:10,代码来源:SequentialImpulseConstraintSolver.java

示例14: onCollision

import com.bulletphysics.collision.narrowphase.ManifoldPoint; //导入依赖的package包/类
@Override
public void onCollision(ManifoldPoint mp, GameObject object) {
	// TODO: check if impact material is equal to "material"
	// TODO: check how hard the impact is, should include "mass" in the calculation
	
	final float lowerLimit = 20.0f;
	final float upperLimit = 100.0f;
	
	if (mp.appliedImpulse > lowerLimit) {
	
		int soundId = 0;
		if (mp.appliedImpulse >= upperLimit) {
			soundId = impacts.length - 1;
		} else {
			soundId = (int)(((mp.appliedImpulse - lowerLimit) / (upperLimit - lowerLimit)) * (float)impacts.length);
		}
		
		Sound impactSound = impacts[soundId];
		
		if (!impactSound.isPlaying()) {
			javax.vecmath.Vector3f pos = new javax.vecmath.Vector3f();
			mp.getPositionWorldOnA(pos );
			impactSound.setPosition(new Vector3f(pos.x, pos.y, pos.z));
			impactSound.play();
		}
	}
}
 
开发者ID:Axodoss,项目名称:Wicken,代码行数:28,代码来源:SoundOnImpact.java

示例15: get

import com.bulletphysics.collision.narrowphase.ManifoldPoint; //导入依赖的package包/类
@Override
public ManifoldPoint get() {
	return new ManifoldPoint();
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:5,代码来源:ManifoldResult.java


注:本文中的com.bulletphysics.collision.narrowphase.ManifoldPoint类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。