Skip to content

Commit

Permalink
Bitbucket -> Github
Browse files Browse the repository at this point in the history
  • Loading branch information
200sc committed Jul 17, 2017
1 parent e0a528e commit b97d157
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 55 deletions.
2 changes: 1 addition & 1 deletion dcel/pointLoc/bench/trapezoid/trapezoid.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package trapezoid

import (
"bitbucket.org/oakmoundstudio/oak/physics"
"github.com/oakmound/oak/physics"
"github.com/200sc/go-compgeo/dcel"
"github.com/200sc/go-compgeo/geom"
"github.com/200sc/go-compgeo/printutil"
Expand Down
2 changes: 1 addition & 1 deletion dcel/pointLoc/trapezoid/trapezoid.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"
"image/color"

"bitbucket.org/oakmoundstudio/oak/physics"
"github.com/oakmound/oak/physics"
"github.com/200sc/go-compgeo/dcel"
"github.com/200sc/go-compgeo/dcel/pointLoc/visualize"
"github.com/200sc/go-compgeo/geom"
Expand Down
4 changes: 2 additions & 2 deletions dcel/pointLoc/visualize/visualize.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"github.com/200sc/go-compgeo/dcel"
"github.com/200sc/go-compgeo/geom"

"bitbucket.org/oakmoundstudio/oak/physics"
"bitbucket.org/oakmoundstudio/oak/render"
"github.com/oakmound/oak/physics"
"github.com/oakmound/oak/render"
)

