Skip to content

FlowFields

mika edited this page Apr 26, 2018 · 2 revisions

FlowFields

  • void CreateFlowField(string id, int arraySize, float worldSize)
    • Creates flowfield particle array, pivot is in the middle of the gameobject
    • id is name of the created gameobject
    • int 3D array size (value of 2 would create 222 array)
    • float worldSize: gameobject width/height/depth in unity world units (meters) *not current in use yet
  • void SetFlowFieldCellLength(string id, int nx, int ny, int nz, float length)
    • set single array cell arrow length
  • void SetFlowFieldCellLengths(string id, float length)
    • set all arrow lengths
  • void SetFlowFieldCellColor(string id, int nx, int ny, int nz, int r, int g, int b, int a = 255)
    • set single array cell arrow color
  • void SetFlowFieldCellColors(string id, int r, int g, int b, int a = 255)
    • set all arrow colors
  • ``void SetFlowFieldCellRotation(string id, int nx, int ny, int nz, float ax, float ay, float az)
    • set single array cell arrow rotation angle (in euler angles)
  • void SetFlowFieldCellRotations(string id, float ax, float ay, float az)
    • set all arrow rotation angles (in euler angles)
  • void SetFlowFieldCellsTowards(string id, string target, bool invert = false)
    • set all arrow directions towards target object
    • invert can be used to flip arrow directions, by default its set to false
  • void SetFlowFieldLengthsFromDistance(string id, string target, float scale, bool invert = false)
    • set all arrow lengths based on distance to target object
    • invert can be used to flip arrow length, by default its set to false
  • void SetFlowFieldColorsFromDistance(string id, string target, int[] startColor, int[] endColor)
    • set all arrow colors based on distance to target object (interpolate color from startcolor to endcolor based on min-max distances)
  • void SetCellColorFromDistanceToObject(string id, string target, int x, int y, int z, int[] startColor, int[] endColor)
    • sets single cell color from distance to object
  • void SetFlowFieldCellRotationTowards(string id, string target, int x, int y, int z, bool invert = false)
    • sets single cell color from distance to object
Clone this wiki locally