Bone-attachment fix for first person
This commit is contained in:
parent
935fd54a9b
commit
b70e7645fd
@ -238,7 +238,7 @@
|
||||
"equipPointId" : "handRight",
|
||||
"bone" : "Hand.R",
|
||||
"firstPersonBone" : "hand.R",
|
||||
"offsetVectorFirstPerson" : [-0.05,0.04,-0.09],
|
||||
"offsetVectorFirstPerson" : [-0.01,-0.05,-0.10],
|
||||
"offsetVectorThirdPerson" : [0.02,-0.06,0],
|
||||
"offsetRotationThirdPerson" : [-0.334,0.145,-0.28,0.89],
|
||||
"offsetRotationFirstPerson" : [0.02,-0.977,-0.211,-0.005],
|
||||
|
||||
@ -309,10 +309,11 @@ public class AttachUtils {
|
||||
Vector3d facingVector
|
||||
){
|
||||
//transform bone space
|
||||
Vector3d position = new Vector3d(bonePosition);
|
||||
position = position.add(offsetVector);
|
||||
Vector3d position = new Vector3d(offsetVector);
|
||||
position = position.rotate(new Quaterniond(boneRotation));
|
||||
position = position.add(bonePosition);
|
||||
position = position.mul(parentScale);
|
||||
position = position.rotate(new Quaterniond(parentRotation.x,parentRotation.y,parentRotation.z,parentRotation.w));
|
||||
position = position.rotate(new Quaterniond(parentRotation));
|
||||
//transform worldspace
|
||||
position.add(parentPosition);
|
||||
//set
|
||||
@ -324,7 +325,8 @@ public class AttachUtils {
|
||||
}
|
||||
//calculate rotation of model
|
||||
EntityUtils.getRotation(child)
|
||||
.rotationTo(MathUtils.getOriginVector(), new Vector3d(facingAngle.x,facingAngle.y,facingAngle.z))
|
||||
.identity()
|
||||
.mul(parentRotation)
|
||||
.mul(boneRotation)
|
||||
.mul(offsetRotation)
|
||||
.normalize();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user