VS plugin mod for Basic Armour
Révision | bbe8859b6c36d77a8b74486cc63ce7216b4ce603 (tree) |
---|---|
l'heure | 2019-05-17 14:58:25 |
Auteur | ![]() |
Commiter | melchior |
Head pitch+yaw; more working than not.
@@ -130,14 +130,22 @@ namespace ArmourMod | ||
130 | 130 | } |
131 | 131 | |
132 | 132 | if ( wornItemTuple.Key == EnumCharacterDressType.Head ) { |
133 | - //Apply Head pitch for helmets | |
133 | + //Apply Head pitch+yaw for helmets | |
134 | 134 | //ClientApi.World.Player.Entity.HeadPitch |
135 | + //ClientApi.World.Player.Entity.HeadYaw//Radians already? | |
136 | + | |
137 | + var headMatrix = Mat4f.Create( ); | |
138 | + Mat4f.Identity(headMatrix); | |
139 | + Mat4f.RotateY(headMatrix, headMatrix, ClientApi.World.Player.Entity.HeadYaw); | |
140 | + Mat4f.RotateZ(headMatrix, headMatrix, ClientApi.World.Player.Entity.HeadPitch); | |
141 | + | |
135 | 142 | armourModelMatrix |
136 | 143 | .Scale( armourData.Armour_Transform.ScaleXYZ.X, armourData.Armour_Transform.ScaleXYZ.Y, armourData.Armour_Transform.ScaleXYZ.Z ) |
137 | 144 | .Translate( attachPt.PosX / 16d + armourData.Armour_Transform.Translation.X, attachPt.PosY / 16d + armourData.Armour_Transform.Translation.Y, attachPt.PosZ / 16d + armourData.Armour_Transform.Translation.Z ) |
138 | 145 | .RotateX( (float)(attachPt.RotationX + armourData.Armour_Transform.Rotation.X) * GameMath.DEG2RAD ) |
139 | 146 | .RotateY( (float)(attachPt.RotationY + armourData.Armour_Transform.Rotation.Y) * GameMath.DEG2RAD ) |
140 | 147 | .RotateZ( (float)(attachPt.RotationZ + armourData.Armour_Transform.Rotation.Z) * GameMath.DEG2RAD ) |
148 | + .Mul(headMatrix) | |
141 | 149 | .Translate( -(armourData.Armour_Transform.Origin.X), -(armourData.Armour_Transform.Origin.Y), -(armourData.Armour_Transform.Origin.Z) ); |
142 | 150 | } else |
143 | 151 | { |