0
\$\begingroup\$

What does the phrase "Kinematic bodies do not react to forces and only collide with dynamic bodies" mean?

Related: I'm always confused by game engine physics explanations

I found this phrase in the love2d documentation: https://love2d.org/wiki/love.physics.newBody

Kinematic bodies do not react to forces and only collide with dynamic bodies.

Since love2d uses Box2D under the hood, I checked the Box2D documentation and found a similar description: https://box2d.org/documentation/md_simulation.html

Kinematic bodies do not collide with other kinematic or static bodies.

I also watched the following lecture: https://cs50.harvard.edu/games/2018/weeks/6/ https://www.youtube.com/watch?v=rVCjeFQrK38&t=1750s

Around the 29-minute mark, you can see an example using kinematic bodies.

enter image description here

In the example, three rotating kinematic bodies appear to collide with a green square, which seems to be a dynamic body. Does this interaction not count as a "collision" in the context of the physics engine? After that, it also collides with the ground (likely a Static Body) and stops.

Unfortunately, the source code link from https://cs50.harvard.edu/games/2018/weeks/6/ is broken, so I cannot try the example myself. I also checked https://github.com/dmalan, but I couldn't find the relevant source code.

Why does it say "Kinematic bodies do not collide with other kinematic or static bodies" when the kinematic and dynamic bodies appear to interact?

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

Charanor's answer to your previous question already covered this point https://gamedev.stackexchange.com/a/212552/174134

However for clarity in the video (you cited above):

  • Dynamic - Green
  • Kinematic - Blue
  • Static - Red

The effect when two objects "interact" depends on their types:

Ob 1 Ob2 Result
Green Green Collide: Both objects velocity is changed
Green Blue Collide: Only Greens velocity is changed
Green Red Collide: Only Greens velocity is changed
Blue Blue No interaction - they just pass through each other
Blue Red No interaction - Blue passes through Red
Red Red Not possible - neither object is moving **

** - If they were initially placed overlapping, there would be no interaction.

You can switch Ob1 and Ob2 columns - the result would be the same (hence I didn't bother with the duplicate lines).

Changing the cited lines:

Kinematic bodies do not react to forces and only collide with dynamic bodies.

Kinematic bodies do not collide with other kinematic or static bodies

To the colors in the video we get:

Blue bodies do not react to forces and only collide with Green bodies.

Blue bodies do not collide with other Blue or Red bodies

The video only shows interactions involving at least one Green body.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .