Няма описание
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. using System;
  2. using System.Collections.Generic;
  3. using Unity.Collections;
  4. using UnityEngine;
  5. namespace UnityEngine.Rendering.Universal
  6. {
  7. /// <summary>
  8. /// Class <c>ShadowShape2D</c> stores outline geometry for use with a shadow caster.
  9. /// </summary>
  10. public abstract class ShadowShape2D
  11. {
  12. /// <summary>
  13. /// Used when calling SetShape to describe the supplied indicies
  14. /// </summary>
  15. public enum OutlineTopology
  16. {
  17. /// <summary>
  18. /// Describes an index array where a set of two consecutive points describes a line segment.
  19. /// </summary>
  20. Lines,
  21. /// <summary>
  22. /// Describes an index array where a set of three consecutive points describes a triangle.
  23. /// </summary>
  24. Triangles
  25. }
  26. /// <summary>
  27. /// Used when calling SetShape to describe the winding direction of the supplied geometry
  28. /// </summary>
  29. public enum WindingOrder
  30. {
  31. /// <summary>
  32. /// Describes an index array where all polygons have vertices in a clockwise order
  33. /// </summary>
  34. Clockwise,
  35. /// <summary>
  36. /// Describes an index array where all polygons have vertices in a counterclockwise order
  37. /// </summary>
  38. CounterClockwise
  39. }
  40. /// <summary>
  41. /// SetFlip specifies how the shadow shape should be flipped when rendered
  42. /// </summary>
  43. /// <param name="flipX"> Specifies flipping on the local x-axis </param>
  44. /// <param name="flipY"> Specifies flipping on the local y-axis </param>
  45. public abstract void SetFlip(bool flipX, bool flipY);
  46. /// <summary>
  47. /// GetFlip returns how the shadow shape should be flipped when rendered
  48. /// </summary>
  49. /// <param name="flipX"> Returns flipping on the local x-axis </param>
  50. /// <param name="flipY"> Returns flipping on the local y-axis </param>
  51. public abstract void GetFlip(out bool flipX, out bool flipY);
  52. /// <summary>
  53. /// The value to initialize the trim when created
  54. /// </summary>
  55. /// <param name="trim"> Specifies the starting trim value.</param>
  56. public abstract void SetDefaultTrim(float trim);
  57. /// <summary>
  58. /// SetShape creates shadow geometry using the supplied geometry
  59. /// </summary>
  60. /// <param name="vertices">The vertices used to create the shadow geometry.</param>
  61. /// <param name="indices">The indices used to create the shadow geometry (Lines topology) </param>
  62. /// <param name="radii">The radius at the vertex. Can be used to describe a capsule.</param>
  63. /// <param name="transform"> The transform used to create the shadow geometry.</param>
  64. /// <param name="windingOrder">The winding order of the supplied geometry.</param>
  65. /// <param name="allowContraction">Specifies if the ShadowCaster2D is allowed to contract the supplied shape(s).</param>
  66. /// <param name="createInteriorGeometry">Specifies if the ShadowCaster2D should create interior geometry. Required for shadow casters that do not use renderers as their source.</param>
  67. public abstract void SetShape(NativeArray<Vector3> vertices, NativeArray<int> indices, NativeArray<float> radii, Matrix4x4 transform, WindingOrder windingOrder = WindingOrder.Clockwise, bool allowContraction = true, bool createInteriorGeometry = false);
  68. /// <summary>
  69. /// SetShape creates shadow geometry using the supplied geometry
  70. /// </summary>
  71. /// <param name="vertices">The vertices used to create the shadow geometry.</param>
  72. /// <param name="indices">The indices used to create the shadow geometry (Lines topology) </param>
  73. /// <param name="outlineTopology">The settings to create the renderer with.</param>
  74. /// <param name="windingOrder">The winding order of the supplied geometry.</param>
  75. /// <param name="allowContraction">Specifies if the ShadowCaster2D is allowed to contract the supplied shape(s).</param>
  76. /// <param name="createInteriorGeometry">Specifies if the ShadowCaster2D should create interior geometry. Required for shadow casters that do not use renderers as their source.</param>
  77. public abstract void SetShape(NativeArray<Vector3> vertices, NativeArray<int> indices, OutlineTopology outlineTopology, WindingOrder windingOrder = WindingOrder.Clockwise, bool allowContraction = true, bool createInteriorGeometry = false);
  78. }
  79. }