Skip to content

Commit 006d35e

Browse files
committed
Refactor plain/base geometry
Make the actual instantiated geometry class names more consistent with three.js names.
1 parent 3134592 commit 006d35e

File tree

7 files changed

+73
-73
lines changed

7 files changed

+73
-73
lines changed

js/scripts/generate-wrappers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ var CUSTOM_CLASSES = [
3939
'controls/TrackballControls.js',
4040
'controls/FlyControls.js',
4141
'controls/Picker.js',
42-
'geometries/PlainGeometry.js',
43-
'geometries/PlainBufferGeometry.js',
42+
'core/BaseGeometry.js',
43+
'core/BaseBufferGeometry.js',
4444
'objects/CloneArray.js',
4545
'objects/Blackbox.js',
4646
];

js/scripts/three-class-config.js

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,8 @@ module.exports = {
282282
constructorArgs: [ 'array', 'normalized' ],
283283
propsDefinedByThree: [ 'version', 'needsUpdate' ]
284284
},
285-
BufferGeometry: {
286-
relativePath: './core/BufferGeometry',
285+
BaseBufferGeometry: {
286+
relativePath: './core/BaseBufferGeometry',
287287
properties: {
288288
name: new Types.String(''),
289289
type: new Types.String(''),
@@ -314,22 +314,22 @@ module.exports = {
314314
},
315315
constructorArgs: [ 'a', 'b', 'c', 'normal', 'color', 'materialIndex' ],
316316
},
317-
Geometry: {
318-
relativePath: './core/Geometry',
317+
BaseGeometry: {
318+
relativePath: './core/BaseGeometry',
319319
properties: {
320320
// TODO: id not supported as it conflicts with backbone's id
321321
// id: new Types.String(''),
322322
name: new Types.String(''),
323323
type: new Types.String(''),
324324

325-
// By default Geometry does not sync geometry arrays
326-
// Use the custom class PlainGeometry to access those arrays
325+
// By default BaseGeometry does not sync geometry arrays
326+
// Use the Geometry class to access those arrays
327327
},
328328
propsDefinedByThree: [ 'type' ]
329329
},
330-
PlainGeometry: {
331-
relativePath: './geometries/PlainGeometry',
332-
superClass: 'Geometry',
330+
Geometry: {
331+
relativePath: './core/Geometry',
332+
superClass: 'BaseGeometry',
333333
properties: {
334334
vertices: new Types.VectorArray(),
335335
colors: new Types.ColorArray(),
@@ -340,20 +340,20 @@ module.exports = {
340340
morphNormals: new Types.Array(),
341341
skinWeights: new Types.VectorArray(),
342342
skinIndices: new Types.VectorArray(),
343-
_ref_geometry: new Types.ThreeType('Geometry'),
343+
_ref_geometry: new Types.ThreeType('BaseGeometry'),
344344
},
345345
},
346-
PlainBufferGeometry: {
347-
relativePath: './geometries/PlainBufferGeometry',
348-
superClass: 'BufferGeometry',
346+
BufferGeometry: {
347+
relativePath: './core/BufferGeometry',
348+
superClass: 'BaseBufferGeometry',
349349
properties: {
350350
attributes: new Types.ThreeTypeDict(['BufferAttribute', 'InterleavedBufferAttribute']),
351351
morphAttributes: new Types.BufferMorphAttributes(),
352352
MaxIndex: new Types.Int(65535),
353353
// TODO: These likely require special types:
354354
//groups: new Types.GeometryGroup(),
355355
//drawRange: new Types.DrawRange(),
356-
_ref_geometry: new Types.ThreeType(['Geometry', 'BufferGeometry']),
356+
_ref_geometry: new Types.ThreeType(['BaseGeometry', 'BaseBufferGeometry']),
357357
},
358358
},
359359
InstancedBufferAttribute: {
@@ -366,7 +366,7 @@ module.exports = {
366366
},
367367
InstancedBufferGeometry: {
368368
relativePath: './core/InstancedBufferGeometry',
369-
superClass: 'PlainBufferGeometry',
369+
superClass: 'BufferGeometry',
370370
properties: {
371371
maxInstancedCount: new Types.Int(null, {nullable: true}),
372372
},
@@ -1088,7 +1088,7 @@ module.exports = {
10881088
constructorArgs: [ 'geometry', 'material' ],
10891089
properties: {
10901090
material: new Types.ThreeType('Material'),
1091-
geometry: new Types.ThreeType(['Geometry', 'BufferGeometry']),
1091+
geometry: new Types.ThreeType(['BaseGeometry', 'BaseBufferGeometry']),
10921092
}
10931093
},
10941094
LineLoop: {
@@ -1107,7 +1107,7 @@ module.exports = {
11071107
constructorArgs: [ 'geometry', 'material' ],
11081108
properties: {
11091109
material: new Types.ThreeTypeArray('Material', {nullable: false, allow_single: true}),
1110-
geometry: new Types.ThreeType(['Geometry', 'BufferGeometry'], {nullable: false}),
1110+
geometry: new Types.ThreeType(['BaseGeometry', 'BaseBufferGeometry'], {nullable: false}),
11111111
drawMode: new Types.Enum('DrawModes', 'TrianglesDrawMode'),
11121112
morphTargetInfluences: new Types.Array(),
11131113
},
@@ -1119,7 +1119,7 @@ module.exports = {
11191119
constructorArgs: [ 'geometry', 'material' ],
11201120
properties: {
11211121
material: new Types.ThreeType('Material', {nullable: false}),
1122-
geometry: new Types.ThreeType(['Geometry', 'BufferGeometry'], {nullable: false}),
1122+
geometry: new Types.ThreeType(['BaseGeometry', 'BaseBufferGeometry'], {nullable: false}),
11231123
},
11241124
},
11251125
Skeleton: {
@@ -1393,7 +1393,7 @@ module.exports = {
13931393
},
13941394
BoxBufferGeometry: {
13951395
relativePath: './geometries/BoxGeometry',
1396-
superClass: 'BufferGeometry',
1396+
superClass: 'BaseBufferGeometry',
13971397
constructorArgs: [ 'width', 'height', 'depth', 'widthSegments', 'heightSegments', 'depthSegments' ],
13981398
properties: {
13991399
width: new Types.Float(10.0),
@@ -1406,7 +1406,7 @@ module.exports = {
14061406
},
14071407
BoxGeometry: {
14081408
relativePath: './geometries/BoxGeometry',
1409-
superClass: 'Geometry',
1409+
superClass: 'BaseGeometry',
14101410
constructorArgs: [ 'width', 'height', 'depth', 'widthSegments', 'heightSegments', 'depthSegments' ],
14111411
properties: {
14121412
width: new Types.Float(10.0),
@@ -1419,7 +1419,7 @@ module.exports = {
14191419
},
14201420
CircleBufferGeometry: {
14211421
relativePath: './geometries/CircleGeometry',
1422-
superClass: 'BufferGeometry',
1422+
superClass: 'BaseBufferGeometry',
14231423
constructorArgs: [ 'radius', 'segments', 'thetaStart', 'thetaLength' ],
14241424
properties: {
14251425
radius: new Types.Float(50.0),
@@ -1430,7 +1430,7 @@ module.exports = {
14301430
},
14311431
CircleGeometry: {
14321432
relativePath: './geometries/CircleGeometry',
1433-
superClass: 'Geometry',
1433+
superClass: 'BaseGeometry',
14341434
constructorArgs: [ 'radius', 'segments', 'thetaStart', 'thetaLength' ],
14351435
properties: {
14361436
radius: new Types.Float(50.0),
@@ -1441,7 +1441,7 @@ module.exports = {
14411441
},
14421442
ConeGeometry: {
14431443
relativePath: './geometries/ConeGeometry',
1444-
superClass: 'Geometry',
1444+
superClass: 'BaseGeometry',
14451445
constructorArgs: ['radius', 'height', 'radialSegments', 'heightSegments', 'openEnded', 'thetaStart', 'thetaLength'],
14461446
properties: {
14471447
radius: new Types.Float(20.0),
@@ -1455,7 +1455,7 @@ module.exports = {
14551455
},
14561456
CylinderBufferGeometry: {
14571457
relativePath: './geometries/CylinderGeometry',
1458-
superClass: 'BufferGeometry',
1458+
superClass: 'BaseBufferGeometry',
14591459
constructorArgs: [ 'radiusTop', 'radiusBottom', 'height', 'radiusSegments', 'heightSegments', 'openEnded', 'thetaStart', 'thetaLength' ],
14601460
properties: {
14611461
radiusTop: new Types.Float(20.0),
@@ -1470,7 +1470,7 @@ module.exports = {
14701470
},
14711471
CylinderGeometry: {
14721472
relativePath: './geometries/CylinderGeometry',
1473-
superClass: 'Geometry',
1473+
superClass: 'BaseGeometry',
14741474
constructorArgs: [ 'radiusTop', 'radiusBottom', 'height', 'radiusSegments', 'heightSegments', 'openEnded', 'thetaStart', 'thetaLength' ],
14751475
properties: {
14761476
radiusTop: new Types.Float(20.0),
@@ -1485,7 +1485,7 @@ module.exports = {
14851485
},
14861486
DodecahedronGeometry: {
14871487
relativePath: './geometries/DodecahedronGeometry',
1488-
superClass: 'Geometry',
1488+
superClass: 'BaseGeometry',
14891489
constructorArgs: [ 'radius', 'detail' ],
14901490
properties: {
14911491
radius: new Types.Float(1.0),
@@ -1495,16 +1495,16 @@ module.exports = {
14951495
// TODO:
14961496
EdgesGeometry: {
14971497
relativePath: './geometries/EdgesGeometry',
1498-
superClass: 'Geometry',
1498+
superClass: 'BaseGeometry',
14991499
},
15001500
// TODO:
15011501
ExtrudeGeometry: {
15021502
relativePath: './geometries/ExtrudeGeometry',
1503-
superClass: 'Geometry',
1503+
superClass: 'BaseGeometry',
15041504
},
15051505
IcosahedronGeometry: {
15061506
relativePath: './geometries/IcosahedronGeometry',
1507-
superClass: 'Geometry',
1507+
superClass: 'BaseGeometry',
15081508
constructorArgs: [ 'radius', 'detail' ],
15091509
properties: {
15101510
radius: new Types.Float(1.0),
@@ -1513,7 +1513,7 @@ module.exports = {
15131513
},
15141514
LatheBufferGeometry: {
15151515
relativePath: './geometries/LatheGeometry',
1516-
superClass: 'BufferGeometry',
1516+
superClass: 'BaseBufferGeometry',
15171517
constructorArgs: [ 'points', 'segments', 'phiStart', 'phiLength' ],
15181518
properties: {
15191519
points: new Types.VectorArray(),
@@ -1524,7 +1524,7 @@ module.exports = {
15241524
},
15251525
LatheGeometry: {
15261526
relativePath: './geometries/LatheGeometry',
1527-
superClass: 'Geometry',
1527+
superClass: 'BaseGeometry',
15281528
constructorArgs: [ 'points', 'segments', 'phiStart', 'phiLength' ],
15291529
properties: {
15301530
points: new Types.VectorArray(),
@@ -1535,7 +1535,7 @@ module.exports = {
15351535
},
15361536
OctahedronGeometry: {
15371537
relativePath: './geometries/OctahedronGeometry',
1538-
superClass: 'Geometry',
1538+
superClass: 'BaseGeometry',
15391539
constructorArgs: [ 'radius', 'detail' ],
15401540
properties: {
15411541
radius: new Types.Float(1.0),
@@ -1544,7 +1544,7 @@ module.exports = {
15441544
},
15451545
ParametricGeometry: {
15461546
relativePath: './geometries/ParametricGeometry',
1547-
superClass: 'Geometry',
1547+
superClass: 'BaseGeometry',
15481548
constructorArgs: [ 'func', 'slices', 'stacks' ],
15491549
properties: {
15501550
func: new Types.Function(function(u,v) { return THREE.Vector3(); }),
@@ -1554,7 +1554,7 @@ module.exports = {
15541554
},
15551555
PlaneBufferGeometry: {
15561556
relativePath: './geometries/PlaneGeometry',
1557-
superClass: 'BufferGeometry',
1557+
superClass: 'BaseBufferGeometry',
15581558
constructorArgs: [ 'width', 'height', 'widthSegments', 'heightSegments' ],
15591559
properties: {
15601560
width: new Types.Float(10.0), // NOTE: default not specified in three.js
@@ -1565,7 +1565,7 @@ module.exports = {
15651565
},
15661566
PlaneGeometry: {
15671567
relativePath: './geometries/PlaneGeometry',
1568-
superClass: 'Geometry',
1568+
superClass: 'BaseGeometry',
15691569
constructorArgs: [ 'width', 'height', 'widthSegments', 'heightSegments' ],
15701570
properties: {
15711571
width: new Types.Float(10.0), // NOTE: default not specified in three.js
@@ -1576,7 +1576,7 @@ module.exports = {
15761576
},
15771577
PolyhedronGeometry: {
15781578
relativePath: './geometries/PolyhedronGeometry',
1579-
superClass: 'Geometry',
1579+
superClass: 'BaseGeometry',
15801580
constructorArgs: [ 'vertices', 'faces', 'radius', 'detail' ],
15811581
properties: {
15821582
vertices: new Types.Array(),
@@ -1588,7 +1588,7 @@ module.exports = {
15881588
},
15891589
RingBufferGeometry: {
15901590
relativePath: './geometries/RingGeometry',
1591-
superClass: 'BufferGeometry',
1591+
superClass: 'BaseBufferGeometry',
15921592
constructorArgs: [ 'innerRadius', 'outerRadius', 'thetaSegments', 'phiSegments', 'thetaStart', 'thetaLength' ],
15931593
properties: {
15941594
innerRadius: new Types.Float(0.0), // Docs: "Default is 0, but it doesn't work right when innerRadius is set to 0.
@@ -1601,7 +1601,7 @@ module.exports = {
16011601
},
16021602
RingGeometry: {
16031603
relativePath: './geometries/RingGeometry',
1604-
superClass: 'Geometry',
1604+
superClass: 'BaseGeometry',
16051605
constructorArgs: [ 'innerRadius', 'outerRadius', 'thetaSegments', 'phiSegments', 'thetaStart', 'thetaLength' ],
16061606
properties: {
16071607
innerRadius: new Types.Float(0.0), // Docs: "Default is 0, but it doesn't work right when innerRadius is set to 0.
@@ -1615,7 +1615,7 @@ module.exports = {
16151615
// TODO: figure out options constructor args + UVGenerator
16161616
ShapeGeometry: {
16171617
relativePath: './geometries/ShapeGeometry',
1618-
superClass: 'Geometry',
1618+
superClass: 'BaseGeometry',
16191619
constructorArgs: [ 'shapes' ],
16201620
properties: {
16211621
shapes: new Types.ThreeTypeArray('Shape'),
@@ -1626,7 +1626,7 @@ module.exports = {
16261626
},
16271627
SphereBufferGeometry: {
16281628
relativePath: './geometries/SphereGeometry',
1629-
superClass: 'BufferGeometry',
1629+
superClass: 'BaseBufferGeometry',
16301630
constructorArgs: [ 'radius', 'widthSegments', 'heightSegments', 'phiStart', 'phiLength', 'thetaStart', 'thetaLength' ],
16311631
properties: {
16321632
radius: new Types.Float(50.0),
@@ -1640,7 +1640,7 @@ module.exports = {
16401640
},
16411641
SphereGeometry: {
16421642
relativePath: './geometries/SphereGeometry',
1643-
superClass: 'Geometry',
1643+
superClass: 'BaseGeometry',
16441644
constructorArgs: [ 'radius', 'widthSegments', 'heightSegments', 'phiStart', 'phiLength', 'thetaStart', 'thetaLength' ],
16451645
properties: {
16461646
radius: new Types.Float(50.0),
@@ -1654,7 +1654,7 @@ module.exports = {
16541654
},
16551655
TetrahedronGeometry: {
16561656
relativePath: './geometries/TetrahedronGeometry',
1657-
superClass: 'Geometry',
1657+
superClass: 'BaseGeometry',
16581658
constructorArgs: [ 'radius', 'detail' ],
16591659
properties: {
16601660
radius: new Types.Float(1),
@@ -1664,11 +1664,11 @@ module.exports = {
16641664
// TODO:
16651665
TextGeometry: {
16661666
relativePath: './geometries/TextGeometry',
1667-
superClass: 'Geometry',
1667+
superClass: 'BaseGeometry',
16681668
},
16691669
TorusBufferGeometry: {
16701670
relativePath: './geometries/TorusGeometry',
1671-
superClass: 'BufferGeometry',
1671+
superClass: 'BaseBufferGeometry',
16721672
constructorArgs: [ 'radius', 'tube', 'radialSegments', 'tubularSegments', 'arc' ],
16731673
properties: {
16741674
radius: new Types.Float(100),
@@ -1680,7 +1680,7 @@ module.exports = {
16801680
},
16811681
TorusGeometry: {
16821682
relativePath: './geometries/TorusGeometry',
1683-
superClass: 'Geometry',
1683+
superClass: 'BaseGeometry',
16841684
constructorArgs: [ 'radius', 'tube', 'radialSegments', 'tubularSegments', 'arc' ],
16851685
properties: {
16861686
radius: new Types.Float(100),
@@ -1692,7 +1692,7 @@ module.exports = {
16921692
},
16931693
TorusKnotBufferGeometry: {
16941694
relativePath: './geometries/TorusKnotGeometry',
1695-
superClass: 'BufferGeometry',
1695+
superClass: 'BaseBufferGeometry',
16961696
constructorArgs: [ 'radius', 'tube', 'tubularSegments', 'radialSegments', 'p', 'q' ],
16971697
properties: {
16981698
radius: new Types.Float(100),
@@ -1705,7 +1705,7 @@ module.exports = {
17051705
},
17061706
TorusKnotGeometry: {
17071707
relativePath: './geometries/TorusKnotGeometry',
1708-
superClass: 'Geometry',
1708+
superClass: 'BaseGeometry',
17091709
constructorArgs: [ 'radius', 'tube', 'tubularSegments', 'radialSegments', 'p', 'q' ],
17101710
properties: {
17111711
radius: new Types.Float(100),
@@ -1718,7 +1718,7 @@ module.exports = {
17181718
},
17191719
TubeGeometry: {
17201720
relativePath: './geometries/TubeGeometry',
1721-
superClass: 'Geometry',
1721+
superClass: 'BaseGeometry',
17221722
constructorArgs: [ 'path', 'segments', 'radius', 'radiusSegments', 'close' ],
17231723
properties: {
17241724
path: new Types.ThreeType('Curve'),
@@ -1730,10 +1730,10 @@ module.exports = {
17301730
},
17311731
WireframeGeometry: {
17321732
relativePath: './geometries/WireframeGeometry',
1733-
superClass: 'Geometry',
1733+
superClass: 'BaseGeometry',
17341734
constructorArgs: [ 'geometry' ],
17351735
properties: {
1736-
geometry: new Types.ThreeType(['Geometry', 'BufferGeometry']),
1736+
geometry: new Types.ThreeType(['BaseGeometry', 'BaseBufferGeometry']),
17371737
},
17381738
},
17391739
ArrowHelper: {

0 commit comments

Comments
 (0)