• ### What is your GameDev Story?

#### Archived

This topic is now archived and is closed to further replies.

# collision detection about self-rotating object?

This topic is 5884 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Self-rotating object with speed is zero and angular speed is none zero.So my question is how to deal with angular speed in collision detection?

##### Share on other sites
You don''t need to do anything special. First work out when your objects collide as accurately as possible. Then work out the point of impact between the two objects.

The angular velocity gets included by adding it to the linear velocity of one or both (depending how many are rotating) at the point of impact. The velocity of a point on a moving & rotating body is just

v + w ^ r

Where ''v'' is the linear velocity, ''w'' is the angular velocity and ''r'' is the position of the point relative to the object centre of mass (i.e. relative to the point about which it is rotating).

With these you know the velocity at the point of impact. Use this with other collision properties such as the coeficients of restitution and friction to work out the impulse, i.e. the push that they recieve because of the collision. Apply this to the linear and angular velocity of one or both objects to determine their linear and angular velocities after the impact.

##### Share on other sites
hum ... I think the question was about collision detection, not collision response.

Well, actually I have the same problem and I''m still not sure about the best answer.

here are the solutions I can think of :
-just compute your objet ''s position at the end of the frame, and test to see if it overlaps with another object. If it is not precise enought (when the angular velocity is too big), you may try to make the overlap test at several steps during your frame.( but it still wont be enought if your angular velocity is too hight).
-to deal with hight velocity (one turn or more / frame) you can probably compute a "bounding volume" (maybe an aabb) around your object and test it for overlap

Tang

##### Share on other sites
Perhaps it is too expensive to solve this problem by pure mathematical method...

##### Share on other sites
> Perhaps it is too expensive to solve this problem by pure
> mathematical method...

Not at all. The maths is quite involved, so there are a lot of steps to do to detect the collision and calculate the collision response. But modern machines can do such calculations very quickly, and you generally don''t need to do many such calculations so they can be made complex without slowing down the game too much.

##### Share on other sites
have an article which explains how to compute all this stuff when there is a rotation ?
The only one I found described a method using derivated functions, and I really fear that computing the derivate and searching the 0 would be too slow . (or do you think it would work for a realtime application ?)

Tang

##### Share on other sites
have an article which explains how to compute all this stuff when there is a rotation ?
The only one I found described a method using derivated functions, and I really fear that computing the derivate and searching the 0 would be too slow . (or do you think it would work for a realtime application ?)

Tang

##### Share on other sites
Where is it?I want to have a look.perhaps it could help me to solve this problem.I must solve it!!!

##### Share on other sites
the article was
"intersection of objects with linear and angular velocities using oriented bounding boxes" by David Eberly.

But I still think that this isnt the good way to deal with rotations, unless you need very accurate collisions and have a lot of time to compute it. (the algo seems really slower than the simple no-rotations case, and I dont think it would work in any real-time application)

Tang

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 9
• ### Forum Statistics

• Total Topics
634082
• Total Posts
3015399
×