|
@@ -11,8 +11,13 @@ import {
|
|
|
Vector3,
|
|
|
} from 'three';
|
|
|
|
|
|
+function computeTangents() {
|
|
|
|
|
|
-function computeTangents( geometry, MikkTSpace, negateSign = true ) {
|
|
|
+ throw new Error( 'BufferGeometryUtils: computeTangents renamed to computeMikkTSpaceTangents.' );
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+function computeMikkTSpaceTangents( geometry, MikkTSpace, negateSign = true ) {
|
|
|
|
|
|
if ( ! MikkTSpace || ! MikkTSpace.isReady ) {
|
|
|
|
|
@@ -20,6 +25,12 @@ function computeTangents( geometry, MikkTSpace, negateSign = true ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ if ( ! geometry.hasAttribute( 'position' ) || ! geometry.hasAttribute( 'normal' ) || ! geometry.hasAttribute( 'uv' ) ) {
|
|
|
+
|
|
|
+ throw new Error( 'BufferGeometryUtils: Tangents require "position", "normal", and "uv" attributes.' );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
function getAttributeArray( attribute ) {
|
|
|
|
|
|
if ( attribute.normalized || attribute.isInterleavedBufferAttribute ) {
|
|
@@ -1110,6 +1121,7 @@ function mergeGroups( geometry ) {
|
|
|
|
|
|
export {
|
|
|
computeTangents,
|
|
|
+ computeMikkTSpaceTangents,
|
|
|
mergeBufferGeometries,
|
|
|
mergeBufferAttributes,
|
|
|
interleaveAttributes,
|