Files
cocos4/cocos/core/renderer/data-pool-manager.ts
T
Yun Hsiao Wu edd1189518 flexible skinning model (#6131)
* flexible skinning model

* skinning shader works on non-skinning models

* more opts

* UBO default values

* more opts

* update default joint

* more opts

* more opts

* unified skeletal animation component

* misc opts

* fix batched skinning model

* fix mesh interfaces

* texture buffer pool alignment

* move switch to skeletal animation component

* in-shader joint offset

* minor
2020-02-26 11:32:38 +08:00

37 lines
1.3 KiB
TypeScript

// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
import { AnimationClip } from '../animation/animation-clip';
import { Mesh, Skeleton } from '../assets';
import { GFXDevice } from '../gfx/device';
import { BoneSpaceBoundsInfo, JointsAnimationInfo, JointsTexturePool } from './models/skeletal-animation-utils';
export class DataPoolManager {
public jointsTexturePool: JointsTexturePool;
public jointsAnimationInfo: JointsAnimationInfo;
public boneSpaceBoundsInfo: BoneSpaceBoundsInfo;
constructor (device: GFXDevice) {
this.jointsTexturePool = new JointsTexturePool(device);
this.jointsAnimationInfo = new JointsAnimationInfo(device);
this.boneSpaceBoundsInfo = new BoneSpaceBoundsInfo();
}
public releaseMesh (mesh: Mesh) {
this.boneSpaceBoundsInfo.releaseMesh(mesh);
}
public releaseSkeleton (skeleton: Skeleton) {
this.jointsTexturePool.releaseSkeleton(skeleton);
this.boneSpaceBoundsInfo.releaseSkeleton(skeleton);
}
public releaseAnimationClip (clip: AnimationClip) {
this.jointsTexturePool.releaseAnimationClip(clip);
}
public clear () {
this.jointsTexturePool.clear();
this.jointsAnimationInfo.clear();
this.boneSpaceBoundsInfo.clear();
}
}