• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#windowsobjective-ccocoaqtpython誰得phprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

VS plugin mod for Basic Armour


Commit MetaInfo

Révisionbbe8859b6c36d77a8b74486cc63ce7216b4ce603 (tree)
l'heure2019-05-17 14:58:25
Auteurmelchior <melchior@user...>
Commitermelchior

Message de Log

Head pitch+yaw; more working than not.

Change Summary

Modification

--- a/ArmourMod/Armour/AmourMeshRenderer.cs
+++ b/ArmourMod/Armour/AmourMeshRenderer.cs
@@ -130,14 +130,22 @@ namespace ArmourMod
130130 }
131131
132132 if ( wornItemTuple.Key == EnumCharacterDressType.Head ) {
133- //Apply Head pitch for helmets
133+ //Apply Head pitch+yaw for helmets
134134 //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+
135142 armourModelMatrix
136143 .Scale( armourData.Armour_Transform.ScaleXYZ.X, armourData.Armour_Transform.ScaleXYZ.Y, armourData.Armour_Transform.ScaleXYZ.Z )
137144 .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 )
138145 .RotateX( (float)(attachPt.RotationX + armourData.Armour_Transform.Rotation.X) * GameMath.DEG2RAD )
139146 .RotateY( (float)(attachPt.RotationY + armourData.Armour_Transform.Rotation.Y) * GameMath.DEG2RAD )
140147 .RotateZ( (float)(attachPt.RotationZ + armourData.Armour_Transform.Rotation.Z) * GameMath.DEG2RAD )
148+ .Mul(headMatrix)
141149 .Translate( -(armourData.Armour_Transform.Origin.X), -(armourData.Armour_Transform.Origin.Y), -(armourData.Armour_Transform.Origin.Z) );
142150 } else
143151 {