tModLoader  0.12 Alpha
A mod to make and play Terraria mods
Terraria.Collision Class Reference

Public Member Functions

bool SwitchTilesNew (Vector2 Position, int Width, int Height, Vector2 oldPosition, int objType)
 

Static Public Member Functions

static Vector2 AdvancedTileCollision (bool[] forcedIgnoredTiles, Vector2 Position, Vector2 Velocity, int Width, int Height, bool fallThrough=false, bool fall2=false, int gravDir=1)
 
static void AimingLaserScan (Vector2 startPoint, Vector2 endPoint, float samplingWidth, int samplesToTake, out Vector2 vectorTowardsTarget, out float[] samples)
 
static Vector2 AnyCollision (Vector2 Position, Vector2 Velocity, int Width, int Height, bool evenActuated=false)
 
static Vector2 AnyCollisionWithSpecificTiles (Vector2 Position, Vector2 Velocity, int Width, int Height, bool[] tilesWeCanCollideWithByType, bool evenActuated=false)
 
static bool CanHit (Entity source, Entity target)
 
static bool CanHit (Entity source, NPCAimedTarget target)
 
static bool CanHit (Vector2 Position1, int Width1, int Height1, Vector2 Position2, int Width2, int Height2)
 
static bool CanHitLine (Vector2 Position1, int Width1, int Height1, Vector2 Position2, int Width2, int Height2)
 
static bool CanHitWithCheck (Vector2 Position1, int Width1, int Height1, Vector2 Position2, int Width2, int Height2, Utils.TileActionAttempt check)
 
static bool CheckAABBvAABBCollision (Vector2 position1, Vector2 dimensions1, Vector2 position2, Vector2 dimensions2)
 
static bool CheckAABBvLineCollision (Vector2 aabbPosition, Vector2 aabbDimensions, Vector2 lineStart, Vector2 lineEnd)
 
static bool CheckAABBvLineCollision (Vector2 objectPosition, Vector2 objectDimensions, Vector2 lineStart, Vector2 lineEnd, float lineWidth, ref float collisionPoint)
 
static bool CheckAABBvLineCollision2 (Vector2 aabbPosition, Vector2 aabbDimensions, Vector2 lineStart, Vector2 lineEnd)
 
static Vector2[] CheckLinevLine (Vector2 a1, Vector2 a2, Vector2 b1, Vector2 b2)
 
static bool DrownCollision (Vector2 Position, int Width, int Height, float gravDir=-1f, bool includeSlopes=false)
 
static bool EmptyTile (int i, int j, bool ignoreTiles=false)
 
static void ExpandVertically (int startX, int startY, out int topY, out int bottomY, int maxExpandUp=100, int maxExpandDown=100)
 
static bool FindCollisionDirection (out int Direction, Vector2 position, int Width, int Height, bool fallThrough=false, bool fall2=false, int gravDir=1)
 
static List< Point > FindCollisionTile (int Direction, Vector2 position, float testMagnitude, int Width, int Height, bool fallThrough=false, bool fall2=false, int gravDir=1, bool checkCardinals=true, bool checkSlopes=false)
 
static List< Point > GetEntityEdgeTiles (Entity entity, bool left=true, bool right=true, bool up=true, bool down=true)
 
static float GetTileRotation (Vector2 position)
 
static List< Point > GetTilesIn (Vector2 TopLeft, Vector2 BottomRight)
 
static bool GetWaterLine (int X, int Y, out float waterLineHeight)
 
static bool GetWaterLine (Point pt, out float waterLineHeight)
 
static bool GetWaterLineIterate (int X, int Y, out float waterLineHeight)
 
static bool GetWaterLineIterate (Point pt, out float waterLineHeight)
 
static void HitTiles (Vector2 Position, Vector2 Velocity, int Width, int Height)
 
static bool HitWallSubstep (int x, int y)
 
static Vector2 HurtTiles (Vector2 Position, Vector2 Velocity, int Width, int Height, bool fireImmune=false)
 
static bool InTileBounds (int x, int y, int lx, int ly, int hx, int hy)
 
static bool IsClearSpotTest (Vector2 position, float testMagnitude, int Width, int Height, bool fallThrough=false, bool fall2=false, int gravDir=1, bool checkCardinals=true, bool checkSlopes=false)
 
static bool IsWorldPointSolid (Vector2 pos)
 
static void LaserScan (Vector2 samplingPoint, Vector2 directionUnit, float samplingWidth, float maxDistance, float[] samples)
 
static bool LavaCollision (Vector2 Position, int Width, int Height)
 
static Vector2 noSlopeCollision (Vector2 Position, Vector2 Velocity, int Width, int Height, bool fallThrough=false, bool fall2=false)
 
static Vector4 SlopeCollision (Vector2 Position, Vector2 Velocity, int Width, int Height, float gravity=0f, bool fall=false)
 
static bool SolidCollision (Vector2 Position, int Width, int Height)
 
static bool SolidTiles (int startX, int endX, int startY, int endY)
 
static bool SolidTiles (Vector2 position, int width, int height)
 
static bool SolidTilesVersatile (int startX, int endX, int startY, int endY)
 
static void StepConveyorBelt (Entity entity, float gravDir)
 
static void StepDown (ref Vector2 position, ref Vector2 velocity, int width, int height, ref float stepSpeed, ref float gfxOffY, int gravDir=1, bool waterWalk=false)
 
static void StepUp (ref Vector2 position, ref Vector2 velocity, int width, int height, ref float stepSpeed, ref float gfxOffY, int gravDir=1, bool holdsMatching=false, int specialChecksMode=0)
 
static Vector2 StickyTiles (Vector2 Position, Vector2 Velocity, int Width, int Height)
 
static bool SwitchTiles (Vector2 Position, int Width, int Height, Vector2 oldPosition, int objType)
 
static Vector2 TileCollision (Vector2 Position, Vector2 Velocity, int Width, int Height, bool fallThrough=false, bool fall2=false, int gravDir=1)
 
static bool TupleHitLine (int x1, int y1, int x2, int y2, int ignoreX, int ignoreY, List< Tuple< int, int >> ignoreTargets, out Tuple< int, int > col)
 
static Tuple< int, int > TupleHitLineWall (int x1, int y1, int x2, int y2)
 
static Vector4 WalkDownSlope (Vector2 Position, Vector2 Velocity, int Width, int Height, float gravity=0f)
 
static Vector2 WaterCollision (Vector2 Position, Vector2 Velocity, int Width, int Height, bool fallThrough=false, bool fall2=false, bool lavaWalk=true)
 
static bool WetCollision (Vector2 Position, int Width, int Height)
 

Static Public Attributes

static bool down
 
static float Epsilon = (float)Math.E
 
static bool honey
 
static bool landMine = false
 
static bool sloping
 
static bool stair
 
static bool stairFall
 
static bool up