Skip to main content
11 votes
Accepted

How to create shockwave of objects in other shapes than circle?

To maintain the shape while spreading, each bullet needs to have a different speed. Suppose you are going to create a "wave" of bullets originating from a centerpoint, what you need to do is to ...
Felsir's user avatar
  • 4,067
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.3k
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
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
  • 135k
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

Gravity too weak

Let's do a bit of math to see if this is correct or not. Your box starts at ŷ = 100m, lets assume it has to travel exactly -100m ...
NaCl's user avatar
  • 131
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

Gravity too weak

After taking a much much much closer look at my code I have managed to find the bug! I had two problems. Problem 1, And I can't believe I missed this. In the base class of my object there was a ...
Paul Spain'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

Detect collision with bullet physics, to make a character controller

Ok so in ...
djofriend's user avatar
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

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
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
  • 14.9k
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,729
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.3k
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

Bullet: No Bouncing off the walls

It's possible the player object moves into a wall and the position is updated, then collision is detected and the players position is then corrected creating a "bouncing" effect. To correct this, ...
user3730788's user avatar
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,729
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

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,729
1 vote

What torque should I apply in Bullet to maintain a vertical orientation?

The accepted answer works for me and is a good starting point. It might be helpful to have a complete example that works with the most recent Bullet version. ...
Qwiff's user avatar
  • 11
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
  • 14.9k
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

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