about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhanemile <hanemile@protonmail.com>2018-12-14 15:55:48 +0100
committerhanemile <hanemile@protonmail.com>2018-12-14 15:55:48 +0100
commitfd0ffc82ec36d021669e1bbf10f74bfc3822dd57 (patch)
tree193a6c947f8b382a39b9d05e3a1d4ffef940f067
parent55e9523833ebf404a7bd484e1c5fcbf3e651e466 (diff)
updated stuff...
-rw-r--r--boundingBox.go4
-rw-r--r--star.go4
-rw-r--r--vector2D.go4
3 files changed, 8 insertions, 4 deletions
diff --git a/boundingBox.go b/boundingBox.go
index 4e9bf7d..6cf60c4 100644
--- a/boundingBox.go
+++ b/boundingBox.go
@@ -6,6 +6,6 @@ type BoundingBox struct {
 	Width  float64 // Width of the box
 }
 
-func NewBoundingBox(center Vec2, width float64) *BoundingBox {
-	return &BoundingBox{Center: center, Width: width}
+func NewBoundingBox(center Vec2, width float64) BoundingBox {
+	return BoundingBox{Center: center, Width: width}
 }
diff --git a/star.go b/star.go
index 2255a69..3a7f66e 100644
--- a/star.go
+++ b/star.go
@@ -7,6 +7,10 @@ type Star2D struct {
 	M float64 // mass        of the star
 }
 
+func NewStar2D(c Vec2, v Vec2, m float64) Star2D {
+	return Star2D{C: c, V: v, M: m}
+}
+
 // InsideOf is a method that tests if the star it is applied on is in or outside of the given
 // BoundingBox. It returns true if the star is inside of the BoundingBox and false if it isn't.
 func (s Star2D) InsideOf(boundary BoundingBox) bool {
diff --git a/vector2D.go b/vector2D.go
index 6beedb2..2b95a72 100644
--- a/vector2D.go
+++ b/vector2D.go
@@ -9,8 +9,8 @@ type Vec2 struct {
 }
 
 // newVec2 returns a new Vec2 using the given coordinates
-func newVec2(x float64, y float64) *Vec2 {
-	return &Vec2{
+func NewVec2(x float64, y float64) Vec2 {
+	return Vec2{
 		X: x,
 		Y: y,
 	}