Files
cocos4/cocos/core/renderer/data-pool-manager.ts
T
Yun Hsiao Wu f7f6193f26 skinning model bounds (#5743)
* first try: skeleton bounds with scaling

* second try: bone space per joint bounds

* rendering data pool manager

* shadow culling

* better identity joint texture handle allocation

* fix batched skinning model material lost

after quitting animation editor

* unify local ubo binding
2019-11-19 18:13:49 +08:00

38 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 { AnimatedBoundsInfo, JointsAnimationInfo, JointsTexturePool } from './models/skeletal-animation-utils';
export class DataPoolManager {
public jointsTexturePool: JointsTexturePool;
public jointsAnimationInfo: JointsAnimationInfo;
public animatedBoundsInfo: AnimatedBoundsInfo;
constructor (device: GFXDevice) {
this.jointsTexturePool = new JointsTexturePool(device);
this.jointsAnimationInfo = new JointsAnimationInfo(device);
this.animatedBoundsInfo = new AnimatedBoundsInfo();
}
public releaseMesh (mesh: Mesh) {
this.animatedBoundsInfo.releaseMesh(mesh);
}
public releaseSkeleton (skeleton: Skeleton) {
this.jointsTexturePool.releaseSkeleton(skeleton);
this.animatedBoundsInfo.releaseSkeleton(skeleton);
}
public releaseAnimationClip (clip: AnimationClip) {
this.jointsTexturePool.releaseAnimationClip(clip);
this.animatedBoundsInfo.releaseAnimationClip(clip);
}
public clear () {
this.jointsTexturePool.clear();
this.jointsAnimationInfo.clear();
this.animatedBoundsInfo.clear();
}
}