2016-12-23 16:07:10 +01:00
|
|
|
/**
|
|
|
|
* BoneWeight Superset
|
|
|
|
* @constructor
|
|
|
|
* @param graphics GameLib.D3.Graphics
|
|
|
|
* @param apiBoneWeight GameLib.D3.API.BoneWeight
|
|
|
|
*/
|
2017-01-06 16:53:53 +01:00
|
|
|
GameLib.D3.BoneWeight = function (
|
2016-12-23 16:07:10 +01:00
|
|
|
graphics,
|
|
|
|
apiBoneWeight
|
|
|
|
) {
|
|
|
|
this.graphics = graphics;
|
|
|
|
this.graphics.isNotThreeThrow();
|
|
|
|
|
|
|
|
GameLib.D3.API.BoneWeight.call(
|
|
|
|
this,
|
|
|
|
apiBoneWeight.boneIndex,
|
|
|
|
apiBoneWeight.weight
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
GameLib.D3.BoneWeight.prototype = Object.create(GameLib.D3.API.BoneWeight.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.toApiBoneWeight = 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.D3.Graphics
|
|
|
|
* @param objectBoneWeight Object
|
|
|
|
* @returns {GameLib.D3.BoneWeight}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
GameLib.D3.BoneWeight.FromObjectBoneWeight = function(
|
|
|
|
graphics,
|
|
|
|
objectBoneWeight
|
|
|
|
) {
|
2017-01-06 16:53:53 +01:00
|
|
|
var apiBoneWeight = GameLib.D3.API.BoneWeight.FromObjectBoneWeight(objectBoneWeight);
|
2016-12-23 16:07:10 +01:00
|
|
|
|
|
|
|
var boneWeight = new GameLib.D3.BoneWeight(
|
|
|
|
graphics,
|
|
|
|
apiBoneWeight
|
|
|
|
);
|
|
|
|
|
|
|
|
return boneWeight;
|
|
|
|
};
|