I’m making a rolling-ball type game, and I can’t seem to get my sphere-mesh collision code working properly. Currently what I have for the main loop (in regards to collision) is the following: Calculate player acceleration based on input Clamp velocity to avoid clipping Add velocity to position Add acceleration to velocity For each solid object: Check for collision for this object and resolve (how I do this is below) If there were any collisions: Normalize accumulated normal vector (explained below) Slow down ball to account for friction I tried two main methods for resolving collisions, each with their own problems. The first method: For each triangle: If there is a collision: Correct player velocity along normal based on distance Accumulate normal for friction calculations later If velocity perpendicular to surface is above threshold: Rebound ball off surface with damping factor Otherwise, if moving toward surface instead of away: Clear perpendicular velocity The problem with this method is, when I hit a wall, the player will begin to bounce erratically. The collision I’m using to test this looks like this: The second method is similar to the first: Set collision distance accumulator to arbitrarily high value Set triangle index to… Read full this story
- Builder relies on wireless as key tool
- Microsoft fine-tunes Windows 8 Beta with input from users
- NASA’s MAVEN Spacecraft Changes Course To Avoid Collision With Mars Moon Phobos
- Gers and Wolves are on collision course ahead of European draws
- Hadoop and cloud computing: Collision course or happy symbiosis?
- Aussies on England collision course
- Synchronous mesh offers scalability
- Multi-radio design boosts mesh nets
- Loading a Direct3D mesh from a resource
- Ngakoue skipping Jags camp because 'contract not resolved'
How to resolve a sphere-mesh collision? have 289 words, post on gamedev.stackexchange.com at May 16, 2019. This is cached page on GameMax. If you want remove this page, please contact us.