idmillington / cyclone-physics

The Physics engine that accompanies the book "Game Physics Engine Design"
MIT License
931 stars 262 forks source link

how to find angular velocity #46

Closed xwc2021 closed 2 years ago

xwc2021 commented 7 years ago

I see code use this form to cauculate w

w =angular Velocity in world space τ = torque in world space α = angular Acceleration in world space

I = R local_I R^-1 τ = I α w = w + αΔt (when no τ , then no change of w)

I think this is Because when the object is not deformed, the "local_I" will not change. But I find that on wiki (L =angular momentum) L =I w , τ=ΔL/Δt

so if "I" is const, then τ=ΔL/Δt τ=Δ(Iw)/Δt τ=IΔ(w)/Δt τ= I α but "I = R local_I R^-1" varies every frame, "I" is not const. Is this because in one frame,we can considered "I" is const ? (Problem 1)

And my question is why not using the form / ΔL = Δt τ L = L+ΔL L = I w (when no τ, w may be diffrent because of I is not a const)

is this because this form make "w" not change continually ? (Problem 2)

xwc2021 commented 2 years ago

I know the answer of problem 1. 😆 In local space "I" is const, so τ= I α is correct. On the other word, global space I is "R local_I R^-1".