diff options
author | hanemile <hanemile@protonmail.com> | 2018-11-02 23:10:20 +0100 |
---|---|---|
committer | hanemile <hanemile@protonmail.com> | 2018-11-02 23:10:20 +0100 |
commit | dbc75dfc7b01893c1a6a11aee33be37da70d7bae (patch) | |
tree | 9aacbd893970dc667d0918b0d959b851f62f2ff5 /forces | |
parent | ad1e45118682c262862093626468d34ab92d2612 (diff) |
added a TODO: generate an Octree
Diffstat (limited to 'forces')
-rw-r--r-- | forces/forces.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/forces/forces.go b/forces/forces.go index 7130503..d4ded26 100644 --- a/forces/forces.go +++ b/forces/forces.go @@ -1,14 +1,14 @@ package forces import ( - "git.darknebu.la/GalaxySimulator/Source/structs" "fmt" + "git.darknebu.la/GalaxySimulator/Source/structs" "git.darknebu.la/bit/logplus" "gopkg.in/cheggaaa/pb.v1" "math" ) -// forces_acting calculates the force inbetween the two given stars s1 and s2 +// forces_acting calculates the force in between the two given stars s1 and s2 // The function return the force func accelerationActing(s1 structs.Star2D, s2 structs.Star2D) structs.Vec2 { @@ -60,6 +60,15 @@ func accelerationThread(starSlice []structs.Star2D, localRangeStart int, localRa // iterate over the given range for index := localRangeStart; index < localRangeEnd; index++ { + /* + TODO: Genrate an Octree: + In the first step, all the stars are inside of one big cell that is subdivided recursively. + A cell is subdivided as long as none of the exit conditions has been met: + 1. The Cell contains fewer than a given number of stars + 2. The Cell reaches a minimum size + 3. When a maximum number of subdivisions has been reached + */ + // Calculate the acceleration acting inbetween the given star and all other stars var a = accelerations(starSlice, index) |