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


Java ConstraintSolver类代码示例

本文整理汇总了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));
}
 
开发者ID:timvisee,项目名称:key-barricade,代码行数:19,代码来源:ScenePhysicsEngine.java

示例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;
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:19,代码来源:DiscreteDynamicsWorld.java

示例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;
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:19,代码来源:DiscreteDynamicsWorld.java

示例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();
}
 
开发者ID:StavrosSkourtis,项目名称:SuperHornet,代码行数:23,代码来源:Screen.java

示例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);
}
 
开发者ID:LapisSea,项目名称:OpenGL-Bullet-engine,代码行数:10,代码来源:PhysicsWorldJbullet.java

示例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;
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:10,代码来源:DiscreteDynamicsWorld.java

示例7: setConstraintSolver

import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver; //导入依赖的package包/类
@Override
public void setConstraintSolver (ConstraintSolver solver) {
	if (ownsConstraintSolver) {
		// btAlignedFree( m_constraintSolver);
	}
	ownsConstraintSolver = false;
	constraintSolver = solver;
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:9,代码来源:DiscreteDynamicsWorld.java

示例8: setConstraintSolver

import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver; //导入依赖的package包/类
@Override
public void setConstraintSolver(ConstraintSolver solver) {
	if (ownsConstraintSolver) {
		//btAlignedFree(m_constraintSolver);
	}

	ownsConstraintSolver = false;
	constraintSolver = solver;
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:10,代码来源:SimpleDynamicsWorld.java

示例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;
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:9,代码来源:DiscreteDynamicsWorld.java

示例10: setConstraintSolver

import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver; //导入依赖的package包/类
@Override
public void setConstraintSolver(ConstraintSolver solver) {
	if (ownsConstraintSolver) {
		//btAlignedFree( m_constraintSolver);
	}
	ownsConstraintSolver = false;
	constraintSolver = solver;
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:9,代码来源:DiscreteDynamicsWorld.java

示例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();
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:38,代码来源:GenericJointDemo.java

示例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();
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:41,代码来源:DynamicControlDemo.java

示例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;
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:9,代码来源:DiscreteDynamicsWorld.java

示例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();
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:39,代码来源:GenericJointDemo.java

示例15: getConstraintSolver

import com.bulletphysics.dynamics.constraintsolver.ConstraintSolver; //导入依赖的package包/类
@Override
public ConstraintSolver getConstraintSolver () {
	return constraintSolver;
}
 
开发者ID:vbousquet,项目名称:libgdx-jbullet,代码行数:5,代码来源:DiscreteDynamicsWorld.java


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