Created
January 13, 2026 07:57
-
-
Save hovsep/820fd14522e2a6859849ee4eb04d0805 to your computer and use it in GitHub Desktop.
Human body simulation mesh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // getSimulationMesh returns the main mesh of the simulation | |
| func getSimulationMesh() *fmesh.FMesh { | |
| // Set up the world | |
| habitat := env.NewHabitat(component.NewCollection().Add( | |
| factor.GetTimeComponent(), | |
| factor.GetAirComponent(), | |
| factor.GetSunComponent(), | |
| )) | |
| // Add human beings | |
| habitat.AddOrganisms(human.New("Leon")) | |
| // Set up the mesh | |
| habitat.FM.SetupHooks(func(hooks *fmesh.Hooks) { | |
| // Generate a tick signal before each run (time step simulation) | |
| hooks.BeforeRun(func(mesh *fmesh.FMesh) error { | |
| mesh.ComponentByName("time").InputByName("ctl").PutSignals(signal.New("tick")) | |
| return nil | |
| }) | |
| }) | |
| return habitat.FM | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment