mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
f7f6193f26
* 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
38 lines
1.3 KiB
TypeScript
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();
|
|
}
|
|
}
|