This repository has been archived by the owner on Feb 22, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
zzz_ActionEvent.go
299 lines (249 loc) · 8.6 KB
/
zzz_ActionEvent.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
// Code generated by docs2go. DO NOT EDIT.
package babylon
import (
"syscall/js"
)
// ActionEvent represents a babylon.js ActionEvent.
// ActionEvent is the event being sent when an action is triggered.
type ActionEvent struct {
p js.Value
ctx js.Value
}
// JSObject returns the underlying js.Value.
func (a *ActionEvent) JSObject() js.Value { return a.p }
// ActionEvent returns a ActionEvent JavaScript class.
func (ba *Babylon) ActionEvent() *ActionEvent {
p := ba.ctx.Get("ActionEvent")
return ActionEventFromJSObject(p, ba.ctx)
}
// ActionEventFromJSObject returns a wrapped ActionEvent JavaScript class.
func ActionEventFromJSObject(p js.Value, ctx js.Value) *ActionEvent {
return &ActionEvent{p: p, ctx: ctx}
}
// ActionEventArrayToJSArray returns a JavaScript Array for the wrapped array.
func ActionEventArrayToJSArray(array []*ActionEvent) []interface{} {
var result []interface{}
for _, v := range array {
result = append(result, v.JSObject())
}
return result
}
// NewActionEventOpts contains optional parameters for NewActionEvent.
type NewActionEventOpts struct {
SourceEvent interface{}
AdditionalData interface{}
}
// NewActionEvent returns a new ActionEvent object.
//
// https://doc.babylonjs.com/api/classes/babylon.actionevent#constructor
func (ba *Babylon) NewActionEvent(source JSObject, pointerX float64, pointerY float64, meshUnderPointer *AbstractMesh, opts *NewActionEventOpts) *ActionEvent {
if opts == nil {
opts = &NewActionEventOpts{}
}
args := make([]interface{}, 0, 4+2)
args = append(args, source.JSObject())
args = append(args, pointerX)
args = append(args, pointerY)
args = append(args, meshUnderPointer.JSObject())
if opts.SourceEvent == nil {
args = append(args, js.Undefined())
} else {
args = append(args, opts.SourceEvent)
}
if opts.AdditionalData == nil {
args = append(args, js.Undefined())
} else {
args = append(args, opts.AdditionalData)
}
p := ba.ctx.Get("ActionEvent").New(args...)
return ActionEventFromJSObject(p, ba.ctx)
}
// ActionEventCreateNewOpts contains optional parameters for ActionEvent.CreateNew.
type ActionEventCreateNewOpts struct {
Evt js.Value
AdditionalData interface{}
}
// CreateNew calls the CreateNew method on the ActionEvent object.
//
// https://doc.babylonjs.com/api/classes/babylon.actionevent#createnew
func (a *ActionEvent) CreateNew(source *AbstractMesh, opts *ActionEventCreateNewOpts) *ActionEvent {
if opts == nil {
opts = &ActionEventCreateNewOpts{}
}
args := make([]interface{}, 0, 1+2)
if source == nil {
args = append(args, js.Null())
} else {
args = append(args, source.JSObject())
}
args = append(args, opts.Evt)
if opts.AdditionalData == nil {
args = append(args, js.Undefined())
} else {
args = append(args, opts.AdditionalData)
}
retVal := a.p.Call("CreateNew", args...)
return ActionEventFromJSObject(retVal, a.ctx)
}
// ActionEventCreateNewFromPrimitiveOpts contains optional parameters for ActionEvent.CreateNewFromPrimitive.
type ActionEventCreateNewFromPrimitiveOpts struct {
Evt js.Value
AdditionalData interface{}
}
// CreateNewFromPrimitive calls the CreateNewFromPrimitive method on the ActionEvent object.
//
// https://doc.babylonjs.com/api/classes/babylon.actionevent#createnewfromprimitive
func (a *ActionEvent) CreateNewFromPrimitive(prim JSObject, pointerPos *Vector2, opts *ActionEventCreateNewFromPrimitiveOpts) *ActionEvent {
if opts == nil {
opts = &ActionEventCreateNewFromPrimitiveOpts{}
}
args := make([]interface{}, 0, 2+2)
if prim == nil {
args = append(args, js.Null())
} else {
args = append(args, prim.JSObject())
}
if pointerPos == nil {
args = append(args, js.Null())
} else {
args = append(args, pointerPos.JSObject())
}
args = append(args, opts.Evt)
if opts.AdditionalData == nil {
args = append(args, js.Undefined())
} else {
args = append(args, opts.AdditionalData)
}
retVal := a.p.Call("CreateNewFromPrimitive", args...)
return ActionEventFromJSObject(retVal, a.ctx)
}
// CreateNewFromScene calls the CreateNewFromScene method on the ActionEvent object.
//
// https://doc.babylonjs.com/api/classes/babylon.actionevent#createnewfromscene
func (a *ActionEvent) CreateNewFromScene(scene *Scene, evt js.Value) *ActionEvent {
args := make([]interface{}, 0, 2+0)
if scene == nil {
args = append(args, js.Null())
} else {
args = append(args, scene.JSObject())
}
args = append(args, evt)
retVal := a.p.Call("CreateNewFromScene", args...)
return ActionEventFromJSObject(retVal, a.ctx)
}
// ActionEventCreateNewFromSpriteOpts contains optional parameters for ActionEvent.CreateNewFromSprite.
type ActionEventCreateNewFromSpriteOpts struct {
Evt js.Value
AdditionalData interface{}
}
// CreateNewFromSprite calls the CreateNewFromSprite method on the ActionEvent object.
//
// https://doc.babylonjs.com/api/classes/babylon.actionevent#createnewfromsprite
func (a *ActionEvent) CreateNewFromSprite(source *Sprite, scene *Scene, opts *ActionEventCreateNewFromSpriteOpts) *ActionEvent {
if opts == nil {
opts = &ActionEventCreateNewFromSpriteOpts{}
}
args := make([]interface{}, 0, 2+2)
if source == nil {
args = append(args, js.Null())
} else {
args = append(args, source.JSObject())
}
if scene == nil {
args = append(args, js.Null())
} else {
args = append(args, scene.JSObject())
}
args = append(args, opts.Evt)
if opts.AdditionalData == nil {
args = append(args, js.Undefined())
} else {
args = append(args, opts.AdditionalData)
}
retVal := a.p.Call("CreateNewFromSprite", args...)
return ActionEventFromJSObject(retVal, a.ctx)
}
// AdditionalData returns the AdditionalData property of class ActionEvent.
//
// https://doc.babylonjs.com/api/classes/babylon.actionevent#additionaldata
func (a *ActionEvent) AdditionalData() js.Value {
retVal := a.p.Get("additionalData")
return retVal
}
// SetAdditionalData sets the AdditionalData property of class ActionEvent.
//
// https://doc.babylonjs.com/api/classes/babylon.actionevent#additionaldata
func (a *ActionEvent) SetAdditionalData(additionalData JSObject) *ActionEvent {
a.p.Set("additionalData", additionalData.JSObject())
return a
}
// MeshUnderPointer returns the MeshUnderPointer property of class ActionEvent.
//
// https://doc.babylonjs.com/api/classes/babylon.actionevent#meshunderpointer
func (a *ActionEvent) MeshUnderPointer() *AbstractMesh {
retVal := a.p.Get("meshUnderPointer")
return AbstractMeshFromJSObject(retVal, a.ctx)
}
// SetMeshUnderPointer sets the MeshUnderPointer property of class ActionEvent.
//
// https://doc.babylonjs.com/api/classes/babylon.actionevent#meshunderpointer
func (a *ActionEvent) SetMeshUnderPointer(meshUnderPointer *AbstractMesh) *ActionEvent {
a.p.Set("meshUnderPointer", meshUnderPointer.JSObject())
return a
}
// PointerX returns the PointerX property of class ActionEvent.
//
// https://doc.babylonjs.com/api/classes/babylon.actionevent#pointerx
func (a *ActionEvent) PointerX() float64 {
retVal := a.p.Get("pointerX")
return retVal.Float()
}
// SetPointerX sets the PointerX property of class ActionEvent.
//
// https://doc.babylonjs.com/api/classes/babylon.actionevent#pointerx
func (a *ActionEvent) SetPointerX(pointerX float64) *ActionEvent {
a.p.Set("pointerX", pointerX)
return a
}
// PointerY returns the PointerY property of class ActionEvent.
//
// https://doc.babylonjs.com/api/classes/babylon.actionevent#pointery
func (a *ActionEvent) PointerY() float64 {
retVal := a.p.Get("pointerY")
return retVal.Float()
}
// SetPointerY sets the PointerY property of class ActionEvent.
//
// https://doc.babylonjs.com/api/classes/babylon.actionevent#pointery
func (a *ActionEvent) SetPointerY(pointerY float64) *ActionEvent {
a.p.Set("pointerY", pointerY)
return a
}
// Source returns the Source property of class ActionEvent.
//
// https://doc.babylonjs.com/api/classes/babylon.actionevent#source
func (a *ActionEvent) Source() js.Value {
retVal := a.p.Get("source")
return retVal
}
// SetSource sets the Source property of class ActionEvent.
//
// https://doc.babylonjs.com/api/classes/babylon.actionevent#source
func (a *ActionEvent) SetSource(source JSObject) *ActionEvent {
a.p.Set("source", source.JSObject())
return a
}
// SourceEvent returns the SourceEvent property of class ActionEvent.
//
// https://doc.babylonjs.com/api/classes/babylon.actionevent#sourceevent
func (a *ActionEvent) SourceEvent() js.Value {
retVal := a.p.Get("sourceEvent")
return retVal
}
// SetSourceEvent sets the SourceEvent property of class ActionEvent.
//
// https://doc.babylonjs.com/api/classes/babylon.actionevent#sourceevent
func (a *ActionEvent) SetSourceEvent(sourceEvent JSObject) *ActionEvent {
a.p.Set("sourceEvent", sourceEvent.JSObject())
return a
}