Three.js源码学习(一)core/BufferAttribute

1,BufferAttribute

构造函数

BufferAttribute(array,itemSize,normalized)

属性

name

array

itemSize

count array未定义时,返回0,否则返回数组长度除项目长度

normalized

dynamic//默认false

updateRange//默认{offset:0,count:-1}

version//默认0

方法

set(value)

isBufferAttribute

onUploadCallback()

setArray(array)

setDynamic(value)

copy(source)//复制一份BufferAttribute对象

copyAt(index1,attribute,index2)//将从attribute中拷贝当前对象长度的数据

copyArray(array)

copyColorsArray(colors)//将colors颜色拷贝到当前对象的array中

copyVector2sArray(vectors)

copyVector3sArray(vectors)

copyVector4sArray(vectors)

set(value,offset)

getX(index)//获取第index个item.x

setX(index,x)//设置第index为x

getY(index)//获取第index个item.y

setY(index,y)

getZ(index)

setZ(index,z)

getW(index)

setW(index,w)

setXY(index,x,y)

setXYZ(index,x,y,z)

setXYZW(index,x,y,z,w)

onUpload(callback)//设置回调函数

clone()//返回一份拷贝对象

//BufferAttribute子类

Int8BufferAttribute(array,itemSize,normalized)

Unit8BufferAttribute(array,itemSize,normalized)

Uint8ClampedBufferAttribute( array, itemSize, normalized )

Int16BufferAttribute( array, itemSize, normalized )

Uint16BufferAttribute( array, itemSize, normalized )

Int32BufferAttribute( array, itemSize, normalized )

Uint32BufferAttribute( array, itemSize, normalized )

Float32BufferAttribute( array, itemSize, normalized )

Float64BufferAttribute( array, itemSize, normalized )

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 基础篇NumPy的主要对象是同种元素的多维数组。这是一个所有的元素都是一种类型、通过一个正整数元组索引的元素表格(...
    oyan99阅读 10,583评论 0 18
  • 先决条件 在阅读这个教程之前,你多少需要知道点python。如果你想从新回忆下,请看看Python Tutoria...
    舒map阅读 7,488评论 1 13
  • NumPy是Python中关于科学计算的一个类库,在这里简单介绍一下。 来源:https://docs.scipy...
    灰太狼_black阅读 5,033评论 0 5
  • 忆往昔 杨柳依依江水平 思心荡漾似曾经 数今朝 提笔诗满怀 物是人非两相汰
    瞿静阅读 1,081评论 0 1
  • 概述 之前闲着没事,就利用Github建了一个个人博客网站,效果还不错,今天就来分享一下.建立自己个人博客网站的好...
    MarcusLi阅读 11,052评论 1 12

友情链接更多精彩内容