Structs.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading;
  5. using System.Runtime.InteropServices;
  6. using Urho.Physics;
  7. using Urho.Gui;
  8. using Urho.Urho2D;
  9. using Urho.Resources;
  10. namespace Urho {
  11. [StructLayout (LayoutKind.Sequential)]
  12. public struct Ray {
  13. public Vector3 Origin;
  14. public Vector3 Direction;
  15. public Ray(Vector3 origin, Vector3 direction)
  16. {
  17. Origin = origin;
  18. Direction = Vector3.Normalize(direction);
  19. }
  20. public override bool Equals (object obj)
  21. {
  22. if (!(obj is Ray))
  23. return false;
  24. return (this == (Ray) obj);
  25. }
  26. public static bool operator == (Ray left, Ray right)
  27. {
  28. return ((left.Origin == right.Origin) && (left.Direction == right.Direction));
  29. }
  30. public static bool operator != (Ray left, Ray right)
  31. {
  32. return ((left.Origin != right.Origin) || (left.Direction != right.Direction));
  33. }
  34. public Vector3 Project (Vector3 point)
  35. {
  36. var offset = point - Origin;
  37. return Origin + Vector3.Dot (offset, Direction) * Direction;
  38. }
  39. public override int GetHashCode ()
  40. {
  41. return Origin.GetHashCode () + Direction.GetHashCode ();
  42. }
  43. public float Distance (Vector3 point)
  44. {
  45. var projected = Project (point);
  46. return (point - projected).Length;
  47. }
  48. public Vector3 ClosestPoint (Ray otherRay)
  49. {
  50. var p13 = Origin - otherRay.Origin;
  51. var p43 = otherRay.Direction;
  52. Vector3 p21 = Direction;
  53. float d1343 = Vector3.Dot (p13, p43);
  54. float d4321 = Vector3.Dot (p43, p21);
  55. float d1321 = Vector3.Dot (p13, p21);
  56. float d4343 = Vector3.Dot (p43, p43);
  57. float d2121 = Vector3.Dot (p21, p21);
  58. float d = d2121 * d4343 - d4321 * d4321;
  59. if (Math.Abs(d) < float.Epsilon)
  60. return Origin;
  61. float n = d1343 * d4321 - d1321 * d4343;
  62. float a = n / d;
  63. return Origin + a * Direction;
  64. }
  65. public float HitDistance (Plane plane)
  66. {
  67. float d = Vector3.Dot (plane.Normal, Direction);
  68. if (Math.Abs (d) >= float.Epsilon) {
  69. float t = -(Vector3.Dot (plane.Normal, Origin) + plane.D) / d;
  70. if (t >= 0.0f)
  71. return t;
  72. else
  73. return float.PositiveInfinity;
  74. } else
  75. return float.PositiveInfinity;
  76. }
  77. }
  78. [StructLayout (LayoutKind.Sequential)]
  79. public struct IntRect {
  80. public int Left, Top, Right, Bottom;
  81. public IntRect (int left, int top, int right, int bottom)
  82. {
  83. Left = left;
  84. Top = top;
  85. Right = right;
  86. Bottom = bottom;
  87. }
  88. }
  89. [StructLayout (LayoutKind.Sequential)]
  90. public unsafe struct TypeInfo {
  91. public StringHash Type;
  92. public UrhoString TypeName;
  93. public TypeInfo* BaseTypeInfo;
  94. }
  95. [StructLayout (LayoutKind.Sequential)]
  96. public struct Rect {
  97. public Vector2 Min, Max;
  98. public Rect (int left, int top, int right, int bottom)
  99. {
  100. Min = new Vector2 (left, top);
  101. Max = new Vector2 (right, bottom);
  102. }
  103. public Rect (Vector2 min, Vector2 max)
  104. {
  105. Min = min;
  106. Max = max;
  107. }
  108. }
  109. [StructLayout (LayoutKind.Sequential)]
  110. public struct ResourceRef {
  111. public StringHash Type;
  112. public UrhoString Name;
  113. }
  114. [StructLayout (LayoutKind.Sequential)]
  115. public struct HashIteratorBase {
  116. }
  117. [StructLayout (LayoutKind.Sequential)]
  118. public struct Iterator {
  119. }
  120. [StructLayout (LayoutKind.Sequential)]
  121. public struct ResourceRefList {
  122. }
  123. [StructLayout (LayoutKind.Sequential)]
  124. public struct BoundingBox {
  125. public Vector3 Min;
  126. public float DummyMin;
  127. public Vector3 Max;
  128. public float DummyMax;
  129. public BoundingBox (float min, float max)
  130. {
  131. DummyMax = 0;
  132. DummyMin = 0;
  133. Min = new Vector3 (min, min, min);
  134. Max = new Vector3 (max, max, max);
  135. }
  136. public BoundingBox (Vector3 min, Vector3 max)
  137. {
  138. DummyMax = 0;
  139. DummyMin = 0;
  140. Min = min;
  141. Max = max;
  142. }
  143. public bool Defined ()
  144. {
  145. return Min.X != float.PositiveInfinity;
  146. }
  147. public Vector3 Center {
  148. get {
  149. return (Max + Min) * 0.5f;
  150. }
  151. }
  152. public Vector3 Size {
  153. get {
  154. return Max - Min;
  155. }
  156. }
  157. public Vector3 HalfSize {
  158. get {
  159. return (Max - Min)*0.5f;
  160. }
  161. }
  162. public Intersection IsInside (Vector3 point)
  163. {
  164. if (point.X < Min.X || point.X > Max.X ||
  165. point.Y < Min.Y || point.Y > Max.Y ||
  166. point.Z < Min.Z || point.Z > Max.Z)
  167. return Intersection.Outside;
  168. return Intersection.Inside;
  169. }
  170. public Intersection IsInside (BoundingBox box)
  171. {
  172. if (box.Max.X < Min.X || box.Min.X > Max.X ||
  173. box.Max.Y < Min.Y || box.Min.Y > Max.Y ||
  174. box.Max.Z < Min.Z || box.Min.Z > Max.Z)
  175. return Intersection.Outside;
  176. else if (box.Min.X < Min.X || box.Max.X > Max.X ||
  177. box.Min.Y < Min.Y || box.Max.Y > Max.Y ||
  178. box.Min.Z < Min.Z || box.Max.Z > Max.Z)
  179. return Intersection.Intersects;
  180. else
  181. return Intersection.Inside;
  182. }
  183. public Intersection IsInsideFast (BoundingBox box)
  184. {
  185. if (box.Max.X < Min.X || box.Min.X > Max.X ||
  186. box.Max.Y < Min.Y || box.Min.Y > Max.Y ||
  187. box.Max.Z < Min.Z || box.Min.Z > Max.Z)
  188. return Intersection.Outside;
  189. else
  190. return Intersection.Inside;
  191. }
  192. }
  193. [StructLayout(LayoutKind.Sequential)]
  194. public struct AnimationTriggerPoint {
  195. public float Time;
  196. public Variant Variant;
  197. }
  198. [StructLayout(LayoutKind.Explicit)]
  199. public struct VariantValue {
  200. [FieldOffset(0)] public int Int;
  201. [FieldOffset(0)] public byte Bool;
  202. [FieldOffset(0)] public float Float;
  203. [FieldOffset(0)] public IntPtr Ptr;
  204. [FieldOffset(8)] public int Int2;
  205. [FieldOffset(8)] public float Float2;
  206. [FieldOffset(8)] public IntPtr Ptr2;
  207. [FieldOffset(16)] public int Int3;
  208. [FieldOffset(16)] public float Float3;
  209. [FieldOffset(16)] public IntPtr Ptr3;
  210. [FieldOffset(24)] public int Int4;
  211. [FieldOffset(24)] public float Float4;
  212. [FieldOffset(24)] public IntPtr Ptr4;
  213. }
  214. [StructLayout(LayoutKind.Sequential)]
  215. public struct Variant {
  216. public VariantType Type;
  217. public VariantValue Value;
  218. }
  219. [StructLayout (LayoutKind.Sequential)]
  220. public struct Matrix3x4 {
  221. public float m00;
  222. public float m01;
  223. public float m02;
  224. public float m03;
  225. public float m10;
  226. public float m11;
  227. public float m12;
  228. public float m13;
  229. public float m20;
  230. public float m21;
  231. public float m22;
  232. public float m23;
  233. }
  234. [StructLayout (LayoutKind.Sequential)]
  235. public struct Color {
  236. public float R, G, B, A;
  237. public Color (float r = 1f, float g = 1f, float b = 1f, float a = 1f)
  238. {
  239. R = r;
  240. G = g;
  241. B = b;
  242. A = a;
  243. }
  244. public Color (Color source)
  245. {
  246. R = source.R;
  247. G = source.G;
  248. B = source.B;
  249. A = source.A;
  250. }
  251. public Color (Color source, float alpha)
  252. {
  253. R = source.R;
  254. G = source.G;
  255. B = source.B;
  256. A = alpha;
  257. }
  258. public static Color White = new Color (1, 1, 1);
  259. public static Color Gray = new Color (0.5f, 0.5f, 0.5f);
  260. public static Color Black = new Color (0.0f, 0.0f, 0.0f);
  261. public static Color Red = new Color (1.0f, 0.0f, 0.0f);
  262. public static Color Green = new Color (0.0f, 1.0f, 0.0f);
  263. public static Color Blue = new Color (0.0f, 0.0f, 1.0f);
  264. public static Color Cyan = new Color (0.0f, 1.0f, 1.0f);
  265. public static Color Magenta = new Color (1.0f, 0.0f, 1.0f);
  266. public static Color Yellow = new Color (1.0f, 1.0f, 0.0f);
  267. public static Color Transparent = new Color (0.0f, 0.0f, 0.0f, 0.0f);
  268. }
  269. [StructLayout (LayoutKind.Sequential)]
  270. public struct Frustum {
  271. }
  272. [StructLayout (LayoutKind.Sequential)]
  273. public struct WeakPtr {
  274. IntPtr ptr;
  275. IntPtr refCountPtr;
  276. public T GetUrhoObject<T>() where T : UrhoObject => Runtime.LookupObject<T>(ptr);
  277. public T GetRefCounted<T>() where T : RefCounted => Runtime.LookupRefCounted<T>(ptr);
  278. }
  279. [StructLayout (LayoutKind.Sequential)]
  280. public struct TouchState {
  281. public int TouchID;
  282. public IntVector2 Position, LastPosition, Delta;
  283. public float Pressure;
  284. WeakPtr touchedElementPtr;
  285. public UIElement TouchedElement => touchedElementPtr.GetUrhoObject<UIElement>();
  286. }
  287. [StructLayout (LayoutKind.Sequential)]
  288. public struct ColorFrame {
  289. public Color Color;
  290. public float Time;
  291. }
  292. [StructLayout (LayoutKind.Sequential)]
  293. public struct JoystickState {
  294. public IntPtr JoystickPtr;
  295. public IntPtr JoystickIdPtr;
  296. public IntPtr ControllerPtr;
  297. IntPtr screenJoystickPtr;
  298. public UIElement ScreenJoystick => Runtime.LookupObject<UIElement>(screenJoystickPtr);
  299. public UrhoString Name;
  300. public VectorBase Buttons;
  301. public VectorBase ButtonPress;
  302. public VectorBase Axes;
  303. public VectorBase Hats;
  304. public float GetAxisPosition(int position)
  305. {
  306. if (position >= Axes.Size)
  307. return 0;
  308. return Axes.Buffer.ReadSingle(position * sizeof(float));
  309. }
  310. public byte GetButtonDown(int position)
  311. {
  312. if (position >= Buttons.Size)
  313. return 0;
  314. return Marshal.ReadByte(Buttons.Buffer, position * sizeof(byte));
  315. }
  316. public byte GetButtonPress(int position)
  317. {
  318. if (position >= ButtonPress.Size)
  319. return 0;
  320. return Marshal.ReadByte(ButtonPress.Buffer, position * sizeof(byte));
  321. }
  322. public int GetHatPosition(int position)
  323. {
  324. if (position >= Hats.Size)
  325. return 0;
  326. return Marshal.ReadInt32(Hats.Buffer, position * sizeof(int));
  327. }
  328. }
  329. [StructLayout(LayoutKind.Sequential)]
  330. public struct VectorBase {
  331. public uint Size;
  332. public uint Capacity;
  333. public IntPtr Buffer;
  334. }
  335. [StructLayout (LayoutKind.Sequential)]
  336. public struct TextureFrame {
  337. }
  338. [StructLayout (LayoutKind.Sequential)]
  339. public struct LightBatchQueue {
  340. }
  341. [StructLayout (LayoutKind.Sequential)]
  342. public struct Bone {
  343. public UrhoString Name;
  344. public int NameHash;
  345. public uint ParentIndex;
  346. public Vector3 InitialPosition;
  347. public Quaternion InitialRotation;
  348. public Vector3 InitialScale;
  349. public Matrix3x4 OffsetMatrix;
  350. byte animated; //bool is not blittable.
  351. public bool Animated { get { return animated != 0; } set { animated = (byte)(value ? 1 : 0); } }
  352. public byte CollisionMask;
  353. public float Radius;
  354. public BoundingBox BoundingBox;
  355. WeakPtr Node;
  356. }
  357. public unsafe class BoneWrapper
  358. {
  359. readonly object objHolder;
  360. readonly Bone* b;
  361. public BoneWrapper(object objHolder, Bone* bone)
  362. {
  363. this.objHolder = objHolder;
  364. this.b = bone;
  365. }
  366. public UrhoString Name { get { return b->Name; } set { b->Name = value; } }
  367. public int NameHash { get { return b->NameHash; } set { b->NameHash = value; } }
  368. public uint ParentIndex { get { return b->ParentIndex; } set { b->ParentIndex = value; } }
  369. public Vector3 InitialPosition { get { return b->InitialPosition; } set { b->InitialPosition = value; } }
  370. public Quaternion InitialRotation { get { return b->InitialRotation; } set { b->InitialRotation = value; } }
  371. public Vector3 InitialScale { get { return b->InitialScale; } set { b->InitialScale = value; } }
  372. public Matrix3x4 OffsetMatrix { get { return b->OffsetMatrix; } set { b->OffsetMatrix = value; } }
  373. public bool Animated { get { return b->Animated; } set { b->Animated = value; } }
  374. public byte CollisionMask { get { return b->CollisionMask; } set { b->CollisionMask = value; } }
  375. public float Radius { get { return b->Radius; } set { b->Radius = value; } }
  376. public BoundingBox BoundingBox { get { return b->BoundingBox; } set { b->BoundingBox = value; } }
  377. }
  378. // DEBATABLE: maybe we should let the binder handle it?
  379. [StructLayout(LayoutKind.Sequential)]
  380. public struct RayQueryResult {
  381. public Vector3 Position;
  382. public Vector3 Normal;
  383. public Vector2 TextureUV;
  384. public float Distance;
  385. IntPtr drawablePtr;
  386. public Drawable Drawable => Runtime.LookupObject<Drawable>(drawablePtr);
  387. IntPtr nodePtr;
  388. public Node Node => Runtime.LookupObject<Node>(nodePtr);
  389. public uint SubObject;
  390. }
  391. // DEBATABLE: maybe we should let the binder handle it?
  392. [StructLayout (LayoutKind.Explicit)]
  393. public struct RenderPathCommand {
  394. [FieldOffset(0)] public UrhoString Tag;
  395. [FieldOffset(16)] public RenderCommandType Type;
  396. [FieldOffset(20)] public RenderCommandSortMode SortMode;
  397. [FieldOffset(24)] public UrhoString Pass;
  398. [FieldOffset(40)] public uint PassIndex;
  399. [FieldOffset(48)] public UrhoString Metadata;
  400. [FieldOffset(64)] public UrhoString VertexShaderName;
  401. [FieldOffset(80)] public UrhoString PixelShaderName;
  402. [FieldOffset(96)] public UrhoString VertexShaderDefines;
  403. [FieldOffset(112)] public UrhoString PixelShaderDefines;
  404. [FieldOffset(128)] public IntPtr TextureNames;
  405. [FieldOffset(384)] public IntPtr ShaderParameters;
  406. [FieldOffset(416)] public IntPtr Outputs;
  407. [FieldOffset(432)] public UrhoString DepthStencilName;
  408. [FieldOffset(448)] public uint ClearFlags;
  409. [FieldOffset(452)] public Color ClearColor;
  410. [FieldOffset(468)] public float ClearDepth;
  411. [FieldOffset(472)] public uint ClearStencil;
  412. [FieldOffset(476)] public BlendMode BlendMode;
  413. [FieldOffset(480)] public byte Enabled;
  414. [FieldOffset(481)] public byte UseFogColor;
  415. [FieldOffset(482)] public byte MarkToStencil;
  416. [FieldOffset(483)] public byte UseLitBase;
  417. [FieldOffset(484)] public byte VertexLights;
  418. }
  419. // DEBATABLE: maybe we should let the binder handle it?
  420. [StructLayout (LayoutKind.Sequential)]
  421. public struct GPUObject {
  422. }
  423. // DEBATABLE: maybe we should let the binder handle it?
  424. [StructLayout (LayoutKind.Sequential)]
  425. public struct GraphicsImpl {
  426. }
  427. [StructLayout (LayoutKind.Sequential)]
  428. public struct FontGlyph {
  429. public short X, Y, Width, Height, OffsetX, OffsetY, AdvanceX;
  430. public int Page;
  431. byte used;
  432. public bool Used { get { return used != 0; } set { used = (byte) (value ? 1 : 0); }}
  433. }
  434. // DEBATABLE: maybe we should let the binder handle it?
  435. [StructLayout (LayoutKind.Sequential)]
  436. public struct RandomAccessIterator {
  437. }
  438. // DEBATABLE: maybe we should let the binder handle it?
  439. [StructLayout (LayoutKind.Sequential)]
  440. public struct ModelMorph {
  441. }
  442. // DEBATABLE: maybe we should let the binder handle it?
  443. [StructLayout (LayoutKind.Sequential)]
  444. public struct Octant {
  445. }
  446. // DEBATABLE: maybe we should let the binder handle it?
  447. [StructLayout (LayoutKind.Sequential)]
  448. public struct CompressedLevel {
  449. public IntPtr ImageData;
  450. public CompressedFormat Format;
  451. public int Width, Height, Depth;
  452. public uint BlockSize, DataSize, RowSize, RowCount;
  453. }
  454. // DEBATABLE: maybe we should let the binder handle it?
  455. [StructLayout (LayoutKind.Sequential)]
  456. public struct Billboard {
  457. public Vector3 Position;
  458. public Vector2 Size;
  459. public Rect Uv;
  460. public Color Color;
  461. public float Rotation;
  462. public Vector3 Direction;
  463. byte enabled; //bool is not blittable.
  464. public bool Enabled { get { return enabled != 0; } set { enabled = (byte)(value ? 1 : 0); } }
  465. public float SortDistance;
  466. }
  467. public unsafe class BillboardWrapper
  468. {
  469. readonly object bbHolder;
  470. readonly Billboard* bb;
  471. public BillboardWrapper(object bbHolder, Billboard* bb)
  472. {
  473. this.bbHolder = bbHolder;
  474. this.bb = bb;
  475. }
  476. public Vector3 Position { get { return bb->Position; } set { bb->Position = value; } }
  477. public Vector2 Size { get { return bb->Size; } set { bb->Size = value; } }
  478. public Rect Uv { get { return bb->Uv; } set { bb->Uv = value; } }
  479. public Color Color { get { return bb->Color; } set { bb->Color = value; } }
  480. public float Rotation { get { return bb->Rotation; } set { bb->Rotation = value; } }
  481. public bool Enabled { get { return bb->Enabled; } set { bb->Enabled = value; } }
  482. public float SortDistance { get { return bb->SortDistance; } set { bb->SortDistance = value; } }
  483. }
  484. // DEBATABLE: maybe we should let the binder handle it?
  485. [StructLayout (LayoutKind.Sequential)]
  486. public struct AnimationTrack {
  487. }
  488. // DEBATABLE: maybe we should let the binder handle it?
  489. [StructLayout (LayoutKind.Sequential)]
  490. public struct CustomGeometryVertex {
  491. }
  492. // DEBATABLE: maybe we should let the binder handle it?
  493. [StructLayout (LayoutKind.Sequential)]
  494. public struct NetworkState {
  495. }
  496. // DEBATABLE: maybe we should let the binder handle it?
  497. [StructLayout (LayoutKind.Sequential)]
  498. public struct ComponentReplicationState {
  499. }
  500. // DEBATABLE: maybe we should let the binder handle it?
  501. [StructLayout (LayoutKind.Sequential)]
  502. public struct ShaderParameter {
  503. }
  504. // DEBATABLE: maybe we should let the binder handle it?
  505. [StructLayout (LayoutKind.Sequential)]
  506. public struct UrhoString
  507. {
  508. public uint Length;
  509. public uint Capacity;
  510. public IntPtr Buffer;
  511. }
  512. [StructLayout (LayoutKind.Sequential)]
  513. public struct BiasParameters {
  514. public float ConstantBias;
  515. public float SlopeScaleBias;
  516. public BiasParameters (float constantBias, float slopeScaleBias)
  517. {
  518. ConstantBias = constantBias;
  519. SlopeScaleBias = slopeScaleBias;
  520. }
  521. }
  522. [StructLayout (LayoutKind.Sequential)]
  523. public struct CascadeParameters {
  524. public float Split1, Split2, Split3, Split4;
  525. public float FadeStart;
  526. public float BiasAutoAdjust;
  527. public CascadeParameters (float split1, float split2, float split3, float split4, float fadeStart, float biasAutoAdjust = 1f)
  528. {
  529. Split1 = split1;
  530. Split2 = split2;
  531. Split3 = split3;
  532. Split4 = split4;
  533. FadeStart = fadeStart;
  534. BiasAutoAdjust = biasAutoAdjust;
  535. }
  536. }
  537. [StructLayout (LayoutKind.Sequential)]
  538. public struct FocusParameters {
  539. public byte Focus;
  540. public byte NonUniform;
  541. public byte AutoSize;
  542. public float Quantize;
  543. public float MinView;
  544. }
  545. }
  546. namespace Urho.IO {
  547. [StructLayout (LayoutKind.Sequential)]
  548. public struct PackageEntry {
  549. public int Offset, Size, Checksum;
  550. }
  551. }
  552. namespace Urho.Urho2D {
  553. // DEBATABLE: maybe we should let the binder handle it?
  554. [StructLayout(LayoutKind.Sequential)]
  555. public struct TileMapInfo2D {
  556. public Orientation2D Orientation;
  557. public int Width;
  558. public int Height;
  559. public float TileWidth;
  560. public float TileHeight;
  561. //calculated properties:
  562. public float MapWidth => Width * TileWidth;
  563. public float MapHeight
  564. {
  565. get
  566. {
  567. if (Orientation == Orientation2D.Staggered)
  568. return (Height + 1) * 0.5f * TileHeight;
  569. return Height * TileHeight;
  570. }
  571. }
  572. }
  573. }
  574. namespace Urho.Navigation {
  575. [StructLayout(LayoutKind.Sequential)]
  576. public struct dtQueryFilter {
  577. //public float[] AreaCost; // Cost per area type. (Used by default implementation.)
  578. //public ushort IncludeFlags; // Flags for polygons that can be visited. (Used by default implementation.)
  579. //public ushort ExcludeFlags; // Flags for polygons that should not be visted. (Used by default implementation.)
  580. }
  581. [StructLayout(LayoutKind.Sequential)]
  582. public struct CrowdObstacleAvoidanceParams {
  583. public float VelBias;
  584. public float WeightDesVel;
  585. public float WeightCurVel;
  586. public float WeightSide;
  587. public float WeightToi;
  588. public float HorizTime;
  589. public byte GridSize;
  590. public byte AdaptiveDivs;
  591. public byte AdaptiveRings;
  592. public byte AdaptiveDepth;
  593. };
  594. }
  595. namespace Urho.Physics {
  596. [StructLayout(LayoutKind.Sequential)]
  597. public struct PhysicsRaycastResult {
  598. public Vector3 Position;
  599. public Vector3 Normal;
  600. public float Distance;
  601. public float HitFraction;
  602. IntPtr bodyPtr;
  603. public RigidBody Body => Runtime.LookupObject<RigidBody>(bodyPtr);
  604. }
  605. }
  606. namespace Urho.Resources {
  607. [StructLayout (LayoutKind.Sequential)]
  608. public struct XPathResultSet {
  609. }
  610. }
  611. namespace Urho.Network {
  612. [StructLayout (LayoutKind.Sequential)]
  613. public struct ReplicationState {
  614. IntPtr connection;
  615. public Connection Connection => Runtime.LookupObject<Connection> (connection);
  616. }
  617. [StructLayout (LayoutKind.Sequential)]
  618. public unsafe struct DirtyBits {
  619. public fixed byte Data [8];
  620. public byte Count;
  621. }
  622. [StructLayout (LayoutKind.Sequential)]
  623. public struct NodeReplicationState {
  624. }
  625. }