04-25-2010, 12:11 PM,
|
|
Quote:But we need to make sure that it doesn't break bullets collision detection/resolve.
That's what I would be worried about. There would be 2 physics systems running in parallel and they might not play well together.
Quote:So you propose the wheels to be a part of the car collision shape, but to update/calculate their relative position in VDrift?
Exactly. I'm getting my head around btCompoundShape now, should have the wheels falling off by this evening
|
|
04-25-2010, 12:26 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
On a side note, bullets offers callbacks to hook into any stage of its pipeline. So one could use the pacejka friction model for the wheel contacts(wheels considered to be fixed(part of the body). There is still the issue with suspension force calculation. I am not sure if it is possible to retrieve it from bullets contact solver.
Quote:falling off by this evening
Would love to see some code.
Edit:
Had a look at the code. The tire friction can be passed as a friction constraint(not in the callback). The callbacks won't give you enough information implement the friction, suspension I think. Will look into it.
|
|
04-27-2010, 11:58 AM,
|
|
Quote:Bullet has no problems resolving collisions with flat surfaces like btStaticPlaneShape or a flat mesh.
Was wondering about something when I saw the body was a compound shape, could you stick a flat plane on the bottom of the car?
Nothing happening fast with the suspension but its getting there.
|
|
04-27-2010, 01:44 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
Quote:could you stick a flat plane on the bottom of the car
The current bottom is quite flat(btBoxShape). But I'll try just out of curiosity.
p.s.
There is a global variable gContactBreakingThreshold. I wonder how it influences the hinge suspension? Will do some testing eventually.
|
|
04-27-2010, 01:52 PM,
|
|
Will have a look at that, found quite a bit looking through ODE treads on improving bullets hinges though. m_limitSoftness and m_stopERP in btGeneric6DofConstraint.h are the main ones.
|
|
04-27-2010, 02:06 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
Actually I am busy with other stuff here but ....
http://bulletphysics.org/Bullet/phpBB3/v...ion#p17189
http://bulletphysics.org/Bullet/phpBB3/v...f=9&t=5019
Edit:
The second one is only for angle > pi. Not an issue for us I think.
|
|
04-28-2010, 06:59 AM,
|
|
svn 2695.
First a note on where I have got to. Nowhere. Gone full circle and basically using the same code except using the wheel centres as the btGeneric6DofSpringConstraint. This is giving a rigid linear constraint, not sure how well it will handle axial but looks ok. Going to map geometry onto then from CARDYNAMICS::Update() once I get the typedConstraint callbacks figured out (added them to collision_world, figuring out how to use them).
Will use simple linear suspension to begin with and map suspension and steering geometry onto them later.
Ok. With 2695 the car is hopping around and ends up flipping over. With the joints at the hinge points its ok so it may sort it's self out once the suspension is in.
cheers
|
|
04-28-2010, 11:26 AM,
|
|
Quote:So you have a slider instead of a hinge, right?
Slider for the vertical movement (no static friction ), a rotational axis for the steering and another for the wheel.
Can simulate any suspension geometry with a single 6Dof joint, just using a single slider for now to see how it goes.
|
|
04-29-2010, 03:06 PM,
|
|
CrystalH
Member
|
Posts: 113
Threads: 9
Joined: Feb 2010
|
|
I created a Heightfield in bullet through btHeightfieldTerrainShape. It caused a crash on collision, and this was because m_shapeId isn't defined for all shapes except btTriangleMeshShape (says bullet comment).
Adding this if in MyRayResultCallback::addSingleResult resolved the problem:
Code: if (!rayResult.m_localShapeInfo)
m_shapeId = 0;
else // only for btTriangleMeshShape
m_shapeId = rayResult.m_localShapeInfo->m_shapePart;
This was also the problem with crash on dynamic objects (not the asserts).
I've also found that CAR::GetTireSquealAmount produces squeal sounds while in air and emits particles. (I had funny ribbon trails in air also). By adding this check at beginning resolved the issue:
Code: float d = dynamics.GetWheelContact(WHEEL_POSITION(i)).GetDepth() - GetTireRadius(WHEEL_POSITION(i));
if (d > 1.f || d < 0.f) // not on ground
return 0;
This check could be also somewhere else to not allow driving upside down.
|
|
04-30-2010, 02:23 AM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
Quote:GetTireSquealAmount produces squeal sounds while in air and emits particles
This was a bug in collision world. I've been assigning asphalt surface as default. It has been fixed some time ago.
Quote:m_shapeId isn't defined
Thanks, haven't looked into dynamic objects yet.
|
|
05-03-2010, 07:22 AM,
|
|
Getting on ok with this, albeit very slowly. Have got my head around bullet constraints and have steering and springs working ok, working on dampers and brakes/driving torque at the mo.
Grip calc's where mentioned before, I'm about to head down this road. Planing on using the tyre rigidBody's grip variable to see how it goes, is there anything I should bare in mind?
cheers
|
|
05-03-2010, 01:00 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
Quote:tyre rigidBody's grip variable
Do you mean m_friction? You would have to adjust the value depending on current slip (maybe using CF_CUSTOM_MATERIAL_CALLBACK). But you need the tire normal force(maybe from the suspension constraint) to calculate it. Another problem is the simulation rate. The wheels are simulated with 600Hz now and this is pretty much the minimum rate I think. As we already have problems with low wheel inertia (< 5.0).
I am curious about your constraint setup. Do you mind to check in your code(maybe wrapped into #ifdef _BULLET_).
|
|
|