Search found 33 matches

by PcChip
Tue Aug 07, 2018 1:49 am
Forum: General Bullet Physics Support and Feedback
Topic: btHeightfieldTerrainShape going nuts
Replies: 8
Views: 2993

Re: btHeightfieldTerrainShape going nuts

last time I had crazy jittering and wonky behavior on a heightfield, it turned out I was calling my GenerateTerrain() function twice and it was overwriting memory already allocated to bullet
by PcChip
Sat Jul 21, 2018 2:34 am
Forum: General Bullet Physics Support and Feedback
Topic: Squirrely dynamic bodies resting on flat static surface (video)
Replies: 18
Views: 2487

Re: Squirrely dynamic bodies resting on flat static surface (video)

regarding bullet to opengl, I stole this from a forum somewhere glm::mat4 bulletToGlm(const btTransform& t) { glm::mat4 m(0); const btMatrix3x3& basis = t.getBasis(); // rotation for (int r = 0; r < 3; r++) { for (int c = 0; c < 3; c++) { m[c][r] = basis[r][c]; } } // traslation btVector3 origin = t...
by PcChip
Sat Jul 21, 2018 2:05 am
Forum: General Bullet Physics Support and Feedback
Topic: Is there a lower limit for velocity in Bullet?
Replies: 4
Views: 985

Re: Is there a lower limit for velocity in Bullet?

as far as I know you could also just do this once and be done with it:

Code: Select all

	myRigidBody->setActivationState(DISABLE_DEACTIVATION);
by PcChip
Sat Jul 21, 2018 2:04 am
Forum: General Bullet Physics Support and Feedback
Topic: Squirrely dynamic bodies resting on flat static surface (video)
Replies: 18
Views: 2487

Re: Squirrely dynamic bodies resting on flat static surface (video)

this is how I call stepSimulation (in both my hacky playground project, and my actual hobby game project) simTime = glfwGetTime(); dynamicsWorld->stepSimulation(deltaTime, 20, 1./100); dynamicsWorld->synchronizeMotionStates(); //if I remember correctly this was for the btRaycastVehicle's wheels if (...
by PcChip
Fri Jul 20, 2018 1:39 am
Forum: General Bullet Physics Support and Feedback
Topic: Squirrely dynamic bodies resting on flat static surface (video)
Replies: 18
Views: 2487

Re: Squirrely dynamic bodies resting on flat static surface (video)

I have an "opengl / bullet physics playground" project in visual studio that I try new things in, so the code is very hacky and ugly, but this is what works normally for me: // Build the broadphase //btBroadphaseInterface* broadphase = new btAxisSweep3(btVector3(0,-3,0), btVector3(TERRAIN_SIZE,5,TER...
by PcChip
Thu Jul 19, 2018 2:34 am
Forum: General Bullet Physics Support and Feedback
Topic: how to avoid Ghost Objects with rayTest()
Replies: 7
Views: 1144

Re: how to avoid Ghost Objects with rayTest()

update: above wasn't working so I gave it another shot using your suggestion + the tutorial on bulletphysics.org this is what I'm doing: enum collisionGroups // http://www.bulletphysics.org/mediawiki-1.5.8/index.php/Collision_Filtering { COL_NOTHING = 0, //<Collide with nothing COL_GROUND = BIT(0), ...
by PcChip
Thu Jul 19, 2018 2:23 am
Forum: General Bullet Physics Support and Feedback
Topic: Squirrely dynamic bodies resting on flat static surface (video)
Replies: 18
Views: 2487

Re: Squirrely dynamic bodies resting on flat static surface (video)

try this:

ground:
restitution = 0.0
friction = 1.0

objects:
restitution = 0.3
friction = 0.5

make sure you don't have sleeping disabled for the objects (make sure you did not myRigidBody->setActivationState(DISABLE_DEACTIVATION); )
by PcChip
Tue Jul 17, 2018 1:00 am
Forum: General Bullet Physics Support and Feedback
Topic: how to avoid Ghost Objects with rayTest()
Replies: 7
Views: 1144

Re: how to avoid Ghost Objects with rayTest()

thanks for the mini-tutorial, it's hard to find good understandable info on this I think I've managed to sort it out for now but I will certainly add your example into the comments of my code for later use (I know I'll be back to it soon) - as a point of reference this is my simple little game: http...
by PcChip
Tue Jul 17, 2018 12:08 am
Forum: General Bullet Physics Support and Feedback
Topic: how to avoid Ghost Objects with rayTest()
Replies: 7
Views: 1144

Re: how to avoid Ghost Objects with rayTest()

okay thanks, I'll try to figure this out two questions: - does this mean I now have to set collision groups on everything? never used them before and was hoping for an easy way to do what I want without them. Why is this only happening now that I set the ghost object to be a sensortrigger? - is ther...
by PcChip
Mon Jul 16, 2018 2:05 am
Forum: General Bullet Physics Support and Feedback
Topic: how to avoid Ghost Objects with rayTest()
Replies: 7
Views: 1144

Re: how to avoid Ghost Objects with rayTest()

Thanks for the help - this makes sense -old post removed- Edit: with your help I was able to get rayTest to avoid the trigger ghost object, but now the ghost object is detecting the terrain in its collision manifold! (wasting CPU cycles) any tips on how I can avoid this? this is how I'm doing it now...
by PcChip
Fri Jul 13, 2018 2:38 am
Forum: General Bullet Physics Support and Feedback
Topic: how to avoid Ghost Objects with rayTest()
Replies: 7
Views: 1144

how to avoid Ghost Objects with rayTest()

Hi, I've been reading through documentation and forum posts, and am having trouble figuring out how to do this: some of my units (turrets), have a cylinderShape ghost object around them that I'm using as a trigger to start targeting enemies inside of it This works perfectly, however now when I do a ...
by PcChip
Fri Jul 06, 2018 9:48 pm
Forum: General Bullet Physics Support and Feedback
Topic: Debug draw triangles
Replies: 3
Views: 2276

Re: Debug draw triangles

I'm still very new to this, but an idea comes to mind: in btCollisionWorld.cpp , check out this area: /// for polyhedral shapes if (shape->isPolyhedral()) { btPolyhedralConvexShape* polyshape = (btPolyhedralConvexShape*) shape; int i; if (polyshape->getConvexPolyhedron()) { const btConvexPolyhedron*...
by PcChip
Fri Jul 06, 2018 7:22 pm
Forum: General Bullet Physics Support and Feedback
Topic: Multithreading
Replies: 0
Views: 818

Multithreading

Hi, I'm investigating whether there's a super easy way to have Bullet run multithreaded in my simple game I'm building, I've done investigating and found the following: - Lunkhound forked a version specifically for this around 2014. I see that he is still updating his fork - is this the version to u...
by PcChip
Tue Jun 19, 2018 1:54 am
Forum: General Bullet Physics Support and Feedback
Topic: vehicle wheels falling behind / gravity acting strange
Replies: 3
Views: 4514

Re: vehicle wheels falling behind / gravity acting strange

edit: 7/4/2018 - this post was wrong, so I'm editing this in case any future person is here looking for a fix AFTER you call StepSimulation, and you're ready to draw your vehicle, do the following: vehicle->getRigidBody()->getMotionState()->getWorldTransform(buggyPosition); vehicle->updateWheelTrans...
by PcChip
Tue Jun 12, 2018 12:44 am
Forum: General Bullet Physics Support and Feedback
Topic: Assertion in btConvexShape.cpp
Replies: 3
Views: 1773

Re: Assertion in btConvexShape.cpp

Hi, I know this is an old thread but I'm having the same issue, the strange thing is the behavior of Bullet is seemingly random one time when I run the program, everything will run perfectly the next time, the objects will fall to the ground and start jiggling forever the next time, I'll get this bt...