-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathmaterials_material.go
49 lines (38 loc) · 966 Bytes
/
materials_material.go
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package three
import (
"github.com/gopherjs/gopherjs/js"
)
// Side defines which side of faces will be rendered - front, back or both. Default is FrontSide.
type Side float64
const (
FrontSide Side = 0
BackSide Side = 1
DoubleSide Side = 2
)
type Shading float64
const (
// SmoothShading is the default and linearly interpolates color between vertices.
SmoothShading Shading = 0
// FlatShading uses the color of the first vertex for every pixel in a face.
FlatShading Shading = 1
)
type MaterialParameters struct {
*js.Object
Color *Color `js:"color"`
Shading Shading `js:"shading"`
Side Side `js:"side"`
}
func NewMaterialParameters() *MaterialParameters {
return &MaterialParameters{
Object: js.Global.Get("Object").New(),
}
}
type Material interface {
OnBeforeCompile()
SetValues(values MaterialParameters)
ToJSON(meta interface{}) interface{}
Clone()
Copy(source Object3D)
Dispose()
getInternalObject() *js.Object
}