-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtexture.go
46 lines (38 loc) · 917 Bytes
/
texture.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
package ofbx
//TextureType determines how a texture be used
type TextureType int
// Texture type block
const (
DIFFUSE TextureType = iota
NORMAL TextureType = iota
TextureCOUNT TextureType = iota
)
//Texture is a texture file on an object
type Texture struct {
Object
filename *DataView
relativeFilename *DataView
}
// NewTexture creates a texture
func NewTexture(scene *Scene, element *Element) *Texture {
t := &Texture{
Object: *NewObject(scene, element),
}
return t
}
// Type returns Texture
func (t *Texture) Type() Type {
return TEXTURE
}
func (t *Texture) getFileName() *DataView {
return t.filename
}
func (t *Texture) getRelativeFileName() *DataView {
return t.relativeFilename
}
func (t *Texture) String() string {
s := "Texture: " + t.Object.String()
s += ", filename: " + t.filename.String()
s += ", relativeFilename: " + t.relativeFilename.String()
return s
}