forked from Lngramos/three
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathobjects_mesh.go
More file actions
32 lines (25 loc) · 784 Bytes
/
objects_mesh.go
File metadata and controls
32 lines (25 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package three
//go:generate go run object3d_method_generator/main.go -typeName Mesh -typeSlug mesh
import (
"github.com/gopherjs/gopherjs/js"
)
type Mesh struct {
*js.Object
ID int `js:"id"`
Position *Vector3 `js:"position"`
Rotation *Euler `js:"rotation"`
Geometry Geometry `js:"geometry"`
Material Material `js:"material"`
MatrixAutoUpdate bool `js:"matrixAutoUpdate"`
}
func NewMesh(geometry Geometry, material Material) *Mesh {
return &Mesh{
Object: three.Get("Mesh").New(geometry.getInternalObject(), material.getInternalObject()),
}
}
func (m Mesh) SetRotationFromAxisAngle(axis string, angle float64) {
m.Call("setRotationFromAxisAngle", axis, angle)
}
func (m Mesh) RotateX() {
m.Call("rotateX")
}