-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsceneobject.go
More file actions
87 lines (74 loc) · 2.92 KB
/
sceneobject.go
File metadata and controls
87 lines (74 loc) · 2.92 KB
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
package MVRTypes
import (
"archive/zip"
"github.com/Patch2PDF/GDTF-Mesh-Reader/v2/pkg/MeshTypes"
)
type SceneObject struct {
UUID string
Name string
Multipatch string
Matrix MeshTypes.Matrix
Class NodeReference[Class]
Geometries *Geometries
GDTFSpec NodeReference[GDTF]
GDTFMode string
CastShadow bool
Addresses *Addresses
Alignments []*Alignment
CustomCommands []*CustomCommand
Overwrites []*Overwrite
Connections []*Connection
FixtureID string
FixtureIDNumeric int
UnitNumber int
CustomId int
CustomIdType int
Model SceneObjectModel
ChildList
}
func (a *SceneObject) CreateReferencePointer(refPointers *ReferencePointers) {
a.ChildList.CreateReferencePointer(refPointers)
}
func (a *SceneObject) ResolveReference(refPointers *ReferencePointers) {
if a.Class.String != nil {
a.Class.Ptr = refPointers.Classes[*a.Class.String]
}
if a.GDTFSpec.String != nil {
a.GDTFSpec.Ptr = refPointers.GDTFSpecs[*a.GDTFSpec.String]
}
a.Geometries.ResolveReference(refPointers)
a.ChildList.ResolveReference(refPointers)
}
func (a *SceneObject) ReadMesh(fileMap map[string]*zip.File) error {
err := a.Geometries.ReadMesh(fileMap)
if err != nil {
return err
}
return a.ChildList.ReadMesh(fileMap)
}
func (a *SceneObject) addNodeModelsToStageModel(stageModel *StageModel, modelConfig ModelConfig, parentConfig ModelNodeConfig) {
config := getConfigOverrides(modelConfig, parentConfig, a.UUID)
if config.Exclude == nil || !(*config.Exclude) {
stageModel.SceneObjectModels = append(stageModel.SceneObjectModels, a.Model.Copy())
}
a.ChildList.addNodeModelsToStageModel(stageModel, modelConfig, config)
}
type Alignment struct {
Geometry string // Defines the Beam Geometry that gets aligned.
Up Vector // default: 0,0,1
Direction Vector // default: 0,0,-1
}
type CustomCommand struct {
Object string
Value string
}
// This node defines an overwrite with the Universal.gdtt GDTF template inside the MVR to overwrite Wheel Slots, Emitters and Filters for the fixture
type Overwrite struct {
Universal string // Node Link to the Wheel, Emitter or Filter. Starting point is the the collect of the Universal GDTF.
Target string // Node Link to the Wheel, Emitter or Filter. Starting point is the the collect of the linked GDTF of the fixture. When no target is given, it will be like a static gobo or filter that you attach in front of all beams
}
type Connection struct {
Own string // Node Link to the Geometry with DIN SPEC 15800 Type Wiring Object . Starting point is the Geometry Collect of the linked GDTF.
Other string // Node Link to the Geometry with DIN SPEC 15800 Type Wiring Object . Starting point is the Geometry Collect of the linked GDTF of the object defined in toObject.
ToObject NodeReference[any] // UUID of an other object in the scene.
}