提交 17ecdb8a 编写于 作者: M Mr.doob

BufferGeometry: Moved legacy code to Three.Legacy.

上级 9c35621a
......@@ -331,6 +331,52 @@ Object.defineProperties( THREE.BufferAttribute.prototype, {
}
} );
Object.defineProperties( THREE.BufferGeometry.prototype, {
drawcalls: {
get: function () {
console.error( 'THREE.BufferGeometry: .drawcalls has been renamed to .groups.' );
return this.groups;
}
},
offsets: {
get: function () {
console.warn( 'THREE.BufferGeometry: .offsets has been renamed to .groups.' );
return this.groups;
}
},
addIndex: {
value: function ( index ) {
console.warn( 'THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().' );
this.setIndex( index );
}
},
addDrawCall: {
value: function ( start, count, indexOffset ) {
if ( indexOffset !== undefined ) {
console.warn( 'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.' );
}
console.warn( 'THREE.BufferGeometry: .addDrawCall() is now .addGroup().' );
this.addGroup( start, count );
}
},
clearDrawCalls: {
value: function () {
console.warn( 'THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().' );
this.clearGroups();
}
},
computeTangents: {
value: function () {
console.warn( 'THREE.BufferGeometry: .computeTangents() has been removed.' );
}
},
computeOffsets: {
value: function () {
console.warn( 'THREE.BufferGeometry: .computeOffsets() has been removed.' );
}
}
} );
//
Object.defineProperties( THREE.Material.prototype, {
......
......@@ -30,13 +30,6 @@ THREE.BufferGeometry.prototype = {
constructor: THREE.BufferGeometry,
addIndex: function ( index ) {
console.warn( 'THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().' );
this.setIndex( index );
},
getIndex: function () {
return this.index;
......@@ -86,40 +79,6 @@ THREE.BufferGeometry.prototype = {
},
get drawcalls() {
console.error( 'THREE.BufferGeometry: .drawcalls has been renamed to .groups.' );
return this.groups;
},
get offsets() {
console.warn( 'THREE.BufferGeometry: .offsets has been renamed to .groups.' );
return this.groups;
},
addDrawCall: function ( start, count, indexOffset ) {
if ( indexOffset !== undefined ) {
console.warn( 'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.' );
}
console.warn( 'THREE.BufferGeometry: .addDrawCall() is now .addGroup().' );
this.addGroup( start, count );
},
clearDrawCalls: function () {
console.warn( 'THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().' );
this.clearGroups();
},
addGroup: function ( start, count, materialIndex ) {
this.groups.push( {
......@@ -818,18 +777,6 @@ THREE.BufferGeometry.prototype = {
},
computeTangents: function () {
console.warn( 'THREE.BufferGeometry: .computeTangents() has been removed.' );
},
computeOffsets: function ( size ) {
console.warn( 'THREE.BufferGeometry: .computeOffsets() has been removed.' );
},
merge: function ( geometry, offset ) {
if ( geometry instanceof THREE.BufferGeometry === false ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册