- Home /
Trajectory Simulation for Carrom game when stricker collided to slam( Coin/Token )
Hello, We are developing a carrom board game and everything is setup properlly but there is one thing that I want to add that is prediction of direction of stricker when stricker get collided with slam( Coin/Token) something like in image attacjed below.
Answer by lodendsg · Feb 13, 2020 at 09:39 AM
Note this is all off the top of my head but should get you going.
If your just looking to calculate the first impact then it should be easy enough. If you did a sphere cast from the stricker current position in the direction its to be pushed then you will get back collision on the first coin hit test that position against the coins root position and the force applied will be in the direction of (coin.origin - collision.point).normalized.
to explain why for clarity v1 - v2 = v3 where v3 is a heading being a vector whose length discribes the distance from 2 to 1 and whoes normalized value is the direction from 2 to 1.
Because your strikers and coins are circles the direction of the point of impact to the origin of the coin that was hit is the tangent of the impact and so is the direction the force will be applied.
As to the amount of force applied that is a bit more complicated but if your just looking to give an expression of the force imparted which is what I would do. Then you can simply calculate the angle between your striker's velocity and the direction you find the coin will move. if angle = 0 then the maximum force will be applied, if it = 90 which is the worst case then the minimal force will be applied ... actually 90 would be 0 as that would not be an impact but you get the idea Max = 0, Min as you approch 90
Your answer
Follow this Question
Related Questions
Show trajectory path a ball will take based on collision 0 Answers
Distribute terrain in zones 3 Answers
What is the best way to prevent a physics object from going through thin colliders? 2 Answers
Show trajectory path a ball will take based on collision 1 Answer
How can I show trajectory of a bouncing ball OnCollisionEnter/OnCollisionExit? 0 Answers