better skeleton and bone creation
parent
904fc77407
commit
1147f6d1d5
|
@ -60,11 +60,12 @@ R3.D3.Mesh = function (
|
|||
}.bind(this)
|
||||
);
|
||||
|
||||
if (this.skeleton) {
|
||||
this.skeleton = new R3.D3.Skeleton(
|
||||
this.graphics,
|
||||
this.skeleton
|
||||
);
|
||||
if (
|
||||
R3.Utils.Defined(this.skeleton) &&
|
||||
R3.Utils.Defined(this.skeleton.componentType) &&
|
||||
!(this.skeleton instanceof R3.D3.Skeleton)
|
||||
) {
|
||||
this.skeleton = R3.Component.ConstructFromObject(this.skeleton);
|
||||
}
|
||||
|
||||
this.cloneDirection = new R3.Vector3(
|
||||
|
|
|
@ -29,17 +29,15 @@ R3.D3.Skeleton = function Skeleton(
|
|||
apiSkeleton.parentEntity
|
||||
);
|
||||
|
||||
|
||||
this.bones = this.bones.map(
|
||||
function(apiBone) {
|
||||
|
||||
if (apiBone instanceof R3.D3.API.Bone) {
|
||||
return new R3.D3.Bone(
|
||||
this.graphics,
|
||||
apiBone
|
||||
)
|
||||
} else {
|
||||
console.warn('apiBone not an instance of API.Bone');
|
||||
throw new Error('apiBone not an instance of API.Bone');
|
||||
if (
|
||||
R3.Utils.Defined(apiBone.componentType) &&
|
||||
!(apiBone instanceof R3.D3.Bone)
|
||||
) {
|
||||
return R3.Component.ConstructFromObject(apiBone);
|
||||
}
|
||||
|
||||
}.bind(this)
|
||||
|
|
|
@ -30,10 +30,10 @@ R3.D3.Vertex = function Vertex(
|
|||
this.boneWeights = this.boneWeights.map(
|
||||
function(boneWeight) {
|
||||
return new R3.Vector4(
|
||||
this.graphics,
|
||||
this.implementation,
|
||||
boneWeight
|
||||
)
|
||||
}
|
||||
}.bind(this)
|
||||
);
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue