61 lines
1.4 KiB
JavaScript
61 lines
1.4 KiB
JavaScript
/**
|
|
* BoneWeight Superset
|
|
* @constructor
|
|
* @param graphics GameLib.GraphicsRuntime
|
|
* @param apiBoneWeight GameLib.D3.API.BoneWeight
|
|
*/
|
|
GameLib.D3.BoneWeight = function (
|
|
graphics,
|
|
apiBoneWeight
|
|
) {
|
|
this.graphics = graphics;
|
|
this.graphics.isNotThreeThrow();
|
|
|
|
if (GameLib.Utils.UndefinedOrNull(apiBoneWeight)) {
|
|
apiBoneWeight = {};
|
|
}
|
|
|
|
GameLib.D3.API.BoneWeight.call(
|
|
this,
|
|
apiBoneWeight.boneIndex,
|
|
apiBoneWeight.weight
|
|
);
|
|
};
|
|
|
|
GameLib.D3.BoneWeight.prototype = Object.create(GameLib.Component.prototype);
|
|
GameLib.D3.BoneWeight.prototype.constructor = GameLib.D3.BoneWeight;
|
|
|
|
/**
|
|
* Converts a GameLib.D3.BoneWeight to GameLib.D3.API.BoneWeight
|
|
* @returns {GameLib.D3.API.BoneWeight}
|
|
*/
|
|
GameLib.D3.BoneWeight.prototype.toApiObject = function() {
|
|
|
|
var apiBoneWeight = new GameLib.D3.API.BoneWeight(
|
|
this.boneIndex,
|
|
this.weight
|
|
);
|
|
|
|
return apiBoneWeight;
|
|
};
|
|
|
|
/**
|
|
* Returns a GameLib.D3.BoneWeight from a boneWeight Object
|
|
* @param graphics GameLib.GraphicsRuntime
|
|
* @param objectBoneWeight Object
|
|
* @returns {GameLib.D3.BoneWeight}
|
|
* @constructor
|
|
*/
|
|
GameLib.D3.BoneWeight.FromObject = function(
|
|
graphics,
|
|
objectBoneWeight
|
|
) {
|
|
var apiBoneWeight = GameLib.D3.API.BoneWeight.FromObject(objectBoneWeight);
|
|
|
|
var boneWeight = new GameLib.D3.BoneWeight(
|
|
graphics,
|
|
apiBoneWeight
|
|
);
|
|
|
|
return boneWeight;
|
|
}; |