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

Fixed AWDLoader.

上级 885eb52d
......@@ -735,8 +735,8 @@ THREE.AWDLoader = (function (){
// ------------------
if ( str_type === 1 ) {
attrib = new THREE.Float32Attribute( ( str_len / 12 ) * 3, 3 );
buffer = attrib.array;
buffer = new Float32Array( ( str_len / 12 ) * 3 );
attrib = new THREE.BufferAttribute( buffer, 3 );
geom.addAttribute( 'position', attrib );
idx = 0;
......@@ -754,7 +754,8 @@ THREE.AWDLoader = (function (){
// -----------------
else if (str_type === 2) {
attrib = new THREE.Uint16Attribute( ( str_len / 2 ), 1 );
buffer = new Uint16Array( str_len / 2 );
attrib = new THREE.BufferAttribute( buffer, 1 );
geom.addAttribute( 'index', attrib );
geom.offsets.push({
......@@ -763,7 +764,6 @@ THREE.AWDLoader = (function (){
count: str_len/2
});
buffer = attrib.array;
idx = 0;
while (this._ptr < str_end) {
......@@ -778,8 +778,8 @@ THREE.AWDLoader = (function (){
// -------------------
else if (str_type === 3) {
attrib = new THREE.Float32Attribute( ( str_len / 8 ) * 2, 2 );
buffer = attrib.array;
buffer = new Float32Array( ( str_len / 8 ) * 2 );
attrib = new THREE.BufferAttribute( buffer, 2 );
geom.addAttribute( 'uv', attrib );
idx = 0;
......@@ -794,10 +794,10 @@ THREE.AWDLoader = (function (){
// NORMALS
else if (str_type === 4) {
attrib = new THREE.Float32Attribute( ( str_len / 12 ) * 3, 3 );
buffer = new Float32Array( ( str_len / 12 ) * 3 );
attrib = new THREE.BufferAttribute( buffer, 3 );
geom.addAttribute( 'normal', attrib );
buffer = attrib.array
idx = 0
idx = 0;
while (this._ptr < str_end) {
buffer[idx] = -this.readF32();
......@@ -1222,4 +1222,4 @@ THREE.AWDLoader = (function (){
return AWDLoader;
})();
\ No newline at end of file
})();
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册