C# Class LostPolygon.DynamicWaterSystem.DynamicWaterSolver

An abstract class representing the fluid wave function.
Inheritance: UnityEngine.MonoBehaviour, IDynamicWaterSolverFieldState
Mostrar archivo Open project: caffeinatedguy/Limbs Class Usage Examples

Protected Properties

Property Type Description
_canInteract bool
_field float[]
_fieldObstruction byte[]
_grid Vector2Int
_isDirty bool
_isInitialized bool

Public Methods

Method Description
CreateSplashNormalized ( Vector2 center, float radius, float force ) : void

Creates a circular drop splash on the fluid surface.

GetFieldValue ( float x, float z ) : float

Returns water level at the given position in simulation grid space.

Initialize ( Vector2Int gridSize ) : void

The initialization method. Automatically called by DynamicWater.

StepSimulation ( float speed, float damping ) : void

Executes the simulation step. This is the method where the wave simulation has to be written.

Protected Methods

Method Description
CreateSplashNormalized ( Vector2 center, float radius, float force, float &field ) : void

Creates a circular drop splash on the fluid surface.

Private Methods

Method Description
Awake ( ) : void

Ensures that DynamicWaterSolver is attached to the object having a DynamicWater component.

Method Details

CreateSplashNormalized() public abstract method

Creates a circular drop splash on the fluid surface.
public abstract CreateSplashNormalized ( Vector2 center, float radius, float force ) : void
center UnityEngine.Vector2 /// The center of the splash in simulation grid space. ///
radius float /// The radius of the splash. ///
force float /// The amount of force applied to create the splash. ///
return void

CreateSplashNormalized() protected method

Creates a circular drop splash on the fluid surface.
protected CreateSplashNormalized ( Vector2 center, float radius, float force, float &field ) : void
center UnityEngine.Vector2 /// The center of the splash in simulation grid space. ///
radius float /// The radius of the splash in simulation grid nodes. ///
force float /// The amount of force applied to create the splash. ///
field float /// The simulation state field to create splash on. ///
return void

GetFieldValue() public abstract method

Returns water level at the given position in simulation grid space.
public abstract GetFieldValue ( float x, float z ) : float
x float /// The x coordinate. ///
z float /// The z coordinate. ///
return float

Initialize() public method

The initialization method. Automatically called by DynamicWater.
public Initialize ( Vector2Int gridSize ) : void
gridSize Vector2Int /// The size in nodes of simulation grid. ///
return void

StepSimulation() public abstract method

Executes the simulation step. This is the method where the wave simulation has to be written.
public abstract StepSimulation ( float speed, float damping ) : void
speed float /// The overall simulation speed factor. ///
damping float /// The damping value (range 0-1). ///
return void

Property Details

_canInteract protected_oe property

protected bool _canInteract
return bool

_field protected_oe property

protected float[] _field
return float[]

_fieldObstruction protected_oe property

protected byte[] _fieldObstruction
return byte[]

_grid protected_oe property

protected Vector2Int,LostPolygon.DynamicWaterSystem _grid
return Vector2Int

_isDirty protected_oe property

protected bool _isDirty
return bool

_isInitialized protected_oe property

protected bool _isInitialized
return bool