How I wish I could understand it clearly as you. Im pretty bad at math especially reading a formula and then converting to code. Although I can understand basics of vectors and a little trig. I still coudnt read math signs and formula in your answer. If I can get where the exactly collision takes place and which side, then this will help me a lot. But sadly, its just too foreign for me to read this kind of thing. I really dont understand this following. Might help if you can explain this to me. TY
pb(k) -- I call it Player Ball(Pb) but what is (K) doing there? is it to multiply or something?
:= -- is this some condition on math?
[ -w/2 +h/2 ]T -- what is the T here? Is this the same t? or is it different? and are you denoting this as an exponent? or does it meant something else?
k' -- this I sometimes see a lot the ' thing. What does it meant by this?
I notice about the radius. I guess, this is applied for Bounding-circle collision? I didnt go any complicated, I just use two rectangles(AABB).
pb(k) means a vector (the bold letter) p which denotes a position in space, with an identifying index b (set in subscripted style) denoting that the position is that of the ball, and an independent variable k (written in parentheses) denoting that the position is not constant but varies with k. Due to the conditional 0 <= k <= 1 the value of k is restricted to be between 0 and 1, inclusively. In summary: The position of the ball at moment k is … (whatever is written in the following).
pb(t0) is hence to be read as position of the ball at moment t0. Since we defined that t0 denotes the moment in time at the previous update of the game and t1 denotes the moment in time of the current update, the time t ticked from t0 to t1 in the meanwhile. The normalization formula shown in the former post makes it just a bit easier to deal with this, because when setting t = t0 the normalization gives a value of k = 0, and setting t = t1 gives a value of k = 1. So, while time t ticked from t0 to t1, the equivalent k ticked from 0 to 1. Hence: pb(k) with 0 <= k <= 1 denotes all the positions where the ball was in the time that has elapsed between the previous update and the current update. All those positions form a straight line segment. Of course, the ball was not really there because you have computed only pb(t0) and pb(t1), but the collision impact was somewhere in the interval between t0 and t1 and hence we need to look at all the inbetween positions.
pp(k) is to be read identically to pb(k) but with the identifying index p denoting that this is the varying position of the paddle.
The sign := means that we define the term on the side of the : by the formula on the side of the =, i.e. "a := b + c" is read "a is defined as b plus c". For all practical purposes, it can be used like an equation "a = b + c". It just expresses that another term (here "a") is introduced.
The notion [ a b ]T means a 2D vector with elements a and b, written as a row vector (elements side-by-side) and being transposed (denoted by the superscripted T). A transposed row vector results in a column vector, i.e. the elements are written one over the other. Since side-by-side writing is much simpler to be used with, well, typesetter text, using it with the transpose operator is just for convenience.
The apostrophe is used with many different meanings. In my post it just means "a specific value of k" (here k') to make a distinction to the "a variable value k" (just k).
Using a circle instead of an aligned box is often easier. In the given case, it is definitely easier, and it gives more accurate results at the paddle corners! I suggest you to use it.
Of course, feel free to ask if something isn't clear...