Skip to main content
4 votes
Accepted

Build a convex hull from a given mesh in Bullet

You can do it using btConvexHullShape, calling the addPoint method. But that's usually not what you want. You should manually ...
xissburg's user avatar
  • 156
4 votes
Accepted

Graphical mesh lags behind collision shape in BulletPhysics debug drawing

Note that this answer could be more complete, but, as I'm not a Bullet/physics engine guru, and that I'm not able to easily set up a project right now, I did not have the chance to try and debug the ...
Vaillancourt's user avatar
  • 16.4k
3 votes
Accepted

Bullet Physics Integration - direct movement of rigid bodies

My usual approach here — and one I've seen work well in VR and motion controlled games too — is to compute a velocity that will bring the previous position of the object's physics body to the desired ...
DMGregory's user avatar
  • 136k
3 votes
Accepted

Integrating Bullet3 into a C++ project - Linking to libraries

After looking further into the differences between the Bullet libraries and my own project turns out the runtime libraries were different. Multi-threaded Debug (/MTd) is the default after building ...
dlp_dev's user avatar
  • 61
3 votes
Accepted

Bullet Spray RNG

This is a question of game balance and feel, so existence of an 'industry standard' is unlikely. If you're trying to somewhat approximate real-world projectile spray patterns, a normal distribution ...
Chris Mills-Price's user avatar
3 votes

Bullet 3D Physics Objects Not Rotating?

Your problem is that you're not supplying an inertia vector in the btRigidBodyConstructionInfo constructor. Your rigid body dynamic spheres end up with a default ...
OctoBlob's user avatar
2 votes
Accepted

Bullet Physics too many rigid bodies framerate drops

Apparently, the Debug Drawer i was using was responsible for the performance Issues. When it is turned off, everything is working as expected.
Anima's user avatar
  • 155
2 votes
Accepted

Rifle bullets/projectiles in Unity, raycasting or rigidbody?

A simple raycasting would be instantaneous. This is usually referred to as Hitscan. A simple example would be in Doom, some weapons and enemies hit immediately while others can be dodged after they ...
CLo's user avatar
  • 1,330
2 votes

Detect collision with bullet physics, to make a character controller

Ok so in ...
djofriend's user avatar
2 votes

PyBullet & OpenGL - Rotations are reversed in OpenGL

It turns out that the above code is correct. The issue resided in the OpennGL shader, where I forgot that matrix calculations are non commutive, i.e. ...
Ed Adcock's user avatar
1 vote

How to detect all vertices within collision Area?

I am by no means a Blender or collision expert but I assume you have access to internal code of Blender https://github.com/blender/blender , I believe what you are trying to achieve needs calculations ...
Candid Moon _Max_'s user avatar
1 vote
Accepted

Simulation step size in a physics engine

To close this question I will take what Vaillancourt said in the comment. This article perfectly describes how to handle physics steps. And to clarify my other question whether we interpolate between ...
Vít Gardoň's user avatar
1 vote
Accepted

How to move a player on a sphere surface using Ammo.js and Three,js

The character's rigid body is missing angular damping which is causing the spinning to occur. Calling setDamping on the character's rigidbody with value greater ...
Eturcim's user avatar
  • 141
1 vote

Can't get basic example working with Bullet 3 (haxebullet port)

Setting mass for static ground to 0 ...
Janis Taranda's user avatar
1 vote
Accepted

Angle between character and mouse, and giving bullets velocity in the correct direction

To inverse the spawn point and other useful methods: ...
Bartimaeus's user avatar
1 vote

Soft Body rendering from OBJ model

You can't mix immediate mode (glBegin, glEnd, etc.) with the programmable pipeline (shaders) like this. You either need to stick ...
Bálint's user avatar
  • 15k
1 vote
Accepted

Should your world map have it's own collision object?

Generating collision from the mesh itself is the usual approach for terrain. This is especially not a performance issue on counter strike-sized maps, as long as you keep the vert density at a somewhat ...
CourageousPotato's user avatar
1 vote

Body inside other body after collision

The issue you are describing is known as 'tunneling.' By far the easiest way to fix this is to take smaller physics steps. If you render at 60FPS, don't step through the simulation with 16.7ms. ...
Bram's user avatar
  • 3,734
1 vote

How to access coordinates of objects in bullet physics (libGDX)?

Note that this is only from reading the doc. I haven't actually tested anything of it. For some reasons, it appears that Bullet Physics uses the term "origin" for "translation". I guess that once ...
Vaillancourt's user avatar
  • 16.4k
1 vote

How do I create a HeightField in pybullet?

There are a few ways to load a heightfield based collision shape in PyBullet: manually: by mathematically creating the height field array from CSV: loading a csv with the height field information ...
avgJoe's user avatar
  • 111
1 vote

Having trouble with btGeometryUtil::isPointInsidePlanes

It turns out I had a fundamental misunderstanding of the purpose of the "isPointInsidePlanes" function. It is not checking whether the point lies on every plane. It is checking whether the point is ...
Tom Sweeney's user avatar
1 vote
Accepted

Eliminate 0.25 unit 'force fields' around Bullet Physics soft bodies

Look at btCollisionShape.h All shapes have a setMargin() method. virtual void setMargin(btScalar margin); Don't set it to zero though, the manual warns against ...
Bram's user avatar
  • 3,734
1 vote
Accepted

Get GameObject which instantiated me in Unity

You must attach a script to the prefab you instantiate and "inject" a reference of the gameobject which has instantiated the prefab as follow : ...
Hellium's user avatar
  • 2,949
1 vote
Accepted

Bullet: btCollisionWorld::contactTest doesn't work

Found the reason: sphere->setWorldTransform(btTransform(btQuaternion(), center)); set the sphere with a invalid transform, therefore no collision can be detect....
kkpattern's user avatar
  • 111
1 vote

Best practice for RTS accuracy/aim

It really depends on the scale of your game, calculating hit detection can be very expensive if you have a game with units on the scale of a total war kind of game, where you may have hundreds of ...
benh's user avatar
  • 581
1 vote

Best practice for RTS accuracy/aim

You should create a parametrical equation. Map each variable (weapon accuracy, stamina, etc.) between 1 and 0, then multiply each value with a weight (if a lower stamina causes lower precision aim ...
Bálint's user avatar
  • 15k
1 vote

Calculate damage values from bullet velocity and size

You could change your calculation to make it more fair. That is just trial and error until you are pleased. What are the properties common to weapons you want to reduce? If you realize bullet size ...
realUser404's user avatar
  • 1,057
1 vote

Calculate damage values from bullet velocity and size

AKs and M4s are very strong. If you've ever played with an FPS like COD, then you know that you can't really do anything useful against a person with a higher end weapon using a pistol. To balance ...
Bálint's user avatar
  • 15k
1 vote

Understanding HingeConstraint in jBullet

When I ported from OpenDE to Bullet, I was puzzled about this as well. I asked on the forum, and the author answered. In Bullet you can initialize a Hinge constraint that is in a unsatisfied ...
Bram's user avatar
  • 3,734

Only top scored, non community-wiki answers of a minimum length are eligible