body.go -> base.go
This commit is contained in:
parent
6fafbefc52
commit
7147f374ad
|
@ -2,22 +2,29 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/deadsy/sdfx/sdf"
|
"github.com/deadsy/sdfx/sdf"
|
||||||
|
v2 "github.com/deadsy/sdfx/vec/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
BODY_SIZE_X = 300
|
||||||
|
BODY_SIZE_Y = 220
|
||||||
|
BODY_SIZE_Z = 2 + 0 + 0 //Top + Walls + Base
|
||||||
)
|
)
|
||||||
|
|
||||||
func topPlane() sdf.SDF2 {
|
func topPlane() sdf.SDF2 {
|
||||||
top := sdf.Box2D(sdf.V2{X: 330, Y: 200}, 10)
|
top := sdf.Box2D(v2.Vec{X: 300, Y: 220}, 10)
|
||||||
joystick := joystick(sdf.V2{X: 84, Y: 10 + 10 + 20}) // as listed on jlfmeasure.jpg
|
joystick := joystick(v2.Vec{X: 84, Y: 10 + 10 + 20}) // as listed on jlfmeasure.jpg
|
||||||
joystick = sdf.Transform2D(joystick, sdf.Rotate2d(sdf.DtoR(90)))
|
joystick = sdf.Transform2D(joystick, sdf.Rotate2d(sdf.DtoR(90)))
|
||||||
joystick = loggedMovement(joystick, sdf.V2{X: -top.BoundingBox().Max.X / 2, Y: top.BoundingBox().Max.Y / 7}, "joystick")
|
joystick = loggedMovement(joystick, v2.Vec{X: -top.BoundingBox().Max.X / 2, Y: top.BoundingBox().Max.Y / 7}, "joystick")
|
||||||
top = sdf.Difference2D(top, joystick)
|
top = sdf.Difference2D(top, joystick)
|
||||||
|
|
||||||
buttons := buttonRows()
|
buttons := buttonRows()
|
||||||
buttons = loggedMovement(buttons, sdf.V2{X: top.BoundingBox().Max.X / 2, Y: top.BoundingBox().Max.Y / 4}, "button cluster")
|
buttons = loggedMovement(buttons, v2.Vec{X: top.BoundingBox().Max.X / 2, Y: top.BoundingBox().Max.Y / 4}, "button cluster")
|
||||||
top = sdf.Difference2D(top, buttons)
|
top = sdf.Difference2D(top, buttons)
|
||||||
|
|
||||||
auxillaryButtons := functionRow()
|
auxillaryButtons := functionRow()
|
||||||
// this is a bit ugly
|
// this is a bit ugly
|
||||||
auxillaryButtons = loggedMovement(auxillaryButtons, sdf.V2{X: -top.BoundingBox().Max.X / 2.4, Y: 4 * (top.BoundingBox().Max.Y / 5)}, "function cluster")
|
auxillaryButtons = loggedMovement(auxillaryButtons, v2.Vec{X: -top.BoundingBox().Max.X / 2.4, Y: 4 * (top.BoundingBox().Max.Y / 5)}, "function cluster")
|
||||||
top = sdf.Difference2D(top, auxillaryButtons)
|
top = sdf.Difference2D(top, auxillaryButtons)
|
||||||
return top
|
return top
|
||||||
|
|
Loading…
Reference in New Issue