Game Development Community

Will collision detection affected by the moving speed???????????

by Tim Kin Chu · in Torque Game Builder · 04/11/2006 (7:36 pm) · 10 replies

Will collision detection affected by the moving speed????????????

when one object moving in high speed......
the collision detection callback will be called when the two object OVERLAP.

If the object move slower,callback will be called when the objects TOUCH.

how can I solve this??????????

#1
04/12/2006 (6:04 am)
That should not be the case unless you've exposed a bug. All collisions are swept meaning that if you move an object around using its own velocity (not repositioning it), it should not overlap other objects. Of course, this assumes that there is a valid collision response that stops it from colliding.

- Melv.

EDIT: Typo.
#2
04/12/2006 (8:11 am)
Just to second Melv's statement and make it even clearer: you must move objects using the functions that controls its velocity, like setLinearVelocity or setLinearVelocityPolar, or applying forces if you want collisions to work properly. If you are moving the objects yourself, by calling setPosition, then you will only learn about collisions after they've occurred.
#3
04/26/2006 (8:41 pm)
I use setLinearVelocity() to test it again.
It also have the problem.
The "t2dSceneObject::onCollision" call when the object overlap.!!!
not touch

I use setLinearVelocityPolar() to move it before.

plx help~
#4
05/16/2006 (8:25 am)
@Tim Kin Chu

did you solve the problem?? I've got a similar problem sometimes, but don't know if it's a mistake by me or the engine.
#5
05/17/2006 (9:37 am)
Problem still exists, yet there is no pattern to predict when that happens. Will it be possibly a bug?
Please, will someone look into it?
#6
05/17/2006 (11:02 am)
Any chance for a code showing the problem?
Perhaps its only a setup problem
#7
05/17/2006 (1:22 pm)
I think it has something to do with "application-lagging". I mean, if my computer has nothing to do in the background everything is fine but if I the game laggs somehow the collision will not be correct sometimes... maybe it has something do with the velocity/movement calculating 'cause in laggy situation the player/object will gets moved more than in "usual" speed.....

hm... hope my english wasn't that bad now
#8
05/17/2006 (2:06 pm)
That shouldn't happen, at least if you didn't set the physic update rate too high.
#9
05/17/2006 (3:08 pm)
Hhmm... I didn't change anything physics-related.... maybe I should lower the default rate ?
#10
06/05/2009 (9:11 pm)
I know this is old but it sounds like Tim might not have edited the objects collision polygon.

If anyone else is having a similar problem, double check that your collision polygon encompasses your entire object.