I am making a game with box2d in which a player can fall through a platform under certain conditions (pressing down and being on a specific type of platform). My static object is a straight line created with an edge shape/chain shape. My dynamic box is the player. I am using the collision points between the dynamic box and the line for another calculation as the player falls through the platform. However, I am getting what seem to be imprecise collision points.
Say the platform has a y position of 78 units. When the box is resting on the platform its collision points (there are 2 but I'll only worry about the y value) have a y value of 77.9925. I feel that this is an understandable measurement, but then as the player falls through the platform, I get the following numbers (frame by frame as the player falls).
78.0092
78.0425
78.1592
78.2425
78.3425
77.7092
77.8425
by this time the player has passed the line and there are no more collisions. Because all of the collisions have to take place somewhere on the line, I would assume that all of the y values would be at 78 or at least extremely close to 78 during every collision. I'm a bit confused because a third of a unit (im using 64x64 pixel tiles) seems like a big error window. There are no other objects around to mess with the collision detection, so I'm not sure what's going on. Help?
Say the platform has a y position of 78 units. When the box is resting on the platform its collision points (there are 2 but I'll only worry about the y value) have a y value of 77.9925. I feel that this is an understandable measurement, but then as the player falls through the platform, I get the following numbers (frame by frame as the player falls).
78.0092
78.0425
78.1592
78.2425
78.3425
77.7092
77.8425
by this time the player has passed the line and there are no more collisions. Because all of the collisions have to take place somewhere on the line, I would assume that all of the y values would be at 78 or at least extremely close to 78 during every collision. I'm a bit confused because a third of a unit (im using 64x64 pixel tiles) seems like a big error window. There are no other objects around to mess with the collision detection, so I'm not sure what's going on. Help?