projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added object remove_listener so that you can get a message if some objects are remove...
[supertux.git]
/
lib
/
special
/
collision.cpp
diff --git
a/lib/special/collision.cpp
b/lib/special/collision.cpp
index
b192dc3
..
46ed0bf
100644
(file)
--- a/
lib/special/collision.cpp
+++ b/
lib/special/collision.cpp
@@
-38,7
+38,11
@@
Collision::rectangle_rectangle(CollisionHit& hit, const Rectangle& r1,
hit.normal.y = 0;
} else {
if(movement.y > -DELTA && movement.y < DELTA) {
hit.normal.y = 0;
} else {
if(movement.y > -DELTA && movement.y < DELTA) {
- return false;
+ hit.time = 0;
+ hit.depth = 0;
+ hit.normal.x = 1;
+ hit.normal.y = 0;
+ return true;
}
hit.time = FLT_MAX;
}
}
hit.time = FLT_MAX;
}
@@
-142,7
+146,6
@@
Collision::rectangle_aatriangle(CollisionHit& hit, const Rectangle& rect,
return false;
float time = depth / -(normal * movement);
if(time < hit.time) {
return false;
float time = depth / -(normal * movement);
if(time < hit.time) {
- printf("Time: %f.\n", time);
hit.depth = depth;
hit.time = time;
hit.normal = normal;
hit.depth = depth;
hit.time = time;
hit.normal = normal;