DragonBones / DragonBonesJS

DragonBones TypeScript / JavaScript Runtime
MIT License
764 stars 318 forks source link

ThreeJS 网格动画Bug~ [附带修复代码] #133

Open whh8162880 opened 4 years ago

whh8162880 commented 4 years ago

网格动画 生产 播放的时候显示异常

修复如下

ThreeSlot.ts line: 272

for (let i = 0, l = vertexCount; i < l; ++i) {

*let iD = i 2**

const vertex = ThreeFactory.create(ThreeFactory.POOL_TYPE_VECTOR3) as THREE.Vector3; const uv = ThreeFactory.create(ThreeFactory.POOL_TYPE_VECTOR2) as THREE.Vector2; vertices.push(vertex); uvs.push(uv); uv.set(

floatArray[uvOffset + iD],

floatArray[uvOffset + iD + 1]

); vertex.set(

*floatArray[vertexOffset + iD] scale,**

*floatArray[vertexOffset + iD + 1] scale,**

0.0 );

ThreeSlot.ts line:464

for (let i = 0, l = vertexCount 2; i < l; i += 2) { const x = floatArray[vertexOffset + i] scale + deformVertices[i]; const y = floatArray[vertexOffset + i + 1] * scale + deformVertices[i + 1];

const vertex = vertices[i / 2];

if (isSurface) { .......

**ThreeSlot.ts line 452

else if (hasDeform) {

geometry.verticesNeedUpdate = true;

const isSurface = this._parent._boneData.type !== BoneType.Bone;

whh8162880 commented 4 years ago

虽然不报错了 但是网格动画表现的还是没有egret好

FlySkyPie commented 1 year ago

I trying import some animation to Three.js runtime, and got glitch, this patch save the day!