reference.adoc 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. = Next Generation Particles - Reference
  2. :author:
  3. :revnumber:
  4. :revdate: 2016/03/17 20:48
  5. :relfileprefix: ../../../
  6. :imagesdir: ../../..
  7. ifdef::env-github,env-browser[:outfilesuffix: .adoc]
  8. The Parameters for a ParticleController are:
  9. [cols="2", options="header"]
  10. |===
  11. a| name
  12. a| The name to use for the geometry in the scene graph
  13. a| mesh
  14. a| The mesh to use (Usually either PointMesh or QuadMesh)
  15. a| maxParticles
  16. a| The maximum number of particles to allow active at any one time
  17. a| lifeMin
  18. a| The minimum amount of time (in seconds) for which each particle lives
  19. a| lifeMax
  20. a| The maximum amount of time (in seconds) for which each particle lives
  21. a| source
  22. a| The source from which the particles are spawned
  23. a| emissionController
  24. a| The frequency and timing with which particles are spawned. If null then no particles are automatically spawned and they must be triggered manually using emitNextParticle() or emitAllParticles()
  25. a| influencers
  26. a| Zero or more ParticleInfluencers, each of which changes the behaviour of the particles.
  27. |===
  28. All of the following classes have defined Interfaces or Abstract Classes to allow custom implementations and behaviour to easily be plugged into the system.
  29. Javadoc for the system can be found at link:http://www.zero-separation.com/particles/javadoc[http://www.zero-separation.com/particles/javadoc]
  30. == Mesh
  31. The Mesh options are:
  32. [cols="2", options="header"]
  33. |===
  34. a| PointMesh
  35. a| Fastest and most efficient, but also most limited
  36. a| QuadMesh
  37. a| Much more flexible than point mesh, all particles are represented as 2-dimensional quads
  38. a| TemplateMesh
  39. a| Allows particles to be full 3d objects, with the mesh for each particle being generated from one of any number of template meshes. This allows fully 3d particles and takes in texture co-ordinates and even (if required) vertex colours and normals from the original mesh converting them as required.
  40. |===
  41. == Source
  42. The Source options are:
  43. [cols="2", options="header"]
  44. |===
  45. a| PointSource
  46. a| Generates all particles from a specific point with a random velocity. The point itself is a spatial so can be attached to the scene graph and will move with it.
  47. a| MeshSource
  48. a| Generates all particles from a randomly selected point on the given mesh. A random triangle is selected and then the particle emitter from a random point within that triangle along the triangle's normal vector.
  49. a| WeightedMeshSource
  50. a| Provides the same functionality as MeshSource but weights triangles based on their relative size, larger triangles will tend to emit more particles. This provides a more even spread but uses more resources and needs to be kept updated if the mesh changes.
  51. a| ParticleParticleSource
  52. a| Emits particles from another ParticleController. The particle is emitted from a randomly selected active particle and the new particle starts with identical velocity, rotation, etc as the particle it is being emitted from.
  53. |===
  54. == EmissionControllers
  55. [cols="2", options="header"]
  56. |===
  57. a| NULL
  58. a| The NULL EmissionController does not automatically emit any particles, they must be emitted externally by a call to the ParticleController emitNextParticle() or emitAllParticles(). Note that if the ParticleController is not in use for an extended period of time it is recommended that to save resources you pause it by either disabling the controller or removing the Geometry from the scene graph.
  59. a| RegularEmission
  60. a| This EmissionController just emits particles at regular intervals, it will emit multiple particles in one frame if more than one interval has passed since the previous frame.
  61. |===
  62. == Influencers
  63. [cols="2", options="header"]
  64. |===
  65. a| ColorInfluencer
  66. a| Modify the particle's color over time
  67. a| GravityInfluencer
  68. a| Apply steady acceleration in a specified direction over time
  69. a| MultiColorInfluencer
  70. a| Modify the particle's color through multiple colors over time
  71. a| PreferredDestinationInfluencer
  72. a| Move the particle towards a specified point
  73. a| PreferredDirectionInfluencer
  74. a| Rotate the particles velocity towards the given direction over time
  75. a| RandomImpulseInfluencer
  76. a| Apply a random impulse to the particle either at initialization or every frame
  77. a| RandomSpriteInfluencer
  78. a| Select a random sprite for the particle from those available when it is initialized
  79. a| RotationInfluencer
  80. a| Rotate the particle by picking an initial rotational velocity at random and then maintaining it
  81. a| SizeInfluencer
  82. a| Modify the particle's size over time
  83. a| SpatialDestinationInfluencer
  84. a| Move the particle towards a given spatial, it will attempt to reach the current location of the spatial by the end of the particle's life cycle.
  85. a| SpeedInfluencer
  86. a| Modify the particle's speed over time
  87. a| SpriteAnimationInfluencer
  88. a| Animate the particle through the available sprites over time
  89. |===