Toribash
Original Post
[REL] Momentum Visualizer

(Made for Toribash 5.7x)

MomV: Momentum Visualizer v1.0



Hey are you interested in your tori's center of mass (COM) or direction of momentum (DOM)? Well if you're into doms then this is the script for you!


Commands:
/dom : start drawing DOM
/domz : toggle record Z-azis
/domclear : clear DOM line
/com : toggle show COM
/ref : toggle floor reference lines
/ref2 : toggle extra floor reference lines


Showcase:

Fosbury flop demo by jagger700



Tricking demo by me



0-grav test by


How it works:
To find your little guy's center of mass, get each body part's mass by calculating their volume according to their shape, get their positions, then use the COM formula to get our (x,y,z). So it works with modified bodies too but if some body parts use a different density then it'll be inaccurate (get_body_info() doesn't include density?)
Attached Files
momv.lua (5.7 KB, 8 views)
Last edited by miso903; 1 Day Ago at 06:06 PM. Reason: swap imgur gifs cuz uk
Originally Posted by miso903 View Post
So it works with modified bodies too but if some body parts use a different density then it'll be inaccurate (get_body_info() doesn't include density?)


You could read densities from the tbm file.
If density of a body part isn't mentionend in the file, assume density = 0.25 for this body part.
That's how tbm files are read with respect to density, I believe.
Cool script!