Guest User

Untitled

a guest
Apr 1st, 2017
457
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static class ShapeTest
  2. {
  3.     public static Materials GetShapeTestMaterial(Vector3 from, Vector3 to, IntersectOptions intersect, Entity ignoreEntity)
  4.     {
  5.         Vector3 unusedVec;
  6.         Entity unusedEnt;
  7.         Materials material;
  8.  
  9.         if (GetShapeTest(from, to, intersect, ignoreEntity, out unusedVec, out unusedVec, out material, out unusedEnt))
  10.         {
  11.             return material;
  12.         }
  13.        
  14.         return Materials.Default;
  15.     }
  16.  
  17.     public static bool GetShapeTest(Vector3 from, Vector3 to, IntersectOptions intersect, Entity ignoreEntity, out Vector3 endCoords, out Vector3 surfaceNormal, out Materials material, out Entity entityHit)
  18.     {
  19.         //WORLDPROBE::_START_SHAPE_TEST_RAY(float x1, float y1, float z1, float x2, float y2, float z2, int flags, Entity entity, int p8)
  20.         int ray = Function.Call<int>(Hash._0x377906D8A31E5586, from.X, from.Y, from.Z, to.X, to.Y, to.Z, (int)intersect, ignoreEntity, 7);
  21.        
  22.         OutputArgument outHit = new OutputArgument(),
  23.             outEndCoords = new OutputArgument(),
  24.             outSurfaceNormal = new OutputArgument(),
  25.             outMaterialHash = new OutputArgument(),
  26.             outEntityHit = new OutputArgument();
  27.        
  28.         //WORLDPROBE::_GET_SHAPE_TEST_RESULT_EX(int rayHandle, BOOL *hit, Vector3 *endCoords, Vector3 *surfaceNormal, Hash *materialHash, Entity *entityHit)
  29.         Function.Call<int>(Hash._0x65287525D951F6BE, ray, outHit, outEndCoords, outSurfaceNormal, outMaterialHash, outEntityHit);
  30.  
  31.         if (outHit.GetResult<bool>())
  32.         {
  33.             endCoords = outEndCoords.GetResult<Vector3>();
  34.             surfaceNormal = outSurfaceNormal.GetResult<Vector3>();
  35.             material = (Materials)outMaterialHash.GetResult<int>();
  36.             entityHit = outEntityHit.GetResult<Entity>();
  37.             return true;
  38.         }
  39.         else
  40.         {
  41.             endCoords = Vector3.Zero;
  42.             surfaceNormal = Vector3.Zero;
  43.             material = Materials.Default;
  44.             entityHit = null;
  45.             return false;
  46.         }
  47.     }
  48. }
  49.  
  50. public enum Materials : int
  51. {
  52.     Default = -1775485061,
  53.     Concrete = 1187676648,
  54.     ConcretePothole = 359120722,
  55.     ConcreteDusty = -1084640111,
  56.     Tarmac = 282940568,
  57.     TarmacPainted = -1301352528,
  58.     TarmacPothole = 1886546517,
  59.     RumbleStrip = -250168275,
  60.     BreezeBlock = -954112554,
  61.     Rock = -840216541,
  62.     RockMossy = -124769592,
  63.     Stone = 765206029,
  64.     Cobblestone = 576169331,
  65.     Brick = 1639053622,
  66.     Marble = 1945073303,
  67.     PavingSlab = 1907048430,
  68.     SandstoneSolid = 592446772,
  69.     SandstoneBrittle = 1913209870,
  70.     SandLoose = -1595148316,
  71.     SandCompact = 510490462,
  72.     SandWet = 909950165,
  73.     SandTrack = -1907520769,
  74.     SandUnderwater = -1136057692,
  75.     SandDryDeep = 509508168,
  76.     SandWetDeep = 1288448767,
  77.     Ice = -786060715,
  78.     IceTarmac = -1931024423,
  79.     SnowLoose = -1937569590,
  80.     SnowCompact = -878560889,
  81.     SnowDeep = 1619704960,
  82.     SnowTarmac = 1550304810,
  83.     GravelSmall = 951832588,
  84.     GravelLarge = 2128369009,
  85.     GravelDeep = -356706482,
  86.     GravelTrainTrack = 1925605558,
  87.     DirtTrack = -1885547121,
  88.     MudHard = -1942898710,
  89.     MudPothole = 312396330,
  90.     MudSoft = 1635937914,
  91.     MudUnderwater = -273490167,
  92.     MudDeep = 1109728704,
  93.     Marsh = 223086562,
  94.     MarshDeep = 1584636462,
  95.     Soil = -700658213,
  96.     ClayHard = 1144315879,
  97.     ClaySoft = 560985072,
  98.     GrassLong = -461750719,
  99.     Grass = 1333033863,
  100.     GrassShort = -1286696947,
  101.     Hay = -1833527165,
  102.     Bushes = 581794674,
  103.     Twigs = -913351839,
  104.     Leaves = -2041329971,
  105.     Woodchips = -309121453,
  106.     TreeBark = -1915425863,
  107.     MetalSolidSmall = -1447280105,
  108.     MetalSolidMedium = -365631240,
  109.     MetalSolidLarge = 752131025,
  110.     MetalHollowSmall = 15972667,
  111.     MetalHollowMedium = 1849540536,
  112.     MetalHollowLarge = -583213831,
  113.     MetalChainlinkSmall = 762193613,
  114.     MetalChainlinkLarge = 125958708,
  115.     MetalCorrugatedIron = 834144982,
  116.     MetalGrille = -426118011,
  117.     MetalRailing = 2100727187,
  118.     MetalDuct = 1761524221,
  119.     MetalGarageDoor = -231260695,
  120.     MetalManhole = -754997699,
  121.     WoodSolidSmall = -399872228,
  122.     WoodSolidMedium = 555004797,
  123.     WoodSolidLarge = 815762359,
  124.     WoodSolidPolished = 126470059,
  125.     WoodFloorDusty = -749452322,
  126.     WoodHollowSmall = 1993976879,
  127.     WoodHollowMedium = -365476163,
  128.     WoodHollowLarge = -925419289,
  129.     WoodChipboard = 1176309403,
  130.     WoodOldCreaky = 722686013,
  131.     WoodHighDensity = -1742843392,
  132.     WoodLattice = 2011204130,
  133.     Ceramic = -1186320715,
  134.     RoofTile = 1755188853,
  135.     RoofFelt = -1417164731,
  136.     Fibreglass = 1354180827,
  137.     Tarpaulin = -642658848,
  138.     Plastic = -2073312001,
  139.     PlasticHollow = 627123000,
  140.     PlasticHighDensity = -1625995479,
  141.     PlasticClear = -1859721013,
  142.     PlasticHollowClear = 772722531,
  143.     PlasticHighDensityClear = -1338473170,
  144.     FibreglassHollow = -766055098,
  145.     Rubber = -145735917,
  146.     RubberHollow = -783934672,
  147.     Linoleum = 289630530,
  148.     Laminate = 1845676458,
  149.     CarpetSolid = 669292054,
  150.     CarpetSolidDusty = 158576196,
  151.     CarpetFloorboard = -1396484943,
  152.     Cloth = 122789469,
  153.     PlasterSolid = -574122433,
  154.     PlasterBrittle = -251888898,
  155.     CardboardSheet = 236511221,
  156.     CardboardBox = -1409054440,
  157.     Paper = 474149820,
  158.     Foam = 808719444,
  159.     FeatherPillow = 1341866303,
  160.     Polystyrene = -1756927331,
  161.     Leather = -570470900,
  162.     Tvscreen = 1429989756,
  163.     SlattedBlinds = 673696729,
  164.     GlassShootThrough = 937503243,
  165.     GlassBulletproof = 244521486,
  166.     GlassOpaque = 1500272081,
  167.     Perspex = -1619794068,
  168.     CarMetal = -93061983,
  169.     CarPlastic = 2137197282,
  170.     CarSofttop = -979647862,
  171.     CarSofttopClear = 2130571536,
  172.     CarGlassWeak = 1247281098,
  173.     CarGlassMedium = 602884284,
  174.     CarGlassStrong = 1070994698,
  175.     CarGlassBulletproof = -1721915930,
  176.     CarGlassOpaque = 513061559,
  177.     Water = 435688960,
  178.     Blood = 5236042,
  179.     Oil = -634481305,
  180.     Petrol = -1634184340,
  181.     FreshMeat = 868733839,
  182.     DriedMeat = -1445160429,
  183.     EmissiveGlass = 1501078253,
  184.     EmissivePlastic = 1059629996,
  185.     VfxMetalElectrified = -309134265,
  186.     VfxMetalWaterTower = 611561919,
  187.     VfxMetalSteam = -691277294,
  188.     VfxMetalFlame = 332778253,
  189.     PhysNoFriction = 1666473731,
  190.     PhysGolfBall = -1693813558,
  191.     PhysTennisBall = -256704763,
  192.     PhysCaster = -235302683,
  193.     PhysCasterRusty = 2016463089,
  194.     PhysCarVoid = 1345867677,
  195.     PhysPedCapsule = -291631035,
  196.     PhysElectricFence = -1170043733,
  197.     PhysElectricMetal = -2013761145,
  198.     PhysBarbedWire = -1543323456,
  199.     PhysPooltableSurface = 605776921,
  200.     PhysPooltableCushion = 972939963,
  201.     PhysPooltableBall = -748341562,
  202.     Buttocks = 483400232,
  203.     ThighLeft = -460535871,
  204.     ShinLeft = 652772852,
  205.     FootLeft = 1926285543,
  206.     ThighRight = -236981255,
  207.     ShinRight = -446036155,
  208.     FootRight = -1369136684,
  209.     Spine0 = -1922286884,
  210.     Spine1 = -1140112869,
  211.     Spine2 = 1457572381,
  212.     Spine3 = 32752644,
  213.     ClavicleLeft = -1469616465,
  214.     UpperArmLeft = -510342358,
  215.     LowerArmLeft = 1045062756,
  216.     HandLeft = 113101985,
  217.     ClavicleRight = -1557288998,
  218.     UpperArmRight = 1501153539,
  219.     LowerArmRight = 1777921590,
  220.     HandRight = 2000961972,
  221.     Neck = 1718294164,
  222.     Head = -735392753,
  223.     AnimalDefault = 286224918,
  224.     CarEngine = -1916939624,
  225.     Puddle = 999829011,
  226.     ConcretePavement = 2015599386,
  227.     BrickPavement = -1147361576,
  228.     PhysDynamicCoverBound = -2047468855,
  229.     VfxWoodBeerBarrel = 998201806,
  230.     WoodHighFriction = -2140087047,
  231.     RockNoinst = 127813971,
  232.     BushesNoinst = 1441114862,
  233.     MetalSolidRoadSurface = -729112334,
  234.     StuntRampSurface = -2088174996,
  235.     Temp01 = 746881105,
  236.     Temp02 = -1977970111,
  237.     Temp03 = 1911121241,
  238.     Temp04 = 1923995104,
  239.     Temp05 = -1393662448,
  240.     Temp06 = 1061250033,
  241.     Temp07 = -1765523682,
  242.     Temp08 = 1343679702,
  243.     Temp09 = 1026054937,
  244.     Temp10 = 63305994,
  245.     Temp11 = 47470226,
  246.     Temp12 = 702596674,
  247.     Temp13 = -1637485913,
  248.     Temp14 = -645955574,
  249.     Temp15 = -1583997931,
  250.     Temp16 = -1512735273,
  251.     Temp17 = 1011960114,
  252.     Temp18 = 1354993138,
  253.     Temp19 = -801804446,
  254.     Temp20 = -2052880405,
  255.     Temp21 = -1037756060,
  256.     Temp22 = -620388353,
  257.     Temp23 = 465002639,
  258.     Temp24 = 1963820161,
  259.     Temp25 = 1952288305,
  260.     Temp26 = -1116253098,
  261.     Temp27 = 889255498,
  262.     Temp28 = -1179674098,
  263.     Temp29 = 1078418101,
  264.     Temp30 = 13626292
  265. }
RAW Paste Data