Skip to content
This repository was archived by the owner on Dec 12, 2022. It is now read-only.

Commit be2954f

Browse files
committed
Recognize InstancedBufferGeometry as geometry. Fixes #52
1 parent 9eed092 commit be2954f

1 file changed

Lines changed: 51 additions & 32 deletions

File tree

src/app/data/geometry.js

Lines changed: 51 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -64,46 +64,65 @@ const Geometry = {
6464
// boundingBox
6565
// boundingSphere
6666
// morphAttributes
67-
const BufferGeometry = {
68-
type: 'geometry',
67+
const bufferGeometryProps = [{
68+
name: 'Index',
69+
type: 'attribute',
70+
prop: 'data.index',
71+
}, {
72+
name: 'Groups',
73+
type: 'array', // { start, count, materialIndex }
74+
prop: 'data.groups',
75+
},
76+
/*
77+
{
78+
name: 'Draw Range',
79+
type: 'group',
6980
props: [{
70-
name: 'Index',
71-
type: 'attribute',
72-
prop: 'data.index',
73-
}, {
74-
name: 'Groups',
75-
type: 'array', // { start, count, materialIndex }
76-
prop: 'data.groups',
77-
},
78-
BufferAttributes,
79-
{
80-
/*
81-
name: 'Draw Range',
82-
type: 'group',
83-
props: [{
84-
name: 'Start',
85-
type: 'number',
86-
prop: 'drawRange.start',
87-
default: 0,
88-
}, {
89-
name: 'Count',
90-
type: 'number',
91-
prop: 'drawRange.count',
92-
default: Infinity,
93-
}]
81+
name: 'Start',
82+
type: 'number',
83+
prop: 'drawRange.start',
84+
default: 0,
9485
}, {
95-
*/
96-
name: 'Morph Targets Relative',
97-
type: 'boolean',
98-
prop: 'data.morphTargetsRelative',
99-
default: false,
86+
name: 'Count',
87+
type: 'number',
88+
prop: 'drawRange.count',
89+
default: Infinity,
10090
}]
91+
},
92+
*/
93+
{
94+
name: 'Morph Targets Relative',
95+
type: 'boolean',
96+
prop: 'data.morphTargetsRelative',
97+
default: false,
98+
}];
99+
100+
const BufferGeometry = {
101+
type: 'geometry',
102+
props: [
103+
...bufferGeometryProps
104+
],
105+
BufferAttributes,
106+
}
107+
108+
const InstancedBufferGeometry = {
109+
type: 'geometry',
110+
props: [
111+
...bufferGeometryProps, {
112+
name: 'Instance Count',
113+
type: 'int',
114+
prop: 'instanceCount',
115+
}
116+
],
117+
BufferAttributes,
101118
}
102119

103120
export default {
104121
BufferGeometry: BufferGeometry,
105122
Geometry: Geometry,
106123

124+
InstancedBufferGeometry: InstancedBufferGeometry,
125+
107126
BoxBufferGeometry: BufferGeometry,
108127
BoxGeometry: Geometry,
109128
CircleBufferGeometry: BufferGeometry,
@@ -146,4 +165,4 @@ export default {
146165
TubeBufferGeometry: BufferGeometry,
147166
TubeGeometry: Geometry,
148167
WireframeGeometry: Geometry,
149-
}
168+
}

0 commit comments

Comments
 (0)