Create linear velocity from angular velocity

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By SIsilicon

I am creating a water particle-based physics addon and including rigid body interaction. The problem however is that I have no idea how to take angular velocity into consideration as regular velocity. So if the body was rotating, it would not have an effect on the water particles but stop them in their tracks.

:bust_in_silhouette: Reply From: DrPlamsa

Hello!

I think you want the cross product function. When I wanted to sync a cube to the surface of a rotating asteroid, I did:

cube2.linear_velocity=-(cube2.global_transform.origin-asteroid.global_transform.origin).cross(asteroid.angular_velocity)

Then, the cube’s velocity made it at rest relative to the rotating asteroid’s surface.

I’m talking about in 2D. Cross product doesn’t exist in 2D.

SIsilicon | 2018-07-15 22:22