TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ RotatedRelativePoint()

Vector2 Terraria.Player.RotatedRelativePoint ( Vector2 pos,
bool reverseRotation = false,
bool addGfxOffY = true )
inline

Takes an input position and returns the position adjusted to the players visual rotation and offset. This accounts for the player being shifted up or down and rotated while riding a mount, sitting in a chair, and sleeping.

Parameters
pos
reverseRotation
addGfxOffY
Returns

Definition at line 4740 of file Player.cs.

4741 {
4742 //IL_002c: Unknown result type (might be due to invalid IL or missing references)
4743 //IL_003c: Unknown result type (might be due to invalid IL or missing references)
4744 //IL_0041: Unknown result type (might be due to invalid IL or missing references)
4745 //IL_0046: Unknown result type (might be due to invalid IL or missing references)
4746 //IL_005f: Unknown result type (might be due to invalid IL or missing references)
4747 //IL_006b: Unknown result type (might be due to invalid IL or missing references)
4748 //IL_0074: Unknown result type (might be due to invalid IL or missing references)
4749 //IL_007a: Unknown result type (might be due to invalid IL or missing references)
4750 //IL_007c: Unknown result type (might be due to invalid IL or missing references)
4751 //IL_0081: Unknown result type (might be due to invalid IL or missing references)
4752 //IL_0086: Unknown result type (might be due to invalid IL or missing references)
4753 //IL_009b: Unknown result type (might be due to invalid IL or missing references)
4754 //IL_009c: Unknown result type (might be due to invalid IL or missing references)
4755 //IL_009d: Unknown result type (might be due to invalid IL or missing references)
4756 //IL_009e: Unknown result type (might be due to invalid IL or missing references)
4757 //IL_00a7: Unknown result type (might be due to invalid IL or missing references)
4758 //IL_00ad: Unknown result type (might be due to invalid IL or missing references)
4759 //IL_00af: Unknown result type (might be due to invalid IL or missing references)
4760 //IL_00b4: Unknown result type (might be due to invalid IL or missing references)
4761 //IL_00b9: Unknown result type (might be due to invalid IL or missing references)
4762 //IL_00ba: Unknown result type (might be due to invalid IL or missing references)
4763 //IL_00bf: Unknown result type (might be due to invalid IL or missing references)
4764 //IL_00dc: Unknown result type (might be due to invalid IL or missing references)
4765 //IL_00dd: Unknown result type (might be due to invalid IL or missing references)
4766 //IL_00df: Unknown result type (might be due to invalid IL or missing references)
4767 //IL_00e4: Unknown result type (might be due to invalid IL or missing references)
4768 //IL_011e: Unknown result type (might be due to invalid IL or missing references)
4769 //IL_0103: Unknown result type (might be due to invalid IL or missing references)
4770 //IL_0104: Unknown result type (might be due to invalid IL or missing references)
4771 //IL_010d: Unknown result type (might be due to invalid IL or missing references)
4772 //IL_0112: Unknown result type (might be due to invalid IL or missing references)
4773 //IL_0117: Unknown result type (might be due to invalid IL or missing references)
4774 //IL_011c: Unknown result type (might be due to invalid IL or missing references)
4775 float num = (reverseRotation ? (0f - fullRotation) : fullRotation);
4776 if (sleeping.isSleeping)
4777 {
4778 num = 0f;
4779 }
4780 Vector2 vector = base.Bottom + new Vector2(0f, gfxOffY);
4781 int num2 = mount.PlayerOffset / 2 + 4;
4782 Vector2 vector2 = new Vector2(0f, (float)(-num2)) + Utils.RotatedBy(new Vector2(0f, (float)num2), num);
4783 if (addGfxOffY)
4784 {
4785 pos.Y += gfxOffY;
4786 }
4787 pos = vector + (pos - vector).RotatedBy(num) + vector2;
4788 if (sleeping.isSleeping)
4789 {
4791 pos += posOffset;
4792 }
4793 if (sitting.isSitting)
4794 {
4796 pos += posOffset2 + new Vector2(0f, seatAdjustment);
4797 }
4798 return pos;
4799 }
PlayerSleepingHelper sleeping
Definition Player.cs:3011
PlayerSittingHelper sitting
Definition Player.cs:3009
float gfxOffY
An offset from the actual position of the player that will be added to the draw position....
Definition Player.cs:1814
float fullRotation
Definition Player.cs:1801
void GetSittingOffsetInfo(Player player, out Vector2 posOffset, out float seatAdjustment)
void GetSleepingOffsetInfo(Player player, out Vector2 posOffset)

References Terraria.Player.fullRotation, Terraria.GameContent.PlayerSittingHelper.GetSittingOffsetInfo(), Terraria.GameContent.PlayerSleepingHelper.GetSleepingOffsetInfo(), Terraria.Player.gfxOffY, Terraria.GameContent.PlayerSittingHelper.isSitting, Terraria.GameContent.PlayerSleepingHelper.isSleeping, Terraria.Utils.RotatedBy(), Terraria.Player.sitting, and Terraria.Player.sleeping.

Referenced by Terraria.Projectile.AI_019_Spears(), Terraria.Projectile.AI_075(), Terraria.Projectile.AI_140_MonkStaffT1(), Terraria.Projectile.AI_142_MonkStaffT2And3(), Terraria.Projectile.AI_158_GetHomeLocation(), Terraria.Projectile.AI_160_Kites(), Terraria.Projectile.AI_161_RapierStabs(), Terraria.Projectile.AI_190_NightsEdge(), Terraria.Projectile.AI_191_TrueNightsEdge(), Terraria.Player.GetPointOnSwungItemPath(), Terraria.Player.ItemCheck_EmitHeldItemLight(), Terraria.Player.ItemCheck_Shoot(), Terraria.Player.RotateRelativePoint(), Terraria.Player.TryUsingDiggerCart(), and Terraria.DelegateMethods.Mount.WolfMouthPosition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: