Client LuaCsForBarotrauma
Physics.cs
1 using FarseerPhysics.Dynamics;
2 
3 namespace Barotrauma
4 {
5  static class Physics
6  {
7  public const Category CollisionNone = Category.None;
8  public const Category CollisionAll = Category.All;
9  public const Category CollisionWall = Category.Cat1;
10  public const Category CollisionCharacter = Category.Cat2;
11  public const Category CollisionPlatform = Category.Cat3;
12  public const Category CollisionStairs = Category.Cat4;
13  public const Category CollisionItem = Category.Cat5;
14  public const Category CollisionItemBlocking = Category.Cat6;
15  public const Category CollisionProjectile = Category.Cat7;
16  public const Category CollisionLevel = Category.Cat8;
17  public const Category CollisionRepairableWall = Category.Cat9;
18 
19  public const Category DefaultItemCollidesWith = CollisionWall | CollisionLevel | CollisionPlatform | CollisionRepairableWall;
20 
21  public static float DisplayToRealWorldRatio = 1.0f / 100.0f;
22 
23  public const float DisplayToSimRation = 100.0f;
24 
25  public const float NeutralDensity = 10.0f;
26 
27  public static bool TryParseCollisionCategory(string categoryName, out Category category)
28  {
29  category = Category.None;
30  if (string.IsNullOrEmpty(categoryName))
31  {
32  return false;
33  }
34  switch (categoryName.ToLowerInvariant())
35  {
36  case "all":
37  category = CollisionAll;
38  return true;
39  case "wall":
40  case "structure":
41  category = CollisionWall;
42  return true;
43  case "character":
44  category = CollisionCharacter;
45  return true;
46  case "platform":
47  category = CollisionPlatform;
48  return true;
49  case "stairs":
50  category = CollisionStairs;
51  return true;
52  case "item":
53  category = CollisionItem;
54  return true;
55  case "itemblocking":
56  category = CollisionItemBlocking;
57  return true;
58  case "projectile":
59  category = CollisionProjectile;
60  return true;
61  case "level":
62  category = CollisionLevel;
63  return true;
64  case "repair":
65  category = CollisionRepairableWall;
66  return true;
67  default:
68  return false;
69  }
70  }
71  }
72 }