bulletphysics

Ghost objects - bulletphysics

自作多情 提交于 2021-02-07 19:43:34
问题 I'm trying to implement a simple ghost object in bulletphysics, this is how I create the ghost objects: btGhostPairCallback* ghostCall = new btGhostPairCallback(); world->getBroadphase()->getOverlappingPairCache()->setInternalGhostPairCallback(ghostCall); btGhostObject* ghostObj = new btGhostObject(); btCollisionShape* shape = new btBoxShape(btVector3(ofGetWidth()+1000, ofGetHeight()+1000, 50)); ghostObj->setCollisionShape(shape); btTransform trans; trans.setIdentity(); trans.setOrigin

Integrate a Bullet simple demo in Qt

不羁的心 提交于 2020-01-23 11:34:26
问题 I want to integrate a Bullet demo into a Qt application. I am using the Bullet demo example that comes with Bullet, called App_BasicDemo. If I execute this application without Qt, it opens a window and renders very well. So I thought, if I just put this as a QGLWidget, it should do the same thing in a Qt window. But it does not work. In the constructor of my GLWidget, I create the BasicDemo. In initializeGL, I call myinit and initPhysics of the BasicDemo. And finally, in paintGL, I call

Integrate a Bullet simple demo in Qt

放肆的年华 提交于 2020-01-23 11:32:18
问题 I want to integrate a Bullet demo into a Qt application. I am using the Bullet demo example that comes with Bullet, called App_BasicDemo. If I execute this application without Qt, it opens a window and renders very well. So I thought, if I just put this as a QGLWidget, it should do the same thing in a Qt window. But it does not work. In the constructor of my GLWidget, I create the BasicDemo. In initializeGL, I call myinit and initPhysics of the BasicDemo. And finally, in paintGL, I call

How to get the Euler rotation of a rigid body between 0 to 360 in Bullet Physics?

半世苍凉 提交于 2019-12-31 02:29:08
问题 I am currently trying to get the rotation of an object. I am using C++ and Bullet Physics. This is my code: btScalar x, y, z; body[0]->getCenterOfMassTransform().getBasis().getEulerZYX(z, y, x); However, as I rotate the object around clockwise the number I get from the y (y is vertical in Bullet) axis goes from 0 to -90 to 0 to 90 and finally back to 0 for every quarter rotation. It is close but what I need is for it to go all the way from 0 to 360. 回答1: Bullet documentation says: void

Multithreading in BulletPhysics / BulletSharp?

这一生的挚爱 提交于 2019-12-25 01:45:17
问题 Could BulletSharp (or BulletPhysics itself, if you don't know about BulletSharp ) work in multithreading mode? If so, where could I find appropriate settings? (like on/off multithreading, numOfThreads, ...) note: BulletSharp is C# wrapper for BulletPhysics. PS: I know, there is question, but: - there are no comprehensive answer - much water has flown under the bridge since that time - in present-day BulletSharp / BulletPhysics versions I could not find mentioned classes. Thank you for any

jBullet Camera “Holder” Is Not Moving

孤街浪徒 提交于 2019-12-24 15:27:47
问题 I am using jBullet with OpenGL to create a basic game engine. I created two classes named ObjectSurface and ObjectEntity . Basically ObjectSurface's have no mass so they don't move and ObjectEntity's can move by collision or gravity. I created a Camera with an ObjectEntity object named cameraHolder so that it can fall and have collision and all. The problem is that the cameraHolder is supposed to move when the specific WASD key is pressed but it only moves one unit and doesn't move anymore.

How do you control a player character in Bullet Physics?

痞子三分冷 提交于 2019-12-24 00:58:26
问题 I am not sure how you are supposed to control a player character in Bullet. The methods that I read were to use the provided btKinematicCharacterController. I also saw methods that use btDynamicCharacterController from the demos. However, in the manual it is stated that kinematic controller has several outstanding issues. Is this still the preferred path? If so, are there any tutorials or documentations for this? All I found are snippets of code from the demo, and the usage of controllers

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

自作多情 提交于 2019-12-23 01:38:11
问题 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

What does “step” mean in stepSimulation and what do its parameters mean in Bullet Physics?

旧城冷巷雨未停 提交于 2019-12-22 07:20:11
问题 What does the term "STEP" means in bullet physics? What does the function stepSimulation() and its parameters mean? I have read the documentation but i could not get hold of anything. Any valid explanation would be of great help. 回答1: btDynamicsWorld::stepSimulation( btScalar timeStep, int maxSubSteps=1, btScalar fixedTimeStep=btScalar(1.)/btScalar(60.)); timeStep - time passed after last simulation. Internally simulation is done for some internal constant steps. fixedTimeStep fixedTimeStep ~

Bullet Physics Simplest Collision Example

点点圈 提交于 2019-12-21 09:20:11
问题 I'm trying to use Bullet Physics for collision detection only. I don't need it to move any objects for me or handle rendering with callbacks. I just want to update object locations every frame and use it to tell me when I have collisions. To get the simplest example going, I'm trying to find collisions between objects with btBoxShape as their shape. Everything runs fine without crashes or apparent memory leaks, but I get no collisions so I must be making some mistakes somewhere. I'll try to