forked from oakmound/ofbx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtexture.go
54 lines (44 loc) · 1.05 KB
/
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
47
48
49
50
51
52
53
54
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) GetFileName() string {
return t.filename.String()
}
func (t *Texture) getRelativeFileName() *DataView {
return t.relativeFilename
}
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
}