From dbc75dfc7b01893c1a6a11aee33be37da70d7bae Mon Sep 17 00:00:00 2001 From: hanemile Date: Fri, 2 Nov 2018 23:10:20 +0100 Subject: added a TODO: generate an Octree --- forces/forces.go | 13 +++++++++++-- 1 file 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) -- cgit 1.4.1