Handmade Hero»Forums»Code
Simon Anciaux
1337 posts
Day 071 Copy paste error in IsInRectangle
In the IsInRectangle function for rectangle3 you don't test the z coordinate.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
inline bool32
IsInRectangle(rectangle3 Rectangle, v3 Test)
{
    bool32 Result = ((Test.X >= Rectangle.Min.X) &&
                     (Test.Y >= Rectangle.Min.Y) &&
                     (Test.X < Rectangle.Max.X) &&
                     (Test.Y < Rectangle.Max.Y));

    return(Result);
}


And a small question: wouldn't it be good to rename dp and ddp to velocity and acceleration ? I'm never directly sure of which is which and in the last stream you mistook them for each other at some point.
Casey Muratori
801 posts / 1 project
Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.
Day 071 Copy paste error in IsInRectangle
I tend to prefer X, dX and ddX because you end up with a lot of things that have single and double derivatives, not just velocity and acceleration, so it's best to get used to it.

- Casey