-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathgeometries_box_geometry.go
43 lines (37 loc) · 1.17 KB
/
geometries_box_geometry.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
package three
//go:generate go run geometry_method_generator/main.go -geometryType BoxGeometry -geometrySlug box_geometry
import "github.com/gopherjs/gopherjs/js"
// BoxGeometry is the quadrilateral primitive geometry class. It is typically
// used for creating a cube or irregular quadrilateral of the dimensions
// provided with the 'width', 'height', and 'depth' constructor arguments.
type BoxGeometry struct {
*js.Object
Width float64 `js:"width"`
Height float64 `js:"height"`
Depth float64 `js:"depth"`
WidthSegments float64 `js:"widthSegments"`
HeightSegments float64 `js:"heightSegments"`
DepthSegments float64 `js:"depthSegments"`
}
// BoxGeometryParameters .
type BoxGeometryParameters struct {
Width float64
Height float64
Depth float64
WidthSegments float64
HeightSegments float64
DepthSegments float64
}
// NewBoxGeometry creates a new BoxGeometry.
func NewBoxGeometry(params *BoxGeometryParameters) BoxGeometry {
return BoxGeometry{
Object: three.Get("BoxGeometry").New(
params.Width,
params.Height,
params.Depth,
params.WidthSegments,
params.HeightSegments,
params.DepthSegments,
),
}
}