mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-06 19:42:39 +08:00
edd1189518
* 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
37 lines
1.3 KiB
TypeScript
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();
|
|
}
|
|
}
|