Math for Game Developers - Bullet Collision (Vector/AABB Intersection)

preview_player
Показать описание
We take a break from character movement this week and look at firing a bullet through our scene with a line/box intersection algorithm.

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

You explained pretty well a concept that is not that easy to grasp at the first sight. Had to watch it a few times. Thank you:)

ryszardsinius
Автор

Oh wow, thank you much I've never found a youtube that explains math that well

ziyadcodes
Автор

I've been watching these on the Youtube iOS app, which doesn't show embedded links, so the update is much appreciated!

Slapworth
Автор

You want the fraction of the line between v0 and f, in other words the percentage of the line that's not touching the box. So you do a part/whole sort of thing, (length not touching the box)/(total length) to get the fraction of the line not touching the box. Does that help?

JorgeVinoRodriguez
Автор

I did it on paper. I was swearing the entire time thinking "this can't be right wtf wtf is this...." when I arrived at the correct solution I could not believe it. This is like casting a magic spell without fully understanding why it works :P

SacrificialGoat
Автор

Thanks for the videos!
the link for the second part is private and I don't have access to him' is there any way to watch it?

EisentoastDaReal
Автор

Ultra mega cool awesome amazing super helpful!!❤

julianaskuratovsky
Автор

I completely lost track after you introduced P's y. Seemed to come out of nowhere.

pablors
Автор

Where you are getting your numbers from.
How did you get the number f=1 at the end of Vector (B)? When you use the numbers 0.1 and 0.5 are those actual coordinate points or are they percentages. Does 0.1 mean position 0.1 on the Y-Axis or 0.1Percent of the line V1 to Vo until the minimum is reached

jeremiahv
Автор

At 4:16 Jorge states that the fraction of the vertical component will be equal to the fraction of the line segment. Could anyone give me some intuition / point me towards a proof that this is true?

adambrown
Автор

what if b is parallel to one side of the rectangle? f.x or f.y = something/0

alberth
Автор

I don't get it, if you need to calculate the I, don't you also need the fx? I think based on your logic it should be kinda like this fx= (Px-V0x)/(V1x-V0x) ?

Digifan
Автор

Hey @Jorge, do you happen to have part 2 video of this section (Bullet Collisions)? The link in the description takes you to a private video and the next in the series is about explosions.

rodmileski
Автор

I split it up into two. There's a link in the video itself to the next video, and I just added a link to the description as well. :) Sry bout that.

JorgeVinoRodriguez
Автор

hold on, i don't get this. At 4.05 you start shading in half of the Y line, but you've only tested with the bottom plane. so shouldn't this only be shading the section between V0 and the lower f ?

What exactly is the value of Py here?

Nanakoglasgow
Автор

Actually you would use a bullet collision detection between the current position of the bullet and its previous position, to know wheter it has collided or not between the last game step and the current one.

premonsa
Автор

How would this apply if your line segment was a ray with a starting point but no end point?

Cromius
Автор

how does the algorithm you used here compare with Cohen-Sutherland?
is it better than CS in this situation, and when/why would we pick on over the other?

jgcooper
Автор

I don't understand where the Py comes from. Is it supposed to represent the blue plane's bottom Y coordinate, formed by the extension of the square? How are you supposed to find it in this context? Are you just using the square's bottom vertex's Y coordinate? What about irregular shaped forms or non rectangular ones? How would that apply then?

DarkGrimmor
Автор

Why B equals V0 minus V1? Not a V1 - V0?

alerzampillo