Structs.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  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. [StructLayout (LayoutKind.Sequential)]
  392. public struct RenderPathCommand {
  393. public UrhoString Tag;
  394. public RenderCommandType Type;
  395. public RenderCommandSortMode SortMode;
  396. public UrhoString Pass;
  397. public uint PassIndex;
  398. public UrhoString Metadata;
  399. public UrhoString VertexShaderName;
  400. public UrhoString PixelShaderName;
  401. public UrhoString VertexShaderDefines;
  402. public UrhoString PixelShaderDefines;
  403. //Marshalling String textureNames_[16]
  404. public UrhoString TextureName0;
  405. public UrhoString TextureName1;
  406. public UrhoString TextureName2;
  407. public UrhoString TextureName3;
  408. public UrhoString TextureName4;
  409. public UrhoString TextureName5;
  410. public UrhoString TextureName6;
  411. public UrhoString TextureName7;
  412. public UrhoString TextureName8;
  413. public UrhoString TextureName9;
  414. public UrhoString TextureName10;
  415. public UrhoString TextureName11;
  416. public UrhoString TextureName12;
  417. public UrhoString TextureName13;
  418. public UrhoString TextureName14;
  419. public UrhoString TextureName15;
  420. public HashBase ShaderParameters;
  421. public VectorBase Outputs;
  422. public UrhoString DepthStencilName;
  423. public uint ClearFlags;
  424. public Color ClearColor;
  425. public float ClearDepth;
  426. public uint ClearStencil;
  427. public BlendMode BlendMode;
  428. public byte Enabled;
  429. public byte UseFogColor;
  430. public byte MarkToStencil;
  431. public byte UseLitBase;
  432. public byte VertexLights;
  433. }
  434. [StructLayout(LayoutKind.Sequential)]
  435. public struct HashBase {
  436. public IntPtr Head;
  437. public IntPtr Tail;
  438. public IntPtr Ptrs;
  439. public IntPtr Allocator;
  440. }
  441. // DEBATABLE: maybe we should let the binder handle it?
  442. [StructLayout (LayoutKind.Sequential)]
  443. public struct GPUObject {
  444. }
  445. // DEBATABLE: maybe we should let the binder handle it?
  446. [StructLayout (LayoutKind.Sequential)]
  447. public struct GraphicsImpl {
  448. }
  449. [StructLayout (LayoutKind.Sequential)]
  450. public struct FontGlyph {
  451. public short X, Y, Width, Height, OffsetX, OffsetY, AdvanceX;
  452. public int Page;
  453. byte used;
  454. public bool Used { get { return used != 0; } set { used = (byte) (value ? 1 : 0); }}
  455. }
  456. // DEBATABLE: maybe we should let the binder handle it?
  457. [StructLayout (LayoutKind.Sequential)]
  458. public struct RandomAccessIterator {
  459. }
  460. // DEBATABLE: maybe we should let the binder handle it?
  461. [StructLayout (LayoutKind.Sequential)]
  462. public struct ModelMorph {
  463. }
  464. // DEBATABLE: maybe we should let the binder handle it?
  465. [StructLayout (LayoutKind.Sequential)]
  466. public struct Octant {
  467. }
  468. // DEBATABLE: maybe we should let the binder handle it?
  469. [StructLayout (LayoutKind.Sequential)]
  470. public struct CompressedLevel {
  471. public IntPtr ImageData;
  472. public CompressedFormat Format;
  473. public int Width, Height, Depth;
  474. public uint BlockSize, DataSize, RowSize, RowCount;
  475. }
  476. // DEBATABLE: maybe we should let the binder handle it?
  477. [StructLayout (LayoutKind.Sequential)]
  478. public struct Billboard {
  479. public Vector3 Position;
  480. public Vector2 Size;
  481. public Rect Uv;
  482. public Color Color;
  483. public float Rotation;
  484. public Vector3 Direction;
  485. byte enabled; //bool is not blittable.
  486. public bool Enabled { get { return enabled != 0; } set { enabled = (byte)(value ? 1 : 0); } }
  487. public float SortDistance;
  488. }
  489. public unsafe class BillboardWrapper
  490. {
  491. readonly object bbHolder;
  492. readonly Billboard* bb;
  493. public BillboardWrapper(object bbHolder, Billboard* bb)
  494. {
  495. this.bbHolder = bbHolder;
  496. this.bb = bb;
  497. }
  498. public Vector3 Position { get { return bb->Position; } set { bb->Position = value; } }
  499. public Vector2 Size { get { return bb->Size; } set { bb->Size = value; } }
  500. public Rect Uv { get { return bb->Uv; } set { bb->Uv = value; } }
  501. public Color Color { get { return bb->Color; } set { bb->Color = value; } }
  502. public float Rotation { get { return bb->Rotation; } set { bb->Rotation = value; } }
  503. public bool Enabled { get { return bb->Enabled; } set { bb->Enabled = value; } }
  504. public float SortDistance { get { return bb->SortDistance; } set { bb->SortDistance = value; } }
  505. }
  506. // DEBATABLE: maybe we should let the binder handle it?
  507. [StructLayout (LayoutKind.Sequential)]
  508. public struct AnimationTrack {
  509. }
  510. // DEBATABLE: maybe we should let the binder handle it?
  511. [StructLayout (LayoutKind.Sequential)]
  512. public struct CustomGeometryVertex {
  513. }
  514. // DEBATABLE: maybe we should let the binder handle it?
  515. [StructLayout (LayoutKind.Sequential)]
  516. public struct NetworkState {
  517. }
  518. // DEBATABLE: maybe we should let the binder handle it?
  519. [StructLayout (LayoutKind.Sequential)]
  520. public struct ComponentReplicationState {
  521. }
  522. // DEBATABLE: maybe we should let the binder handle it?
  523. [StructLayout (LayoutKind.Sequential)]
  524. public struct ShaderParameter {
  525. }
  526. // DEBATABLE: maybe we should let the binder handle it?
  527. [StructLayout (LayoutKind.Sequential)]
  528. public struct UrhoString
  529. {
  530. public uint Length;
  531. public uint Capacity;
  532. public IntPtr Buffer;
  533. }
  534. [StructLayout (LayoutKind.Sequential)]
  535. public struct BiasParameters {
  536. public float ConstantBias;
  537. public float SlopeScaleBias;
  538. public BiasParameters (float constantBias, float slopeScaleBias)
  539. {
  540. ConstantBias = constantBias;
  541. SlopeScaleBias = slopeScaleBias;
  542. }
  543. }
  544. [StructLayout (LayoutKind.Sequential)]
  545. public struct CascadeParameters {
  546. public float Split1, Split2, Split3, Split4;
  547. public float FadeStart;
  548. public float BiasAutoAdjust;
  549. public CascadeParameters (float split1, float split2, float split3, float split4, float fadeStart, float biasAutoAdjust = 1f)
  550. {
  551. Split1 = split1;
  552. Split2 = split2;
  553. Split3 = split3;
  554. Split4 = split4;
  555. FadeStart = fadeStart;
  556. BiasAutoAdjust = biasAutoAdjust;
  557. }
  558. }
  559. [StructLayout (LayoutKind.Sequential)]
  560. public struct FocusParameters {
  561. public byte Focus;
  562. public byte NonUniform;
  563. public byte AutoSize;
  564. public float Quantize;
  565. public float MinView;
  566. }
  567. }
  568. namespace Urho.IO {
  569. [StructLayout (LayoutKind.Sequential)]
  570. public struct PackageEntry {
  571. public int Offset, Size, Checksum;
  572. }
  573. }
  574. namespace Urho.Urho2D {
  575. // DEBATABLE: maybe we should let the binder handle it?
  576. [StructLayout(LayoutKind.Sequential)]
  577. public struct TileMapInfo2D {
  578. public Orientation2D Orientation;
  579. public int Width;
  580. public int Height;
  581. public float TileWidth;
  582. public float TileHeight;
  583. //calculated properties:
  584. public float MapWidth => Width * TileWidth;
  585. public float MapHeight
  586. {
  587. get
  588. {
  589. if (Orientation == Orientation2D.Staggered)
  590. return (Height + 1) * 0.5f * TileHeight;
  591. return Height * TileHeight;
  592. }
  593. }
  594. }
  595. }
  596. namespace Urho.Navigation {
  597. [StructLayout(LayoutKind.Sequential)]
  598. public struct dtQueryFilter {
  599. //public float[] AreaCost; // Cost per area type. (Used by default implementation.)
  600. //public ushort IncludeFlags; // Flags for polygons that can be visited. (Used by default implementation.)
  601. //public ushort ExcludeFlags; // Flags for polygons that should not be visted. (Used by default implementation.)
  602. }
  603. [StructLayout(LayoutKind.Sequential)]
  604. public struct CrowdObstacleAvoidanceParams {
  605. public float VelBias;
  606. public float WeightDesVel;
  607. public float WeightCurVel;
  608. public float WeightSide;
  609. public float WeightToi;
  610. public float HorizTime;
  611. public byte GridSize;
  612. public byte AdaptiveDivs;
  613. public byte AdaptiveRings;
  614. public byte AdaptiveDepth;
  615. };
  616. }
  617. namespace Urho.Physics {
  618. [StructLayout(LayoutKind.Sequential)]
  619. public struct PhysicsRaycastResult {
  620. public Vector3 Position;
  621. public Vector3 Normal;
  622. public float Distance;
  623. public float HitFraction;
  624. IntPtr bodyPtr;
  625. public RigidBody Body => Runtime.LookupObject<RigidBody>(bodyPtr);
  626. }
  627. }
  628. namespace Urho.Resources {
  629. [StructLayout (LayoutKind.Sequential)]
  630. public struct XPathResultSet {
  631. }
  632. }
  633. namespace Urho.Network {
  634. [StructLayout (LayoutKind.Sequential)]
  635. public struct ReplicationState {
  636. IntPtr connection;
  637. public Connection Connection => Runtime.LookupObject<Connection> (connection);
  638. }
  639. [StructLayout (LayoutKind.Sequential)]
  640. public unsafe struct DirtyBits {
  641. public fixed byte Data [8];
  642. public byte Count;
  643. }
  644. [StructLayout (LayoutKind.Sequential)]
  645. public struct NodeReplicationState {
  646. }
  647. }