mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-05 02:52:39 +08:00
animation in editor v3 (#3604)
* impl texture2d using imageasset * texture-cube * fix issue comment * remove initWithElement and initWithData; fix issue comment * define TextureUpdateOpts in gfx/texture-2d.js * optimize some `new ImageAsset`; optimize image-asset; add updateMipmaps() to Texture2D * use onLoaded, remove hack * animation in editor v3
This commit is contained in:
@@ -72,7 +72,7 @@ class Material extends Asset {
|
||||
_effect = null;
|
||||
|
||||
/**
|
||||
* @return {Effect}
|
||||
* @type {Effect}
|
||||
*/
|
||||
get effect() {
|
||||
return this._effect;
|
||||
|
||||
@@ -212,7 +212,7 @@ export default class Mesh extends Asset {
|
||||
/**
|
||||
* !#en
|
||||
* Submeshes count of this mesh.
|
||||
* @property {number}
|
||||
* @type {number}
|
||||
*/
|
||||
get subMeshCount() {
|
||||
this._lazyInitRenderResources();
|
||||
|
||||
@@ -56,7 +56,7 @@ export default class Skeleton extends Asset {
|
||||
|
||||
/**
|
||||
* Gets the bind pose matrices of joints.
|
||||
* @return {Mat4[]}
|
||||
* @type {Mat4[]}
|
||||
*/
|
||||
get bindposes() {
|
||||
return this._inverseBindMatrices;
|
||||
@@ -64,7 +64,7 @@ export default class Skeleton extends Asset {
|
||||
|
||||
/**
|
||||
* Sets the bind pose matrices of joints.
|
||||
* @param {Mat4[]} value
|
||||
* @type {Mat4[]}
|
||||
*/
|
||||
set bindposes(value) {
|
||||
this._inverseBindMatrices = value;
|
||||
@@ -72,7 +72,7 @@ export default class Skeleton extends Asset {
|
||||
|
||||
/**
|
||||
* Gets the paths of joints.
|
||||
* @return {string[]}
|
||||
* @type {string[]}
|
||||
*/
|
||||
get joints() {
|
||||
return this._joints;
|
||||
|
||||
@@ -68,7 +68,7 @@ export default class TextureCube extends TextureBase {
|
||||
/**
|
||||
* Gets the mipmap images.
|
||||
* Note that the result do not contains the auto generated mipmaps.
|
||||
* @return {Mipmap[]}
|
||||
* @type {Mipmap[]}
|
||||
*/
|
||||
get mipmaps() {
|
||||
return this._mipmaps;
|
||||
@@ -76,7 +76,7 @@ export default class TextureCube extends TextureBase {
|
||||
|
||||
/**
|
||||
* Sets the mipmaps images.
|
||||
* @param {Mipmap[]} value
|
||||
* @type {Mipmap[]}
|
||||
*/
|
||||
set mipmaps(value) {
|
||||
this._setMipmaps(value);
|
||||
@@ -84,7 +84,7 @@ export default class TextureCube extends TextureBase {
|
||||
|
||||
/**
|
||||
* Gets the mipmap image at level 0.
|
||||
* @return {Mipmap}
|
||||
* @type {Mipmap}
|
||||
*/
|
||||
get image() {
|
||||
return this._mipmaps.length === 0 ? null : this._mipmaps[0];
|
||||
@@ -92,7 +92,7 @@ export default class TextureCube extends TextureBase {
|
||||
|
||||
/**
|
||||
* Sets the mipmap images as a single mipmap image.
|
||||
* @param {Mipmap} value
|
||||
* @type {Mipmap}
|
||||
*/
|
||||
set image(value) {
|
||||
this.mipmaps = [value];
|
||||
|
||||
@@ -318,7 +318,7 @@ export default class AnimationComponent extends Component {
|
||||
* @property currentClip
|
||||
* @type {AnimationClip}
|
||||
*/
|
||||
@property(AnimationClip)
|
||||
@property({type:AnimationClip})
|
||||
currentClip = null;
|
||||
|
||||
/**
|
||||
@@ -328,7 +328,7 @@ export default class AnimationComponent extends Component {
|
||||
* @property playAutomatically
|
||||
* @type {Boolean}
|
||||
*/
|
||||
@property
|
||||
@property({type:Boolean})
|
||||
playAutomatically = false;
|
||||
|
||||
_preview = false;
|
||||
|
||||
@@ -251,13 +251,13 @@ export default class ForwardRenderer extends BaseRenderer {
|
||||
_drawSkinning(item) {
|
||||
let { model, defines } = item;
|
||||
|
||||
defines.USE_SKINNING = true;
|
||||
defines.USE_SKINNING.value = true;
|
||||
if (model._jointsTexture != null) {
|
||||
defines.USE_JOINTS_TEXTURE = true;
|
||||
defines.USE_JOINTS_TEXTURE.value = true;
|
||||
this._device.setTexture('_u_jointsTexture', model._jointsTexture, this._allocTextureUnit());
|
||||
this._device.setUniform('_u_jointsTextureSize', model._jointsTexture._width);
|
||||
} else if (model._jointsMatrixArray != null) {
|
||||
defines.USE_JOINTS_TEXTURE = false;
|
||||
defines.USE_JOINTS_TEXTURE.value = false;
|
||||
this._device.setUniform("_u_jointMatrices", model._jointsMatrixArray);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user