Skip to content

A torque-free motion simulator for arbitrarily shaped objects

License

Notifications You must be signed in to change notification settings

jaydeeskinner/free-body_simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

freebody

A class for simulating torque-free motion with high-precision

Usage

local my_body = freebody.new()--Instantiate the object

my_body:set_shape(mat3.new(2, 0, 0, 0, 1, 0, 0, 0, 4), 0.3)--2x1x4 cuboid with 0.3 density
my_body:set_omega(vec3.new(4, 0.01, -0.02))--Spin it!

on_step:connect(function(dt)--Main loop
	my_body:step(dt, 6)--Step the freebody with 8 rotational derivative terms (More terms, better accuracy)
end)

About

A torque-free motion simulator for arbitrarily shaped objects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages