forked from Lngramos/three
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathobjects_sprite.go
More file actions
28 lines (23 loc) · 859 Bytes
/
objects_sprite.go
File metadata and controls
28 lines (23 loc) · 859 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
package three
//go:generate go run object3d_method_generator/main.go -typeName Sprite -typeSlug sprite
import (
"github.com/gopherjs/gopherjs/js"
)
// Sprite is a plane that always faces towards the camera, generally with a partially transparent texture applied.
type Sprite struct {
*js.Object
ID int `js:"id"`
Position *Vector3 `js:"position"`
Scale *Vector3 `js:"scale"`
Rotation *Euler `js:"rotation"`
Geometry *BufferGeometry `js:"geometry"`
Material Material `js:"material"`
MatrixAutoUpdate bool `js:"matrixAutoUpdate"`
RenderOrder int `js:"renderOrder"`
}
// NewSprite creates a new sprite.
func NewSprite(material *SpriteMaterial) *Sprite {
return &Sprite{
Object: three.Get("Sprite").New(material),
}
}