bulletphysics

Avoid ground collision with Bullet

给你一囗甜甜゛ 提交于 2019-12-17 22:37:44
问题 I'm trying to use Bullet physic engine to create a 3D world. I've got my character with a Capsule shape on his body and my ground his made of some static blocs stick together, here is a schema to illustrate my words: The problem is present when my character run from one block to another: Bullet detect a collision and my character start to jump a little bit on y-axis. How can I avoid the problem? 回答1: What I did to overcome this issue is the following: Instead of have the capsule slide on the

How to apply rotation to a body in Bullet Physics Engine?

烈酒焚心 提交于 2019-12-14 01:21:22
问题 I have rotation values (roll, pitch, yaw). I would like to apply that rotation to a body, but I have no idea how to do that. 回答1: The most straightforward way would be to directly set the world transform for a rigid body, either through a motion state or by direct setting. To get a transform from roll, pitch, and yaw, you could use: btRigidBody * rigidBody = //... btTransform tr; tr.setIdentity(); btQuaternion quat; quat.setEuler(yaw,pitch,roll); //or quat.setEulerZYX depending on the

Few rigidbody cause Bullet Physics slowly

时光怂恿深爱的人放手 提交于 2019-12-13 16:17:17
问题 I'm currently doing the job for intergrating physics engine, Bullet Physics, into my graphics engine, Before that, I implemented the easy collision system with SAP and Narrowphase algorithm, the cost of time was 3ms for SAP and Narrowphase with about 300 objects. Because of some bugs of my algorithm, I decided to change to the real physics engine, Bullet Physics. So I followed the tutorial by official articles. When I thought I know how to implement in my graphics engine, and the output

Compiling Bullet physics and Boost together as static libraries

落花浮王杯 提交于 2019-12-13 05:51:45
问题 I develop addons for a space flight simulator called Orbiter: http://orbit.medphys.ucl.ac.uk/ It accepts plugins as dll files. I recently made a plugin which uses the Bullet physics library as well. Its statically linked to the dll, so the bullet library is itself not a dll but compiled right into the plugin. Bullet is compiled with Multi-threaded (/MT) option for the release and Multi-threaded Debug (/MTd) for debug Now I want to use threads from Boost. So I installed the static Boost

How do I get bulletphysics/bulletsharps' multithreading working?

百般思念 提交于 2019-12-12 12:41:12
问题 That is to say, what is the minimum set of code I need to set up the BulletSharp physics engine wrappers' "DynamicsWorld" to use "BulletSharp.MultiThreaded.ParallelConstraintSolver"? Alternately, I could probably work it out from the same set of code for the BulletPhysics engine itself. If I have not phrased the right question, I would appreciate clarification; I only started using it today. (Yes, I have written a quick program using the standard classes). BulletPhysics is a C++ library; the

JOGL Jar runs fine on my development machine, but slowly on others? Even if they have better hardware

久未见 提交于 2019-12-11 19:30:09
问题 I am currently messing around with JOGL and JBullet with some success. I'd like to share what I've created with my friends. I created a jar file and a .bat to open it with the argument -Dsun.java2d.noddraw=true. The jar runs perfectly on my machine. It opens and runs on my friends system and my laptop, but at an extremely low frame rate. What is the cause of this and how can I fix it? Also for some reason it loads the wrong textures for some objects, again only when ran on another system.

Converting yaw Euler angles in range [-90, 90] to [0, 360]

时光总嘲笑我的痴心妄想 提交于 2019-12-11 03:11:47
问题 Is it possible to convert the yaw Euler angle got from the Bullet physics engine using btTransform trans; trans.getBasis().getEulerYPR(rx, ry, rz); into the range [0 , 360]. Otherwise for a 360 deg rotation I get the Euler angle varying from 0->90->0-> -90 -> 0 but I want from 0->90->180->270->0 My graphics API only accepts rotation angles in the range of 0 to 360 Well, the 0->90->0-> -90 was the pitch value. Here is the code I use now : trans.getBasis().getEulerYPR(yaw, pitch, roll); y1 =

Relative gravity

随声附和 提交于 2019-12-09 16:39:16
问题 I've started using jMonkey engine recently, which is very nice. But I got stuck trying to implement relative gravity. I want to make planets orbiting around each other (not necessarily in perfectly circular orbit, depends on velocity). So every object should affect other objects. What I have right now: turning off global gravity bulletAppState.getPhysicsSpace().setGravity(Vector3f.ZERO); initializing spheres and adding to physics space Sphere sphere = new Sphere(50, 50, 5); Geometry sun = new

Rigid body (shape) in bullet/ammo.js from a mesh in three.js

寵の児 提交于 2019-12-08 05:10:30
I am using bullet/ammo.js with three.js. I have a 3d mesh and I want to use the exact shape for collision detection with a soft body. Is there a way I can create a 3d rigid body (in bullet) from a mesh (in three.js)? Here is an example: http://kidzinski.com/miamisura/lazy3d/ (please wait a second for the 3d model to download). I have a cloth falling on a 3d body and I need to simulate collision of this cloth with the body. I am new to these frameworks sorry if I fundamentally misunderstood something. It looks like you can do some work to turn an arbitrary Three.js mesh into a Bullet concave

Bouncing ball in Bullet

大城市里の小女人 提交于 2019-12-08 03:05:48
问题 I have two questions with regards to Bullet, but they are related. In the HelloWorldApp, the objective is to get a ball bouncing on a box right? If I wanted to test a plane, could I just add in a btCollisionObject with a btStaticPlaneShape instead of the box? How can I set custom restitution, static and kinetic friction per object? 回答1: Yes, I believe that should be correct Restitution and friction can be set per object by supplying them to the btRigidBodyConstructionInfo object passed into