Circle Vs Rectangle Collisions (and TransformedView PGEX)

preview_player
Показать описание
Hello! In this video I look at a really simple and accurate way to statically resolve circle vs rectangle collisions. I also introduce the TransformedView olc::PixelGameEngine Extension.

Рекомендации по теме
Комментарии
Автор

0:45 you saying "stop giggling" actually made me laugh for a few minutes and i had to rewind the video to actually hear what you're talking about

herrdingenz
Автор

One lone coder videos motivated to me to start studying coding on my free time and after start high studies of computing. Today was a bad day at studies. Lot of work, to my expectations low qualifications for great effords, incomprehensible teachers... But, see David coding has make me smile and it has remember me why I'm doing this. Thanks OneLoneCoder for all your work

smartito_
Автор

2021 has already been better for me than 2020. I started a new job on January 11 after being unemployed since the beginning of August. I'm a contractor working for GDIT, helping them with a software project they're developing for the US military to help make it easier to avoid friendly fire incidents.

davidfrischknecht
Автор

I really appreciate these videos, thank you

markedagain
Автор

Just when I was working with collisions on my game, wow.

Agus-wpcc
Автор

This is so simple and amazingly powerful! I needed to resolve collisions between spheres and bounding boxes... And I remembered the lone coder had some great trick with the clamp function. I come to search this video and I wasn't disappointed!

It works just fine in 3d (just add the z axis).
I extended it to work with oriented bounding boxes just translating the sphere to be relative to the bounding box origin, and applying the inverted rotation matrix to it.

It worked immediately!
Thank you!

davidequattrocchi
Автор

I stopped suffering when interacting with C ++ and loved it thanks to your channel. I wish you prosperity

TheRussianTourist
Автор

This is what makes this channel so unique and fun. Smart programming with cool little tricks and clever ideas.

lenochw
Автор

Your NES series inspired me to try to write a gameboy emulator having no experience

alexrobertson
Автор

Hi Javid, I've been using this algorithm for collisions in my projects for about a year now, and it's worked wonders! I really appreciate you making these videos!

That said, I encountered some strange behavior a while ago, and after hours of debugging my own code I finally realized the issue actually in this algorithm.
There is an unwanted side effect of sliding along tiles, wherein the circle will round off its position on one axis as if colliding with a corner when moving into an edge where two rectangles meet.

This bug can be reproduced in the web demo:

- Position the circle just below/to the right of the line dividing any two joined rectangles.
- Hold in the axis that moves toward the rectangles and simultaneously tap and release the key that moves negatively in the other axis (left or up).
As long as you keep moving in the direction of the rectangles, you should see the circle slide along the other axis when you tap, but then resolve backward as soon as you release until it stops at the point that the other axis would start rounding a corner.

I'd love some help with this as I'm struggling to find an elegant solution to this issue. Perhaps there isn't one. Thanks again!

basiltermini
Автор

20:24 there's a nasty audio artifact

Mycon
Автор

The absolute mad lad made it run in webGL

BudgiePanic
Автор

Hello, Sorry for the following silly question. Maybe i am wrong here: In the picture at 11:21 N represent the nearest point on the rectangle. So the lengh of N is the lengh between the world origin and this point N. I that case |N| <=R would not give the correct result. Isnt be better to check |P-N| <= R ?
Beside this, nice work. I learnd a lot from your videos!

AlterOssi
Автор

the corner resolution is so satisfying to watch!

Czeckie
Автор

Welcome back, looking forward to hearing more about these PGE updates!

rad_skelly
Автор

i hope you had a good break! i really love these videos

squili
Автор

Awesome, great video Javidx9!! The Pixel Game Engine is getting better and better.

gilleswalther
Автор

Just implemented by myself in Java, and it works like a charm. Thanks for explanation and for the great job !!

lucaxtal
Автор

Great stuff - this is the real start of 2021 :)

tgd
Автор

Looking closely at 0:00 you can see that the video actually starts

ishdx