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

◆ IsClearSpotTest()

static bool Terraria.Collision.IsClearSpotTest ( Vector2 position,
float testMagnitude,
int Width,
int Height,
bool fallThrough = false,
bool fall2 = false,
int gravDir = 1,
bool checkCardinals = true,
bool checkSlopes = false )
inlinestatic

Definition at line 2656 of file Collision.cs.

2657 {
2658 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
2659 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
2660 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
2661 //IL_0013: Unknown result type (might be due to invalid IL or missing references)
2662 //IL_0014: Unknown result type (might be due to invalid IL or missing references)
2663 //IL_0015: Unknown result type (might be due to invalid IL or missing references)
2664 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
2665 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
2666 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
2667 //IL_00c4: Unknown result type (might be due to invalid IL or missing references)
2668 //IL_00ca: Unknown result type (might be due to invalid IL or missing references)
2669 //IL_00cf: Unknown result type (might be due to invalid IL or missing references)
2670 //IL_00d2: Unknown result type (might be due to invalid IL or missing references)
2671 //IL_00de: Unknown result type (might be due to invalid IL or missing references)
2672 //IL_00df: Unknown result type (might be due to invalid IL or missing references)
2673 //IL_00e7: Unknown result type (might be due to invalid IL or missing references)
2674 //IL_00ec: Unknown result type (might be due to invalid IL or missing references)
2675 //IL_0032: Unknown result type (might be due to invalid IL or missing references)
2676 //IL_0037: Unknown result type (might be due to invalid IL or missing references)
2677 //IL_003d: Unknown result type (might be due to invalid IL or missing references)
2678 //IL_0042: Unknown result type (might be due to invalid IL or missing references)
2679 //IL_0043: Unknown result type (might be due to invalid IL or missing references)
2680 //IL_0044: Unknown result type (might be due to invalid IL or missing references)
2681 //IL_0045: Unknown result type (might be due to invalid IL or missing references)
2682 //IL_004a: Unknown result type (might be due to invalid IL or missing references)
2683 //IL_0053: Unknown result type (might be due to invalid IL or missing references)
2684 //IL_0058: Unknown result type (might be due to invalid IL or missing references)
2685 //IL_00f6: Unknown result type (might be due to invalid IL or missing references)
2686 //IL_00fb: Unknown result type (might be due to invalid IL or missing references)
2687 //IL_0101: Unknown result type (might be due to invalid IL or missing references)
2688 //IL_0106: Unknown result type (might be due to invalid IL or missing references)
2689 //IL_0109: Unknown result type (might be due to invalid IL or missing references)
2690 //IL_011b: Unknown result type (might be due to invalid IL or missing references)
2691 //IL_011c: Unknown result type (might be due to invalid IL or missing references)
2692 //IL_0124: Unknown result type (might be due to invalid IL or missing references)
2693 //IL_0129: Unknown result type (might be due to invalid IL or missing references)
2694 //IL_0062: Unknown result type (might be due to invalid IL or missing references)
2695 //IL_0068: Unknown result type (might be due to invalid IL or missing references)
2696 //IL_006d: Unknown result type (might be due to invalid IL or missing references)
2697 //IL_006e: Unknown result type (might be due to invalid IL or missing references)
2698 //IL_006f: Unknown result type (might be due to invalid IL or missing references)
2699 //IL_0070: Unknown result type (might be due to invalid IL or missing references)
2700 //IL_0075: Unknown result type (might be due to invalid IL or missing references)
2701 //IL_007e: Unknown result type (might be due to invalid IL or missing references)
2702 //IL_0083: Unknown result type (might be due to invalid IL or missing references)
2703 //IL_0133: Unknown result type (might be due to invalid IL or missing references)
2704 //IL_0139: Unknown result type (might be due to invalid IL or missing references)
2705 //IL_013e: Unknown result type (might be due to invalid IL or missing references)
2706 //IL_0141: Unknown result type (might be due to invalid IL or missing references)
2707 //IL_014d: Unknown result type (might be due to invalid IL or missing references)
2708 //IL_014e: Unknown result type (might be due to invalid IL or missing references)
2709 //IL_0156: Unknown result type (might be due to invalid IL or missing references)
2710 //IL_015b: Unknown result type (might be due to invalid IL or missing references)
2711 //IL_008d: Unknown result type (might be due to invalid IL or missing references)
2712 //IL_0092: Unknown result type (might be due to invalid IL or missing references)
2713 //IL_0098: Unknown result type (might be due to invalid IL or missing references)
2714 //IL_009d: Unknown result type (might be due to invalid IL or missing references)
2715 //IL_009e: Unknown result type (might be due to invalid IL or missing references)
2716 //IL_009f: Unknown result type (might be due to invalid IL or missing references)
2717 //IL_00a0: Unknown result type (might be due to invalid IL or missing references)
2718 //IL_00a5: Unknown result type (might be due to invalid IL or missing references)
2719 //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
2720 //IL_00b3: Unknown result type (might be due to invalid IL or missing references)
2721 //IL_0165: Unknown result type (might be due to invalid IL or missing references)
2722 //IL_016a: Unknown result type (might be due to invalid IL or missing references)
2723 //IL_0170: Unknown result type (might be due to invalid IL or missing references)
2724 //IL_0175: Unknown result type (might be due to invalid IL or missing references)
2725 //IL_0178: Unknown result type (might be due to invalid IL or missing references)
2726 //IL_018a: Unknown result type (might be due to invalid IL or missing references)
2727 //IL_018b: Unknown result type (might be due to invalid IL or missing references)
2728 //IL_0193: Unknown result type (might be due to invalid IL or missing references)
2729 //IL_0198: Unknown result type (might be due to invalid IL or missing references)
2730 if (checkCardinals)
2731 {
2732 Vector2 vector2 = Vector2.UnitX * testMagnitude;
2733 if (TileCollision(position - vector2, vector2, Width, Height, fallThrough, fall2, gravDir) != vector2)
2734 {
2735 return false;
2736 }
2737 vector2 = -Vector2.UnitX * testMagnitude;
2738 if (TileCollision(position - vector2, vector2, Width, Height, fallThrough, fall2, gravDir) != vector2)
2739 {
2740 return false;
2741 }
2742 vector2 = Vector2.UnitY * testMagnitude;
2743 if (TileCollision(position - vector2, vector2, Width, Height, fallThrough, fall2, gravDir) != vector2)
2744 {
2745 return false;
2746 }
2747 vector2 = -Vector2.UnitY * testMagnitude;
2748 if (TileCollision(position - vector2, vector2, Width, Height, fallThrough, fall2, gravDir) != vector2)
2749 {
2750 return false;
2751 }
2752 }
2753 if (checkSlopes)
2754 {
2755 Vector2 vector = Vector2.UnitX * testMagnitude;
2756 Vector4 vector3 = default(Vector4);
2757 ((Vector4)(ref vector3))._002Ector(position, testMagnitude, 0f);
2758 if (SlopeCollision(position, vector, Width, Height, gravDir, fallThrough) != vector3)
2759 {
2760 return false;
2761 }
2762 vector = -Vector2.UnitX * testMagnitude;
2763 ((Vector4)(ref vector3))._002Ector(position, 0f - testMagnitude, 0f);
2764 if (SlopeCollision(position, vector, Width, Height, gravDir, fallThrough) != vector3)
2765 {
2766 return false;
2767 }
2768 vector = Vector2.UnitY * testMagnitude;
2769 ((Vector4)(ref vector3))._002Ector(position, 0f, testMagnitude);
2770 if (SlopeCollision(position, vector, Width, Height, gravDir, fallThrough) != vector3)
2771 {
2772 return false;
2773 }
2774 vector = -Vector2.UnitY * testMagnitude;
2775 ((Vector4)(ref vector3))._002Ector(position, 0f, 0f - testMagnitude);
2776 if (SlopeCollision(position, vector, Width, Height, gravDir, fallThrough) != vector3)
2777 {
2778 return false;
2779 }
2780 }
2781 return true;
2782 }
static Vector2 TileCollision(Vector2 Position, Vector2 Velocity, int Width, int Height, bool fallThrough=false, bool fall2=false, int gravDir=1)
static Vector4 SlopeCollision(Vector2 Position, Vector2 Velocity, int Width, int Height, float gravity=0f, bool fall=false)

References Terraria.Collision.SlopeCollision(), and Terraria.Collision.TileCollision().

Referenced by Terraria.Player.CanFitSpace(), and Terraria.Player.UpdateTouchingTiles().

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