var (
Expand Down
14 changes: 7 additions & 7 deletions demo/demo/addFace.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import (

"golang.org/x/sync/syncmap"

"bitbucket.org/oakmoundstudio/oak/event"
"bitbucket.org/oakmoundstudio/oak/mouse"
"bitbucket.org/oakmoundstudio/oak/render"
"github.com/200sc/go-compgeo/dcel"
"github.com/200sc/go-compgeo/dcel/pointLoc/bruteForce"
"github.com/200sc/go-compgeo/dcel/pointLoc/kirkpatrick"
"github.com/200sc/go-compgeo/dcel/pointLoc/slab"
"github.com/200sc/go-compgeo/dcel/pointLoc/trapezoid"
"github.com/200sc/go-compgeo/search/tree"
"github.com/oakmound/oak/event"
"github.com/oakmound/oak/mouse"
"github.com/oakmound/oak/render"
)

var (
Expand All @@ -33,8 +33,8 @@ func addFace(cID int, ev interface{}) int {
if me.X < 0 || me.Y < 0 || me.X > 515 {
return 0
}
mx := float64(me.X) - phd.X
my := float64(me.Y) - phd.Y
mx := float64(me.X) - phd.X()
my := float64(me.Y) - phd.Y()
if me.Button == "LeftMouse" {
// Detect clicks
// On first click, declare the first point and edge and face
Expand Down Expand Up @@ -248,8 +248,8 @@ func addFace(cID int, ev interface{}) int {
}
poly := PolygonFromFace(f)
poly.Fill(color.RGBA{125, 0, 0, 125})
poly.ShiftX(phd.X)
poly.ShiftY(phd.Y)
poly.ShiftX(phd.X())
poly.ShiftY(phd.Y())
render.Draw(poly, 10)
render.UndrawAfter(poly, 1500*time.Millisecond)
}
Expand Down
14 changes: 7 additions & 7 deletions demo/demo/button.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package demo
import (
"fmt"

"bitbucket.org/oakmoundstudio/oak/collision"
"bitbucket.org/oakmoundstudio/oak/entities"
"bitbucket.org/oakmoundstudio/oak/event"
"bitbucket.org/oakmoundstudio/oak/mouse"
"bitbucket.org/oakmoundstudio/oak/render"
"github.com/oakmound/oak/collision"
"github.com/oakmound/oak/entities"
"github.com/oakmound/oak/event"
"github.com/oakmound/oak/mouse"
"github.com/oakmound/oak/render"
)

// A Button is a UI element that has transient background,
Expand Down Expand Up @@ -56,7 +56,7 @@ func (b *Button) SetPos(x float64, y float64) {
}

if b.Space != nil {
mouse.UpdateSpace(b.X, b.Y, b.W, b.H, b.Space)
mouse.UpdateSpace(b.X(), b.Y(), b.W, b.H, b.Space)
}
}

Expand All @@ -78,6 +78,6 @@ func (b *Button) SetText(txt fmt.Stringer) {
if b.Text != nil {
b.Text.UnDraw()
}
b.Text = b.Font.NewText(txt, b.X+b.TxtX, b.Y-b.TxtY+b.H)
b.Text = b.Font.NewText(txt, b.X()+b.TxtX, b.Y()-b.TxtY+b.H)
render.Draw(b.Text, b.Layer+1)
}
10 changes: 5 additions & 5 deletions demo/demo/enter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package demo

import (
"bitbucket.org/oakmoundstudio/oak"
"bitbucket.org/oakmoundstudio/oak/event"
"bitbucket.org/oakmoundstudio/oak/mouse"
"github.com/200sc/go-compgeo/geom"
"github.com/oakmound/oak/event"
"github.com/oakmound/oak/mouse"
)

func phdEnter(cID int, nothing interface{}) int {
Expand Down Expand Up @@ -43,7 +43,7 @@ func phdEnter(cID int, nothing interface{}) int {
nme := mouse.LastMouseEvent
mX := float64(nme.X)
mY := float64(nme.Y)
mouseStr.SetText(geom.Point{mX - phd.X, mY - phd.Y, mouseZ})
mouseStr.SetText(geom.Point{mX - phd.X(), mY - phd.Y(), mouseZ})
if mX < 0 || mY < 0 || mX > 515 {
dragX = -1
dragY = -1
Expand Down Expand Up @@ -76,12 +76,12 @@ func phdEnter(cID int, nothing interface{}) int {
update := false
if dragX != -1 {
phd.Vertices[dragging].Point =
phd.Vertices[dragging].Set(0, float64(dragX)-phd.X).(geom.Point)
phd.Vertices[dragging].Set(0, float64(dragX)-phd.X()).(geom.Point)
update = true
}
if dragY != -1 {
phd.Vertices[dragging].Point =
phd.Vertices[dragging].Set(1, float64(dragY)-phd.Y).(geom.Point)
phd.Vertices[dragging].Set(1, float64(dragY)-phd.Y()).(geom.Point)
update = true
}
if oak.IsDown("D") {
Expand Down
8 changes: 4 additions & 4 deletions demo/demo/interactivePoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package demo
import (
"time"

"bitbucket.org/oakmoundstudio/oak/collision"
"bitbucket.org/oakmoundstudio/oak/event"
"bitbucket.org/oakmoundstudio/oak/mouse"
"bitbucket.org/oakmoundstudio/oak/render"
"github.com/oakmound/oak/collision"
"github.com/oakmound/oak/event"
"github.com/oakmound/oak/mouse"
"github.com/oakmound/oak/render"
"github.com/200sc/go-compgeo/dcel"
)

Expand Down
10 changes: 5 additions & 5 deletions demo/demo/interactivePoly.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package demo

import (
"bitbucket.org/oakmoundstudio/oak/event"
"bitbucket.org/oakmoundstudio/oak/mouse"
"bitbucket.org/oakmoundstudio/oak/render"
"github.com/oakmound/oak/event"
"github.com/oakmound/oak/mouse"
"github.com/oakmound/oak/render"
)

// An InteractivePolyhedron is a wrapper around
Expand Down Expand Up @@ -51,8 +51,8 @@ func (ip *InteractivePolyhedron) UpdateSpaces() {
ip.vs[i] = NewInteractivePoint(v, i)
}
ip.vs[i].Vertex = v
mouse.UpdateSpace(ip.X+(v.X()-vCollisionDim/2),
ip.Y+(v.Y()-vCollisionDim/2),
mouse.UpdateSpace(ip.X()+(v.X()-vCollisionDim/2),
ip.Y()+(v.Y()-vCollisionDim/2),
vCollisionDim, vCollisionDim, ip.vs[i].s)
}
}
20 changes: 10 additions & 10 deletions demo/demo/polyhedron.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"math"
"sort"

"bitbucket.org/oakmoundstudio/oak/physics"
"bitbucket.org/oakmoundstudio/oak/render"
"github.com/200sc/go-compgeo/dcel"
"github.com/200sc/go-compgeo/geom"
"github.com/oakmound/oak/physics"
"github.com/oakmound/oak/render"
)

// Polyhedron is a type which extends render.Renderable,
Expand Down Expand Up @@ -43,7 +43,7 @@ func NewPolyhedronFromDCEL(dc *dcel.DCEL, x, y float64) *Polyhedron {
p.SetPos(x, y)
p.DCEL = *dc
p.Update()
p.Center = physics.NewVector(p.X+(1+p.MaxX())/2, p.Y+(1+p.MaxY())/2)
p.Center = physics.NewVector(p.X()+(1+p.MaxX())/2, p.Y()+(1+p.MaxY())/2)
return p
}

Expand All @@ -69,11 +69,11 @@ func (p *Polyhedron) Update() {
// one place on screen. This is not exactly the expected
// behavior from someone rotating a shape, but it is
// close.
if p.Center.X != 0 || p.Center.Y != 0 {
cx := p.X + maxX/2
cy := p.Y + maxY/2
p.X -= (cx - p.Center.X)
p.Y -= (cy - p.Center.Y)
if p.Center.X() != 0 || p.Center.Y() != 0 {
cx := p.X() + maxX/2
cy := p.Y() + maxY/2
p.SetX(p.X() - (cx - p.Center.X()))
p.SetY(p.Y() - (cy - p.Center.Y()))
}

// Eventually:
Expand Down Expand Up @@ -315,12 +315,12 @@ func (p *Polyhedron) String() string {

// ShiftX moves a polyhedron and its center along the x axis
func (p *Polyhedron) ShiftX(x float64) {
p.Center.X += x
p.Center.ShiftX(x)
p.Sprite.ShiftX(x)
}

// ShiftY moves a polyhedron and its center along the y axis
func (p *Polyhedron) ShiftY(y float64) {
p.Center.Y += y
p.Center.ShiftY(y)
p.Sprite.ShiftY(y)
}
12 changes: 6 additions & 6 deletions demo/demo/scene.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import (
"golang.org/x/sync/syncmap"

"bitbucket.org/oakmoundstudio/oak"
"bitbucket.org/oakmoundstudio/oak/event"
"bitbucket.org/oakmoundstudio/oak/render"
"github.com/200sc/go-compgeo/dcel"
"github.com/200sc/go-compgeo/dcel/off"
"github.com/200sc/go-compgeo/dcel/pointLoc"
"github.com/200sc/go-compgeo/dcel/pointLoc/visualize"
"github.com/200sc/go-compgeo/geom"
"github.com/oakmound/oak/event"
"github.com/oakmound/oak/render"
)

const (
Expand Down Expand Up @@ -110,8 +110,8 @@ func InitScene(prevScene string, data interface{}) {
// Scale till 300 wide
width := phd.Max(0)
phd.Polyhedron.Scale(300 / width)
phd.ShiftX(50 - phd.X)
phd.ShiftY(50 - phd.Y)
phd.ShiftX(50 - phd.X())
phd.ShiftY(50 - phd.Y())
phd.Init()
render.Draw(phd, 0)

Expand Down Expand Up @@ -300,8 +300,8 @@ func visuals(no int, rt interface{}) int {
if visual == nil {
return
}
visual.ShiftX(phd.X)
visual.ShiftY(phd.Y)
visual.ShiftX(phd.X())
visual.ShiftY(phd.Y())

render.Draw(visual.Renderable, visual.Layer)
render.UndrawAfter(visual, 2000*time.Millisecond)
Expand Down
14 changes: 7 additions & 7 deletions demo/demo/slider.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"strconv"
"time"

"bitbucket.org/oakmoundstudio/oak/collision"
"bitbucket.org/oakmoundstudio/oak/event"
"bitbucket.org/oakmoundstudio/oak/mouse"
"bitbucket.org/oakmoundstudio/oak/render"
"github.com/oakmound/oak/collision"
"github.com/oakmound/oak/event"
"github.com/oakmound/oak/mouse"
"github.com/oakmound/oak/render"
)

// Slider is a little UI element with a movable slider
Expand Down Expand Up @@ -88,7 +88,7 @@ func (sl *Slider) SetPos(x float64, y float64) {
}

if sl.Space != nil {
mouse.UpdateSpace(sl.X, sl.Y, sl.W, sl.H, sl.Space)
mouse.UpdateSpace(sl.X(), sl.Y(), sl.W, sl.H, sl.Space)
}
}

Expand All @@ -114,7 +114,7 @@ func sliderDrag(sl int, nothing interface{}) int {
sliding = false
return event.UnbindEvent
}
x := float64(me.X) - (slider.X + 5)
x := float64(me.X) - (slider.X() + 5)
if x <= slider.min {
if slider.val == slider.min {
return 0
Expand All @@ -128,7 +128,7 @@ func sliderDrag(sl int, nothing interface{}) int {
} else {
slider.val = x
}
slider.knub.SetPos(slider.X+slider.val+5, slider.knub.GetY())
slider.knub.SetPos(slider.X()+slider.val+5, slider.knub.GetY())
slider.SetText(slider.valText())
return 0
}
Expand Down

0 comments on commit b97d157

Please sign in to comment.