MCPcopy Create free account
hub / github.com/EngoEngine/engo / TestSpaceComponent_Center

Function TestSpaceComponent_Center

common/collision_test.go:279–300  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

277}
278
279func TestSpaceComponent_Center(t *testing.T) {
280 components := []SpaceComponent{
281 {Width: 0, Height: 0},
282 {Width: 100, Height: 100},
283 {Width: 100, Height: 200},
284 {Width: 100, Height: 200, Rotation: 45},
285 }
286 points := []engo.Point{
287 {X: 10, Y: 10},
288 {X: 50, Y: 50},
289 {X: 10, Y: 50},
290 {X: 99, Y: 99},
291 }
292
293 for _, sc := range components {
294 for _, p := range points {
295 sc.SetCenter(p)
296 c := sc.Center()
297 assert.True(t, c.Equal(p), fmt.Sprintf("center %v should be equal to point %v", c, p))
298 }
299 }
300}
301
302func TestShape_Project(t *testing.T) {
303 shapes := []Shape{

Callers

nothing calls this directly

Calls 3

SetCenterMethod · 0.80
CenterMethod · 0.80
EqualMethod · 0.80

Tested by

no test coverage detected