Search found 11 matches

by betobala
Fri May 31, 2024 6:51 pm
Forum: General
Topic: Help with calculating trajectory
Replies: 12
Views: 1672

Re: Help with calculating trajectory

The double radius ball is in fact what is called the Minkowski addition, in this case of two circles. It's a technique often used to calculate and resolve complex collisions, because it turns the collision between two bodies into the collision between a point and a body. The point turns into a line...
by betobala
Fri May 31, 2024 4:45 am
Forum: General
Topic: Help with calculating trajectory
Replies: 12
Views: 1672

Re: Help with calculating trajectory

Do you think the way I did is going to work? Like im not getting the normal from the ball itself, im getting from a invisible ball that has the double radius of the red ball. Knorke's point that Box2D might cause things to behave in a way that differs from your vector prediction is important. Some ...
by betobala
Fri May 31, 2024 3:28 am
Forum: General
Topic: Help with calculating trajectory
Replies: 12
Views: 1672

Re: Help with calculating trajectory

Thanks everyone, I will try to apply this, hope I get it, I have zero experience calculating vetors
by betobala
Fri May 31, 2024 12:03 am
Forum: General
Topic: Help with calculating trajectory
Replies: 12
Views: 1672

Re: Help with calculating trajectory

... To find the reflected vector, you flip the direction of the incoming vector, project it onto the normal, then get the rejection (the difference between the flipped incoming vector and its projection onto the normal) and add that rejection twice to the flipped incoming vector. This will place yo...
by betobala
Thu May 30, 2024 10:42 pm
Forum: General
Topic: Help with calculating trajectory
Replies: 12
Views: 1672

Re: Help with calculating trajectory

If you don't want to do any of the math, then you can just simulate the shot. Take the table, the cue stick and the balls into an separate physics environment, do the shot there and if the white ball hits any other ball, then you have all the information you need to draw what you want: At the momen...
by betobala
Thu May 30, 2024 10:40 pm
Forum: General
Topic: Help with calculating trajectory
Replies: 12
Views: 1672

Re: Help with calculating trajectory

See if you can work with ChatGPT for it to explain vector reflection for you. You have the incoming vector and it's being reflected on the normal of a surface (like the surface of a ball, or the surface of the boundaries of the table). To find the reflected vector, you flip the direction of the inc...
by betobala
Thu May 30, 2024 3:08 am
Forum: General
Topic: Help with calculating trajectory
Replies: 12
Views: 1672

Help with calculating trajectory

My goal is to do something like this: https://imgur.com/a/o4HaceP This is what a got so far(just the line stopping to draw when detect a ball): https://imgur.com/a/rm8rStf I'm using physics module in balls and table. I don't have idea how to do it, could someone help me? update1: https://imgur.com/a...
by betobala
Fri May 24, 2024 9:26 pm
Forum: General
Topic: [solved] Help with my pool(billiards) game
Replies: 4
Views: 646

Re: Help with my pool(billiards) game

darkfrei wrote: Fri May 24, 2024 8:07 pm
betobala wrote: Fri May 24, 2024 7:59 pm I need to draw the pool cue behind the cue ball, pointing at the mouse position. But I do not know the math to make that happens, can I get some help? :)
Make .love not .rar
sorry about that, its my first time making a game.
by betobala
Fri May 24, 2024 7:59 pm
Forum: General
Topic: [solved] Help with my pool(billiards) game
Replies: 4
Views: 646

[solved] Help with my pool(billiards) game

I need to draw the pool cue behind the cue ball, pointing at the mouse position. But I do not know the math to make that happens, can I get some help? :)
by betobala
Thu May 23, 2024 10:12 pm
Forum: General
Topic: Pool(Billiards) physics (Need help)
Replies: 7
Views: 1293

Re: Pool(Billiards) physics (Need help)

Thanks all, that helped me a lot!