-
Notifications
You must be signed in to change notification settings - Fork 155
Hey there 👋 first post here!
First of all, congrats for maintaining this project ❤️
Context: I am building a lo-poli driving studio app to create and share terrains, tracks, vehicles, the works 💪 ... with physics enabled, off course, and engine simulation based on real data
so far so good! most things are working great: engine idling, drivertain and gearbox ratios, engine choke, engine braking, - and the benchmarks even hit exact! max speeds and approx 0-100 performance 🤩
Screenshot 2024年08月15日 at 16 24 16😬 I am sorry for dumping all these questions here (I am not even sure this is the right place ... Is there a community/discord somewhere?)
Questions:
1) What is the meaning of skidInfo, slipIndo and sliding?
It's hard to tell from the docs and testing it is also hard to make sense of how they jumn betweem 0-1 or NaN ...
2) isInContact is always false in my implementation ... any idea why?
Evertyhing else seems very reactive 👍 but this boolean never changes in my code.
🧪 Wasn't able to reproduce this in raycast_vehicle demo - here, the isInContact seems to be correctly alternate between false and true
I have actually inferred meanwhile if wheel is contact via the rather cryptic wheelInfo.slipInfo === 1 which I guess means _has zero adherence` ... 😬 ... err, maybe?
Anyway, is there an obvious way in which I am misusing vehicle/wheels for isInContact not to work?
3) Do I understand correctly that wheels have no innertia once they are not on the ground?
🧪 I was able to reproduce this in raycast_vehicle demo - here, wheels seem to show deltaRotation === 0 whenever wheelInfo.isInContact === false
4) Do I understand correctly that wheels lock as soon as braking force is bigger than engineForce?
🧪 Able to reproduce this in raycast_vehicle demo .. as soon as you press 'b', 'deltaRotation' drops to zero and the infos go skidInfo: 0.046, sliding: true, slipInfo: 1310.
For now I am controlling it on my side, just updating engineForce and distributing a negative force through the wheels according to my brake balance setup ... and when my sim decides, it sets the brakes to a force superior > engine force and the wheels (or some) do indeed lock on the RaycastVehicle side
Good strategy? Or am I missing something?
5) Why do vehicles seem to struggle uphill?
I am using a heightfield similar to the one in the demos, but the force transfer between vehicle and wheels seem to differ tremendously on the inclination of the terrain
- they benchmark well on flat terrain
- accelerate too fast downhill
- acceleratte like 🐌 uphill
are the rays informing the wheels of constant "collision" with the ascending terrain? and otherwise loosing contact/grip while going down hill?
os it just the effect of gravity? is there a way to dampen it somehow??
or are my engineForce values completely off-the mark (I somehow settled on Kw / 10 , for example -680 of engine braking force in the screenshot)
maybe the following explains some of my issues?
🤔 ... why is deltaRotation negative when the force applied is positive? did I rotate the wheels wrong?
🤔 ... does wheel body mass have any effect? (my tests hint at no, not at all)
🤔... why are wheel collisions disabled wheelBody.collisionFilterGroup = 0; in the examples? I enabled and understood that wheels collide with the vehiclebody, but once I set correct filter/mask everything seems to be work fine collisionFilterGroup: COLLISION_GROUP_VEHICLE_WHEELS, collisionFilterMask: COLLISION_GROUP_TERRAIN but at the same time, nothing changed 😅 so I guess the raycasting does all the job and collisions should definitely be disabled for wheels?
P.S.: anyone interested in the project? get in touch_ 🤗