Sphere.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. using System.Runtime.InteropServices;
  4. namespace BansheeEngine
  5. {
  6. /** @addtogroup Math
  7. * @{
  8. */
  9. /// <summary>
  10. /// A sphere represented by a center point and a radius.
  11. /// </summary>
  12. [StructLayout(LayoutKind.Sequential), SerializeObject]
  13. public struct Sphere // Note: Must match C++ struct Sphere
  14. {
  15. [SerializeField]
  16. private float _radius;
  17. [SerializeField]
  18. private Vector3 _center;
  19. /// <summary>
  20. /// Center point of the sphere.
  21. /// </summary>
  22. public Vector3 Center
  23. {
  24. get { return _center; }
  25. set { _center = value; }
  26. }
  27. /// <summary>
  28. /// Radius of the sphere.
  29. /// </summary>
  30. public float Radius
  31. {
  32. get { return _radius; }
  33. set { _radius = value; }
  34. }
  35. /// <summary>
  36. /// Creates a new sphere object.
  37. /// </summary>
  38. /// <param name="center">Center point of the sphere.</param>
  39. /// <param name="radius">Radius of the sphere.</param>
  40. public Sphere(Vector3 center, float radius)
  41. {
  42. _center = center;
  43. _radius = radius;
  44. }
  45. };
  46. /** @} */
  47. }