qq.webglPlus
为提升3D游戏性能,我们新增了 WebGLPlus 相关接口。通过 qq.webglPlus 获取 WebglPlus 单例对象,以进行动画、裁剪等高性能计算调用,只允许在主域调用,从基础库1.8.0、LayaAir2.3.0版本后开始支持。
返回值
WebGLPlus单例对象
WebGLPlus
WebGL高性能渲染运算对象
属性
骨骼动画关键帧
骨骼动画浮点数组关键帧
骨骼动画关键帧节点
conchKeyframeNode 数组
conchFloatArrayKeyframe
骨骼动画浮点数组关键帧
属性
number time
时间属性
Float32Array data
当关键帧为3维向量时数据为[inTangent.x,inTangent.y,inTangent.z,outTangent.x,outTangent.y,outTangent.z,value.x,value.y,value.z],当关键帧为4维向量时数据为[inTangent.x,inTangent.y,inTangent.z,inTangent.w,outTangent.x,outTangent.y,outTangent.z,outTangent.w,value.x,value.y,value.z,value.w]
方法
克隆生成新 conchFloatArrayKeyframe 实例
克隆本实例到另一个 conchFloatArrayKeyframe 实例
.clone
克隆生成新 conchFloatArrayKeyframe 实例
返回值
conchFloatKeyframe
和当前 conchFloatKeyframe 实例一样的新实例
.cloneTo
克隆本实例到另一个 conchFloatArrayKeyframe 实例
参数
要克隆的目标实例
conchKeyframeNode
骨骼动画关键帧节点
属性
Any data
关键帧数据,根据type决定类型
number type
数据类型,0位number,1位Float32Array
number indexInList
索引
string fullPath
全路径
string propertyOwner
属性精灵路径
number propertyCount
属性数量
number ownerPathCount
精灵路径数量
number keyFramesCount
帧数量
方法
获取精灵路径数量
设置精灵路径数量
获取属性数量
设置属性数量
获取帧数量
设置帧数量
通过索引获取精灵路径
通过索引设置精灵路径
通过索引获取属性
通过索引设置属性
通过sep拼接精灵路径
通过sep拼接属性
通过索引设置帧
.getOwnerPathCount
number conchKeyframeNode.getOwnerPathCount()
获取精灵路径数量
返回值
number
精灵路径数量
._setOwnerPathCount
conchKeyframeNode._setOwnerPathCount(number value)
设置精灵路径数量
参数
number value
精灵路径数量
.getPropertyCount
number conchKeyframeNode.getPropertyCount()
获取属性数量
返回值
number
属性数量
._setPropertyCount
conchKeyframeNode._setPropertyCount(number value)
设置属性数量
参数
number value
属性数量
.getKeyFramesCount
number conchKeyframeNode.getKeyFramesCount()
获取帧数量
返回值
number
帧数量
._setKeyframeCount
conchKeyframeNode._setKeyframeCount(number value)
设置帧数量
返回值
number value
帧数量
.getOwnerPathByIndex
string conchKeyframeNode.getOwnerPathByIndex(number index)
通过索引获取精灵路径
参数
number index
索引
返回值
string
索引对应的精灵路径
._setOwnerPathByIndex
conchKeyframeNode._setOwnerPathByIndex(number index, string value)
通过索引设置精灵路径
参数
number index
索引
string value
精灵路径
.getPropertyByIndex
string conchKeyframeNode.getPropertyByIndex(number index)
通过索引获取属性
参数
number index
索引
返回值
string
索引对应的属性
._setPropertyByIndex
conchKeyframeNode._setPropertyByIndex(number index, string value)
通过索引设置属性
参数
number index
索引
string value
属性
._joinOwnerPath
string conchKeyframeNode._joinOwnerPath(string sep)
通过sep拼接精灵路径
参数
string sep
分隔符
返回值
string
拼接精灵路径
._joinProperty
string conchKeyframeNode._joinProperty(string sep)
通过sep拼接属性
参数
string sep
分隔符
返回值
string
拼接属性
._setKeyframeByIndex
conchKeyframeNode._setKeyframeByIndex(number index, Ojbect keyframe)
通过索引设置帧
参数
number index
索引
Object keyframe
keyframe 帧
keyframe 的合法类型
| 类型 | 说明 |
| conchFloatArrayKeyframe | 浮点数组关键帧 |
| conchFloatKeyframe | 浮点关键帧 |
conchKeyframeNodeList
conchKeyframeNode 节点队列
属性
count
conchKeyframeNode 的数量
方法
获取索引为 index 的 conchKeyframeNode
设置索引 index 处的 conchKeyframeNode
.getNodeByIndex
conchKeyframeNode conchKeyframeNodeList.getNodeByIndex(number index)
获取索引为 index 的 conchKeyframeNode
参数
number index
索引
conchKeyframeNode
骨骼动画关键帧节点
.setNodeByIndex
conchKeyframeNodeList.setNodeByIndex(number index, conchKeyframeNode node)
设置索引 index 处的 conchKeyframeNode
参数
number index
索引
conchKeyframeNode node
骨骼动画关键帧节点
conchFloatKeyframe
浮点关键帧
属性
number time
时间属性
number inTangent
入切线
number outTangent
出切线
number value
值
方法
克隆生成新 conchFloatKeyframe 实例
克隆本实例到另一个 conchFloatKeyframe 实例
.clone
conchFloatKeyframe conchFloatKeyframe.clone()
克隆生成新 conchFloatKeyframe 实例
返回值
conchFloatKeyframe
新的 conchFloatKeyframe 实例
.cloneTo
conchFloatKeyframe.cloneTo(conchFloatKeyframe object)
克隆本实例到另一个 conchFloatKeyframe 实例
参数
conchFloatKeyframe object
要克隆的目标 conchFloatKeyframe 实例
GLCommandEncoder
指令集类,该指令集中包含了一个ArrayBuffer,可以进行动态扩充的指令集
方法
获得指令集的ID,传入该ID,在Runtime中可以获得指令集的内存数据
清空指令集数据
将shaderUniform的指令集压入指令流
.getPtrID
number GLCommandEncoder.getPtrID()
获得指令集的 ID,传入该 ID,在 Runtime 中可以获得指令集的内存数据
返回值
number
指令集ID
.clearEncoding
GLCommandEncoder.clearEncoding()
清空指令集数据
将 shaderUniform 的指令集压入指令流
参数
Object unifromInfo
| 属性 | 类型 | 默认值 | 必填 | 说明 |
| location | Object | 无 | 是 | uniformLocation |
| name | string | 无 | 是 | uniform 的名字 |
| isArray | boolean | false | 否 | 该uniform是数组还是单个数字 |
| type | number | 无 | 是 | INT、FLOAT、FLOAT_VEC2、FLOAT_MAT4等标准的webgl值 |
| dataOffset | number | 0 | 否 | 对应数据区的偏移值 |
| textureID | number | 无 | 是 | 对应的纹理ID |
ArrayBufferRef
ArrayBuffer扩展
属性
_ptrID
ArrayBuffer 的唯一标识