Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
setanarut committed Nov 2, 2024
1 parent 58b8c03 commit ecf34d8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 32 deletions.
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ go 1.23.2

retract [v1.0.0, v1.12.0]

require (
github.com/setanarut/vec v1.1.1
)
require github.com/setanarut/vec v1.1.1
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ github.com/jakecoffman/cp/v2 v2.1.0 h1:s0almZ7zDZs9JY35ciUgCoVKTMmdPkokF1dxHg226
github.com/jakecoffman/cp/v2 v2.1.0/go.mod h1:Q0hFU7Kk6PMw4dwgFtvBC6O4KTm7ewiLuHrXtHMicyU=
github.com/setanarut/vec v1.1.0 h1:Tmei65+2EsQzNB+0xkpNgcXGTZTT0gEUdZRjVb2CuuQ=
github.com/setanarut/vec v1.1.0/go.mod h1:ZDoKd7F60rWLgCK58novWOCe5ePiXfSkwtmuOSSC9TU=
github.com/setanarut/vec v1.1.1 h1:2nH1gbDMCa/IHTdG41nmI+2OYyKhbiputK+Bg/mMK+s=
github.com/setanarut/vec v1.1.1/go.mod h1:ZDoKd7F60rWLgCK58novWOCe5ePiXfSkwtmuOSSC9TU=
29 changes: 0 additions & 29 deletions test/space_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,6 @@ func TestSpaceAddBody(t *testing.T) {
}
}

// func TestSpace_ReindexShape(t *testing.T) {
// space := cm.NewSpace()
// circle := space.AddShape(cm.NewCircle(space.StaticBody, 1, vec.Vec2{}))
// bb1 := circle.BB
// space.ReindexShape(circle)
// bb2 := circle.BB
// // check unchanged
// if got, want := bb1.String(), bb2.String(); got != want {
// t.Errorf("got [%[1]v:%[1]T] want [%[2]v:%[2]T]", got, want)
// }
// circle.Body().SetPosition(vec.Vec2{X: 12.0, Y: 34.0})
// space.ReindexShape(circle)
// bb3 := circle.BB
// // check changed
// if got, want := bb2.String(), bb3.String(); got == want {
// t.Errorf("got [%[1]v:%[1]T] want [%[2]v:%[2]T]", got, want)
// }
// }
func TestSpace_ReindexShape(t *testing.T) {
space := cm.NewSpace()
sb := cm.NewStaticBody()
Expand All @@ -84,14 +66,3 @@ func TestSpace_ReindexShape(t *testing.T) {
t.Errorf("got [%[1]v:%[1]T] want [%[2]v:%[2]T]", got, want)
}
}

// func TestSpace_RemoveBodyWithShapes(t *testing.T) {
// space := cm.NewSpace()
// radius := 5.0

// body := cm.NewBody(1, cm.MomentForCircle2(1, radius))
// shapeA := cm.NewCircle2(body, radius)
// shapeB := cm.NewCircle2(body, radius)

// space.AddBodyWithShapes()
// }

0 comments on commit ecf34d8

Please sign in to comment.