This repository has been archived by the owner on Jul 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into release/2.3
- Loading branch information
Showing
32 changed files
with
1,286 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import DocInfo from '../DocInfo'; | ||
|
||
class bufferGeometry extends DocInfo { | ||
getIntro() { | ||
return 'Creates a [THREE.BufferGeometry](http://threejs.org/docs/#Reference/Core/BufferGeometry)'; | ||
} | ||
|
||
getDescription() { | ||
return ''; | ||
} | ||
|
||
getAttributesText() { | ||
return { | ||
name: '', | ||
resourceId: '', | ||
position: '', | ||
normal: '', | ||
color: '', | ||
index: '', | ||
}; | ||
} | ||
} | ||
|
||
module.exports = bufferGeometry; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import geometry from './geometry'; | ||
|
||
class shapeGeometry extends geometry { | ||
getIntro() { | ||
return 'Creates a [THREE.ShapeGeometry](https://threejs.org/docs/#Reference/Geometries/ShapeGeometry)'; | ||
} | ||
|
||
getAttributesText() { | ||
return { | ||
...super.getAttributesText(), | ||
|
||
shapes: 'Array of shapes, or a single shape THREE.Shape', | ||
curveSegments: 'Default is 12 (not used in three.js at the moment)', | ||
material: 'Index of the material in a material list', | ||
UVGenerator: 'A UV generator, defaults to ExtrudeGeometry\'s WorldUVGenerator', | ||
}; | ||
} | ||
} | ||
|
||
module.exports = shapeGeometry; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import THREE from 'three'; | ||
import PropTypes from 'react/lib/ReactPropTypes'; | ||
|
||
import GeometryDescriptorBase from './GeometryDescriptorBase'; | ||
import propTypeInstanceOf from '../../utils/propTypeInstanceOf'; | ||
|
||
class BufferGeometryDescriptor extends GeometryDescriptorBase { | ||
constructor(react3RendererInstance) { | ||
super(react3RendererInstance); | ||
|
||
[ | ||
'vertices', | ||
'colors', | ||
'faceVertexUvs', | ||
'faces', | ||
'dynamic', | ||
].forEach(propName => { | ||
this.removeProp(propName); | ||
}); | ||
|
||
[ | ||
'position', | ||
'normal', | ||
'color', | ||
].forEach(attributeName => { | ||
this.hasProp(attributeName, { | ||
type: PropTypes.oneOfType([ | ||
propTypeInstanceOf(THREE.BufferAttribute), | ||
propTypeInstanceOf(THREE.InterleavedBufferAttribute), | ||
]), | ||
update(threeObject, attributeValue) { | ||
if (attributeValue) { | ||
threeObject.addAttribute(attributeName, attributeValue); | ||
} else { | ||
threeObject.removeAttribute(attributeName); | ||
} | ||
}, | ||
updateInitial: true, | ||
default: undefined, | ||
}); | ||
}); | ||
|
||
this.hasProp('index', { | ||
type: PropTypes.oneOfType([ | ||
propTypeInstanceOf(THREE.BufferAttribute), | ||
propTypeInstanceOf(THREE.InterleavedBufferAttribute), | ||
]), | ||
update(threeObject, attributeValue) { | ||
threeObject.setIndex(attributeValue); | ||
}, | ||
updateInitial: true, | ||
default: undefined, | ||
}); | ||
} | ||
|
||
construct() { | ||
return new THREE.BufferGeometry(); | ||
} | ||
} | ||
|
||
module.exports = BufferGeometryDescriptor; |
Oops, something went wrong.