Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

btRaycastVehicle not syncing position on moving platform #428

Open
ID-Emmett opened this issue Jun 27, 2024 · 1 comment
Open

btRaycastVehicle not syncing position on moving platform #428

ID-Emmett opened this issue Jun 27, 2024 · 1 comment

Comments

@ID-Emmett
Copy link

When using btRaycastVehicle in Ammo.js, the vehicle does not sync its position when placed on a moving platform. It appears that the vehicle's raycasting references the global coordinate system, causing it to stay in place while the platform moves. The vehicle's wheels do not contact the platform directly, which may contribute to this issue. I have ensured that the platform and vehicle are properly initialized. This problem seems to be related to how the raycasting mechanism handles moving bases. Any guidance or solutions would be greatly appreciated.

@suddenly4
Copy link

I suggest the following explanation infact

  1. You can create your own rays and cast them down from an object, not from a rotating element, or from a wheel, but with an update so that the vector looks down locally from wheel, or the body, or globally, as you like.
  2. The ray gives the intersection point, the object, the normal. It is logical that if the object is stationary on another object that is moving, the ray will give the same readings. As if the car were on a tow truck, it is stationary relative to the moving platform. You can make the ray longer and ask for the point of contact not with the first object that comes across, and thereby intersect the tow truck and get the ground, then there will be other data, which is logical. Or if moving on the platform like a capsule along on the train, and get a different intersection point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants