这是indexloc提供的服务,不要输入任何密码
Skip to content

yasuda0404/unity3D-nbody-grav

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

N-Body Gravitational Simulator

Basic N-Body Gravitational Simulation in Unity

A few notes -

Any game object with the tag "gravBody" will be considered in calculations (in the Gravity script, which needs to be applied to every object).

If you want to have an object stationary, put it in the scene, add a rigidbody, and tag it with "gravBody" - adjust its mass to fit your needs.

If you want to start an object moving at the beginning of the simulation, add the Initial Force script to an object. Give it a direction vector and a velocity.

The Universal Constant of Gravitation is not used.

Forces are rounded.

Rigidbodies are used for application of forces and mass.

It's far from perfect.

Check it out here: http://pjhodson.com/nbody/web.html

About

Basic N-Body Gravitational Simulation in Unity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 43.3%
  • C# 28.4%
  • HTML 28.3%