本文整理汇总了Java中com.bulletphysics.dynamics.constraintsolver.ConstraintSolver类的典型用法代码示例。如果您正苦于以下问题:Java ConstraintSolver类的具体用法?Java ConstraintSolver怎么用?Java ConstraintSolver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConstraintSolver类属于com.bulletphysics.dynamics.constraintsolver包,在下文中一共展示了ConstraintSolver类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver; //导入依赖的package包/类
/**
* Set up the physics engine for the scene.
*/
public void setUp() {
// Create a DBVT broadphase to broadly check collisions using the AABB technique which ensures good performance
BroadphaseInterface broadphase = new DbvtBroadphase();
// Set up a collision configuration and dispatcher
CollisionConfiguration collisionConfig = new DefaultCollisionConfiguration();
CollisionDispatcher dispatcher = new CollisionDispatcher(collisionConfig);
// Configure a constraint solver
ConstraintSolver solver = new SequentialImpulseConstraintSolver();
// Create and configure the Bullet physics dynamic world
this.bulletDynamicsWorld = new DiscreteDynamicsWorld(dispatcher, broadphase, solver, collisionConfig);
this.bulletDynamicsWorld.setGravity(new Vector3f(0, -9.81f, 0));
}
示例2: DiscreteDynamicsWorld
import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver; //导入依赖的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.dynamics.constraintsolver.ConstraintSolver; //导入依赖的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: Screen
import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver; //导入依赖的package包/类
public Screen() {
/*
Set the color to black
*/
glClearColor(0, 0, 0, 1);
BroadphaseInterface broadphase = new DbvtBroadphase();
CollisionConfiguration collisionConfiguration = new DefaultCollisionConfiguration();
CollisionDispatcher dispatcher = new CollisionDispatcher(collisionConfiguration);
ConstraintSolver solver = new SequentialImpulseConstraintSolver();
physicsWorld = new DiscreteDynamicsWorld(dispatcher, broadphase, solver, collisionConfiguration);
physicsWorld.setGravity(new Vector3f(0, -10 /* m/s2 */, 0));
/*
initialize the entities list
*/
entities = new LinkedList<>();
camera = new Camera(1280, 720, 67f, 0.1f, 1000000000000f);
//call the create method
create();
}
示例5: PhysicsWorldJbullet
import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver; //导入依赖的package包/类
public PhysicsWorldJbullet(){
BroadphaseInterface broadphase=new DbvtBroadphase();
CollisionConfiguration collisionConfiguration=new DefaultCollisionConfiguration();
CollisionDispatcher dispatcher=new CollisionDispatcher(collisionConfiguration);
ConstraintSolver constraintSolver=new SequentialImpulseConstraintSolver();
bulletWorld=new DiscreteDynamicsWorld(dispatcher, broadphase, constraintSolver, collisionConfiguration);
setGravity(0, -9.81F, 0);
}
示例6: init
import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver; //导入依赖的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;
}
示例7: setConstraintSolver
import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver; //导入依赖的package包/类
@Override
public void setConstraintSolver (ConstraintSolver solver) {
if (ownsConstraintSolver) {
// btAlignedFree( m_constraintSolver);
}
ownsConstraintSolver = false;
constraintSolver = solver;
}
示例8: setConstraintSolver
import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver; //导入依赖的package包/类
@Override
public void setConstraintSolver(ConstraintSolver solver) {
if (ownsConstraintSolver) {
//btAlignedFree(m_constraintSolver);
}
ownsConstraintSolver = false;
constraintSolver = solver;
}
示例9: init
import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver; //导入依赖的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;
}
示例10: setConstraintSolver
import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver; //导入依赖的package包/类
@Override
public void setConstraintSolver(ConstraintSolver solver) {
if (ownsConstraintSolver) {
//btAlignedFree( m_constraintSolver);
}
ownsConstraintSolver = false;
constraintSolver = solver;
}
示例11: initPhysics
import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver; //导入依赖的package包/类
public void initPhysics() {
// Setup the basic world
DefaultCollisionConfiguration collision_config = new DefaultCollisionConfiguration();
CollisionDispatcher dispatcher = new CollisionDispatcher(collision_config);
Vector3f worldAabbMin = new Vector3f(-10000, -10000, -10000);
Vector3f worldAabbMax = new Vector3f(10000, 10000, 10000);
BroadphaseInterface overlappingPairCache = new AxisSweep3(worldAabbMin, worldAabbMax);
//BroadphaseInterface overlappingPairCache = new SimpleBroadphase();
//#ifdef USE_ODE_QUICKSTEP
//btConstraintSolver* constraintSolver = new OdeConstraintSolver();
//#else
ConstraintSolver constraintSolver = new SequentialImpulseConstraintSolver();
//#endif
dynamicsWorld = new DiscreteDynamicsWorld(dispatcher, overlappingPairCache, constraintSolver, collision_config);
dynamicsWorld.setGravity(new Vector3f(0f, -30f, 0f));
dynamicsWorld.setDebugDrawer(new GLDebugDrawer(gl));
// Setup a big ground box
{
CollisionShape groundShape = new BoxShape(new Vector3f(200f, 10f, 200f));
Transform groundTransform = new Transform();
groundTransform.setIdentity();
groundTransform.origin.set(0f, -15f, 0f);
localCreateRigidBody(0f, groundTransform, groundShape);
}
// Spawn one ragdoll
spawnRagdoll();
clientResetScene();
}
示例12: initPhysics
import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver; //导入依赖的package包/类
public void initPhysics() {
// Setup the basic world
time = 0.0f;
cyclePeriod = 2000.0f; // in milliseconds
muscleStrength = 0.05f;
setCameraDistance(5.0f);
DefaultCollisionConfiguration collision_config = new DefaultCollisionConfiguration();
CollisionDispatcher dispatcher = new CollisionDispatcher(collision_config);
Vector3f worldAabbMin = new Vector3f(-10000,-10000,-10000);
Vector3f worldAabbMax = new Vector3f(10000,10000,10000);
BroadphaseInterface overlappingPairCache = new AxisSweep3(worldAabbMin, worldAabbMax);
//BroadphaseInterface overlappingPairCache = new SimpleBroadphase();
ConstraintSolver constraintSolver = new SequentialImpulseConstraintSolver();
dynamicsWorld = new DiscreteDynamicsWorld(dispatcher, overlappingPairCache, constraintSolver, collision_config);
// Setup a big ground box
{
CollisionShape groundShape = new BoxShape(new Vector3f(200f, 10f, 200f));
// TODO
//m_collisionShapes.push_back(groundShape);
Transform groundTransform = new Transform();
groundTransform.setIdentity();
groundTransform.origin.set(0f, -10f, 0f);
localCreateRigidBody(0f, groundTransform, groundShape);
}
// Spawn one TestRig
Vector3f startOffset = new Vector3f(1.0f, 0.5f, 0.0f);
spawnTestRig(startOffset, false);
startOffset.set(-2.0f, 0.5f, 0.0f);
spawnTestRig(startOffset, true);
clientResetScene();
}
示例13: init
import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver; //导入依赖的package包/类
public void init(ContactSolverInfo solverInfo, ConstraintSolver solver, List<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;
}
示例14: initPhysics
import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver; //导入依赖的package包/类
public void initPhysics() {
// Setup the basic world
DefaultCollisionConfiguration collision_config = new DefaultCollisionConfiguration();
CollisionDispatcher dispatcher = new CollisionDispatcher(collision_config);
Vector3f worldAabbMin = new Vector3f(-10000, -10000, -10000);
Vector3f worldAabbMax = new Vector3f(10000, 10000, 10000);
//BroadphaseInterface overlappingPairCache = new AxisSweep3(worldAabbMin, worldAabbMax);
//BroadphaseInterface overlappingPairCache = new SimpleBroadphase();
BroadphaseInterface overlappingPairCache = new DbvtBroadphase();
//#ifdef USE_ODE_QUICKSTEP
//btConstraintSolver* constraintSolver = new OdeConstraintSolver();
//#else
ConstraintSolver constraintSolver = new SequentialImpulseConstraintSolver();
//#endif
dynamicsWorld = new DiscreteDynamicsWorld(dispatcher, overlappingPairCache, constraintSolver, collision_config);
dynamicsWorld.setGravity(new Vector3f(0f, -30f, 0f));
dynamicsWorld.setDebugDrawer(new GLDebugDrawer(gl));
// Setup a big ground box
{
CollisionShape groundShape = new BoxShape(new Vector3f(200f, 10f, 200f));
Transform groundTransform = new Transform();
groundTransform.setIdentity();
groundTransform.origin.set(0f, -15f, 0f);
localCreateRigidBody(0f, groundTransform, groundShape);
}
// Spawn one ragdoll
spawnRagdoll();
clientResetScene();
}
示例15: getConstraintSolver
import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver; //导入依赖的package包/类
@Override
public ConstraintSolver getConstraintSolver () {
return constraintSolver;
}