Sphere.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Runtime.InteropServices;
  2. namespace BansheeEngine
  3. {
  4. /// <summary>
  5. /// A sphere represented by a center point and a radius.
  6. /// </summary>
  7. [StructLayout(LayoutKind.Sequential), SerializeObject]
  8. public struct Sphere // Note: Must match C++ enum Sphere
  9. {
  10. private float _radius;
  11. private Vector3 _center;
  12. /// <summary>
  13. /// Center point of the sphere.
  14. /// </summary>
  15. public Vector3 Center
  16. {
  17. get { return _center; }
  18. set { _center = value; }
  19. }
  20. /// <summary>
  21. /// Radius of the sphere.
  22. /// </summary>
  23. public float Radius
  24. {
  25. get { return _radius; }
  26. set { _radius = value; }
  27. }
  28. /// <summary>
  29. /// Creates a new sphere object.
  30. /// </summary>
  31. /// <param name="center">Center point of the sphere.</param>
  32. /// <param name="radius">Radius of the sphere.</param>
  33. public Sphere(Vector3 center, float radius)
  34. {
  35. _center = center;
  36. _radius = radius;
  37. }
  38. };
  39. }