r3-legacy/src/game-lib-d3-api-bone.js

65 lines
1.3 KiB
JavaScript
Raw Normal View History

2016-10-14 12:32:53 +02:00
/**
* Bone Superset
* @param id
* @param name string
* @param boneId
* @param childBoneIds
* @param parentBoneId
* @param quaternion
* @param position
* @param rotation
2016-12-15 14:53:39 +01:00
* @param scale GameLib.API.Vector3
2016-10-14 12:32:53 +02:00
* @param up
* @constructor
*/
2016-12-02 13:00:56 +01:00
GameLib.D3.API.Bone = function Bone(
2016-10-14 12:32:53 +02:00
id,
boneId,
name,
childBoneIds,
parentBoneId,
quaternion,
position,
rotation,
scale,
up
) {
this.id = id;
this.name = name;
this.boneId = boneId;
if (typeof childBoneIds == 'undefined') {
childBoneIds = [];
}
this.childBoneIds = childBoneIds;
if (typeof parentBoneId == 'undefined') {
parentBoneId = null;
}
this.parentBoneId = parentBoneId;
if (typeof quaternion == 'undefined') {
2016-12-15 14:53:39 +01:00
quaternion = new GameLib.API.Quaternion();
2016-10-14 12:32:53 +02:00
}
this.quaternion = quaternion;
if (typeof position == 'undefined') {
2016-12-15 14:53:39 +01:00
position = new GameLib.API.Vector3(0,0,0);
2016-10-14 12:32:53 +02:00
}
this.position = position;
if (typeof rotation == 'undefined') {
2016-12-15 14:53:39 +01:00
rotation = new GameLib.API.Vector3(0,0,0);
2016-10-14 12:32:53 +02:00
}
this.rotation = rotation;
if (typeof scale == 'undefined') {
2016-12-15 14:53:39 +01:00
scale = new GameLib.API.Vector3(1,1,1);
2016-10-14 12:32:53 +02:00
}
this.scale = scale;
if (typeof up == 'undefined') {
2016-12-15 14:53:39 +01:00
up = new GameLib.API.Vector3(0,1,0);
2016-10-14 12:32:53 +02:00
}
this.up = up;
};