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

BufferGeometry: Implemented .center()

上级 abb1b9ef
......@@ -84,13 +84,13 @@ THREE.BufferGeometry.prototype = {
}
if ( this.boundingBox instanceof THREE.Box3 ) {
if ( this.boundingBox !== null ) {
this.computeBoundingBox();
}
if ( this.boundingSphere instanceof THREE.Sphere ) {
if ( this.boundingSphere !== null ) {
this.computeBoundingSphere();
......@@ -100,7 +100,13 @@ THREE.BufferGeometry.prototype = {
center: function () {
// TODO
this.computeBoundingBox();
var offset = this.boundingBox.center().negate();
this.applyMatrix( new THREE.Matrix4().setPosition( offset ) );
return offset;
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册