whispervis/controls.go

22 lines
440 B
Go
Raw Normal View History

2018-09-05 13:53:09 +00:00
package main
import (
2018-09-20 12:41:24 +00:00
"github.com/divan/three"
2018-09-05 13:53:09 +00:00
"github.com/gopherjs/gopherjs/js"
)
type TrackBallControl struct {
*js.Object
}
func NewTrackBallControl(camera three.PerspectiveCamera, renderer *three.WebGLRenderer) TrackBallControl {
dom := renderer.Get("domElement")
return TrackBallControl{
Object: js.Global.Get("THREE").Get("TrackballControls").New(camera, dom),
}
}
func (t TrackBallControl) Update() {
t.Call("update")
}