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

Carts Intersecting Blocks at End Segments #13

Open
pollend opened this issue Oct 26, 2017 · 5 comments
Open

Carts Intersecting Blocks at End Segments #13

pollend opened this issue Oct 26, 2017 · 5 comments
Labels
Type: Bug Issues reporting and PRs fixing problems

Comments

@pollend
Copy link
Member

pollend commented Oct 26, 2017

Carts, When they hit an end segment will pop off and act like a bullet rigid body. The problem is when the end segment leads straight into a block. The cart will pop off the segment and be immediately embedded in the block. This causes the cart to launch back onto the track.

Instead The cart should hit the block at the end of the segment and roll back. This behavior is because Rails Implements its own impulse solver that is separate from Terasology. This means that the cart will only respond to intersections with the world after it leaves the rail segment and changes from a kinematic body to a non-kinematic body.

output

@SkySom SkySom added the Type: Bug Issues reporting and PRs fixing problems label Oct 26, 2017
@eviltak
Copy link
Member

eviltak commented Dec 3, 2017

@pollend May I ask exactly why does Rails use a separate physics system? If we can get Rails to work with Terasology physics, all these problems can be avoided.

@pollend
Copy link
Member Author

pollend commented Dec 3, 2017

I don't think bullet has a way to fix an object onto a track. I've already played around with this pretty exhaustively and just settled on treating cart as a kinematic object and handling the impulses myself. It's not too bad since the impulses are linear in nature.

@eviltak
Copy link
Member

eviltak commented Dec 4, 2017

@pollend I see. You've probably tried these already, but how about constraining the current velocity to (i.e. projecting it onto) the tangent of the rails surface on every update? Or using collidion objects that only collide with the trains as the "barriers" of a track? Just throwing some ideas out there that may work. What do you think?

@pollend
Copy link
Member Author

pollend commented Dec 4, 2017

I've already attempted that with normal bullet. If you look in the legacy branch it does that somewhat. The main issue with this is that bullet can't calculate the impulses properly since you're constantly adjusting them. I also had the problem where the rigidbody becomes desynced from the actual visible model.

@eviltak
Copy link
Member

eviltak commented Dec 4, 2017

Okay, so let's keep the physics system as-is, since you have clearly tested various approaches extensively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issues reporting and PRs fixing problems
Projects
None yet
Development

No branches or pull requests

3 participants