FluXY
1.3
2.5D fluid simulator for Unity
|
Classes | |
struct | BoundaryConditions |
struct | EdgeFalloff |
Public Types | |
enum | LookAtMode { LookAt, CopyOrientation } |
enum | ContainerShape { Plane, Volume, Custom } |
Public Member Functions | |
virtual void | UpdateContainerShape () |
virtual void | Clear () |
Vector3 | TransformWorldVectorToUVSpace (in Vector3 vector, in Vector4 uvRect) |
Vector3 | TransformUVVectorToWorldSpace (in Vector3 vector, in Vector4 uvRect) |
Vector3 | TransformWorldPointToUVSpace (in Vector3 point, in Vector4 uvRect) |
virtual void | UpdateTransform () |
virtual void | UpdateMaterial (int tile, FluxyStorage.Framebuffer fb) |
virtual Vector4 | ProjectTarget (in Vector3 targetPosition, Vector2 projectionSize, float aspectRatio, bool scaleWithDistance=true) |
Vector3 | UpdateVelocityAndGetAcceleration () |
Vector3 | GetVelocityAt (Vector3 worldPosition) |
Public Attributes | |
ContainerShape | containerShape = ContainerShape.Plane |
Shape of the container: can be flat, can be a volume, or can be a custom mesh. More... | |
Vector2Int | subdivisions = Vector2Int.one |
Amount of subdivisions in the plane mesh. More... | |
Mesh | customMesh = null |
Custom mesh used by the container. If null, a subdivided plane will be used instead. More... | |
Vector3 | size = Vector3.one |
Size of the container in local space. More... | |
LookAtMode | lookAtMode = LookAtMode.LookAt |
Method using for facing the lookAt transform: look to it, or copy its orientation. More... | |
Transform | lookAt |
Transform that the container should be facing at all times. If unused, you can set the container's rotation manually. More... | |
Transform | projectFrom |
Transform used as raycasting origin for splatting targets onto this container. If unused, simple planar projection will be used instead. More... | |
Texture2D | clearTexture |
Texture used for clearing the container's density buffer. More... | |
Color | clearColor |
Color used to tint the clear texture. More... | |
Texture2D | surfaceNormals |
Normal map used to determine container surface normal. More... | |
Vector2 | normalTiling = Vector2.one |
Tiling of surface normals. More... | |
float | normalScale = 1 |
Intensity of the surface normals. More... | |
EdgeFalloff | edgeFalloff |
Falloff controls for density and velocity near container edges. More... | |
BoundaryConditions | boundaries |
Falloff controls for density and velocity near container edges. More... | |
float | velocityScale = 1 |
Scale (0%-100%) of container's velocity. If set to zero, containers will be regarded as static. More... | |
float | accelerationScale = 1 |
Scale (0%-100%) of container's acceleration. This controls how much world-space inertia affects the fluid. More... | |
Vector3 | gravity = Vector3.zero |
World-space gravity applied to the fluid. More... | |
Vector3 | externalForce = Vector3.zero |
World-space external force applied to the fluid. More... | |
Light | lightSource = null |
Lightsource used for volume rendering. More... | |
FluxyTarget[] | targets |
List of targets that should be splatted onto this container. More... | |
float | pressure = 1 |
Scales fluid pressure. More... | |
float | viscosity = 0 |
Scales fluid viscosity. More... | |
float | turbulence = 5 |
Amount of turbulence (vorticity) in the fluid. More... | |
float | adhesion = 0 |
Amount of adhesion to the container's surface. More... | |
float | surfaceTension = 0 |
Amount of surface tension. Higher values will make the fluid tend to form round shapes. More... | |
float | buoyancy = 1 |
Upwards buoyant force applied to fluid. It is directly proportional to the contents the density buffer's alpha channel (temperature). More... | |
Vector4 | dissipation = Vector4.zero |
Amount of density dissipated per second. More... | |
Protected Attributes | |
Mesh | proceduralMesh |
Vector3[] | vertices |
Vector3[] | normals |
Vector4[] | tangents |
Vector2[] | uvs |
int[] | triangles |
Properties | |
FluxySolver | solver [get, set] |
Vector3 | velocity [get] |
Vector3 | angularVelocity [get] |
Renderer | containerRenderer [get] |
Mesh | containerMesh [get] |
float Fluxy.FluxyContainer.accelerationScale = 1 |
Scale (0%-100%) of container's acceleration. This controls how much world-space inertia affects the fluid.
float Fluxy.FluxyContainer.adhesion = 0 |
Amount of adhesion to the container's surface.
BoundaryConditions Fluxy.FluxyContainer.boundaries |
Falloff controls for density and velocity near container edges.
float Fluxy.FluxyContainer.buoyancy = 1 |
Upwards buoyant force applied to fluid. It is directly proportional to the contents the density buffer's alpha channel (temperature).
Color Fluxy.FluxyContainer.clearColor |
Color used to tint the clear texture.
Texture2D Fluxy.FluxyContainer.clearTexture |
Texture used for clearing the container's density buffer.
ContainerShape Fluxy.FluxyContainer.containerShape = ContainerShape.Plane |
Shape of the container: can be flat, can be a volume, or can be a custom mesh.
Mesh Fluxy.FluxyContainer.customMesh = null |
Custom mesh used by the container. If null, a subdivided plane will be used instead.
Vector4 Fluxy.FluxyContainer.dissipation = Vector4.zero |
Amount of density dissipated per second.
EdgeFalloff Fluxy.FluxyContainer.edgeFalloff |
Falloff controls for density and velocity near container edges.
Vector3 Fluxy.FluxyContainer.externalForce = Vector3.zero |
World-space external force applied to the fluid.
Vector3 Fluxy.FluxyContainer.gravity = Vector3.zero |
World-space gravity applied to the fluid.
Light Fluxy.FluxyContainer.lightSource = null |
Lightsource used for volume rendering.
Transform Fluxy.FluxyContainer.lookAt |
Transform that the container should be facing at all times. If unused, you can set the container's rotation manually.
LookAtMode Fluxy.FluxyContainer.lookAtMode = LookAtMode.LookAt |
Method using for facing the lookAt transform: look to it, or copy its orientation.
float Fluxy.FluxyContainer.normalScale = 1 |
Intensity of the surface normals.
Vector2 Fluxy.FluxyContainer.normalTiling = Vector2.one |
Tiling of surface normals.
float Fluxy.FluxyContainer.pressure = 1 |
Scales fluid pressure.
Transform Fluxy.FluxyContainer.projectFrom |
Transform used as raycasting origin for splatting targets onto this container. If unused, simple planar projection will be used instead.
Vector3 Fluxy.FluxyContainer.size = Vector3.one |
Size of the container in local space.
Vector2Int Fluxy.FluxyContainer.subdivisions = Vector2Int.one |
Amount of subdivisions in the plane mesh.
Texture2D Fluxy.FluxyContainer.surfaceNormals |
Normal map used to determine container surface normal.
float Fluxy.FluxyContainer.surfaceTension = 0 |
Amount of surface tension. Higher values will make the fluid tend to form round shapes.
FluxyTarget [] Fluxy.FluxyContainer.targets |
List of targets that should be splatted onto this container.
float Fluxy.FluxyContainer.turbulence = 5 |
Amount of turbulence (vorticity) in the fluid.
float Fluxy.FluxyContainer.velocityScale = 1 |
Scale (0%-100%) of container's velocity. If set to zero, containers will be regarded as static.
float Fluxy.FluxyContainer.viscosity = 0 |
Scales fluid viscosity.