semistable single chunk pressurecell
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
0b31104ccd
commit
c48467b333
@ -5,7 +5,7 @@
|
|||||||
/**
|
/**
|
||||||
* Timestep to simulate by
|
* Timestep to simulate by
|
||||||
*/
|
*/
|
||||||
#define FLUID_PRESSURECELL_SIM_STEP 0.01f
|
#define FLUID_PRESSURECELL_SIM_STEP 0.1f
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Force of gravity in unit tests
|
* Force of gravity in unit tests
|
||||||
@ -15,7 +15,7 @@
|
|||||||
/**
|
/**
|
||||||
* Spacing of cells
|
* Spacing of cells
|
||||||
*/
|
*/
|
||||||
#define FLUID_PRESSURECELL_SPACING (1.0f/DIM)
|
#define FLUID_PRESSURECELL_SPACING (1.0f)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Multiplier applied to pressure calculations to encourage advection
|
* Multiplier applied to pressure calculations to encourage advection
|
||||||
@ -30,12 +30,12 @@
|
|||||||
/**
|
/**
|
||||||
* Diffusion constant
|
* Diffusion constant
|
||||||
*/
|
*/
|
||||||
#define FLUID_PRESSURECELL_DIFFUSION_CONSTANT 0.0001f
|
#define FLUID_PRESSURECELL_DIFFUSION_CONSTANT 0.3f
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Viscosity constant
|
* Viscosity constant
|
||||||
*/
|
*/
|
||||||
#define FLUID_PRESSURECELL_VISCOSITY_CONSTANT 0.0001f
|
#define FLUID_PRESSURECELL_VISCOSITY_CONSTANT 0.3f
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Amount of the residual to add to the pressure field each frame
|
* Amount of the residual to add to the pressure field each frame
|
||||||
@ -99,7 +99,7 @@
|
|||||||
/**
|
/**
|
||||||
* Enables recapture of density when velocity pushes it outside of bounds
|
* Enables recapture of density when velocity pushes it outside of bounds
|
||||||
*/
|
*/
|
||||||
#define FLUID_PRESSURECELL_ENABLE_RECAPTURE 1
|
#define FLUID_PRESSURECELL_ENABLE_RECAPTURE 0
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables clamping small density values to 0
|
* Enables clamping small density values to 0
|
||||||
@ -109,7 +109,7 @@
|
|||||||
/**
|
/**
|
||||||
* Enables renormalizing the velocity field to a max value of 1 during projection
|
* Enables renormalizing the velocity field to a max value of 1 during projection
|
||||||
*/
|
*/
|
||||||
#define FLUID_PRESSURECELL_ENABLE_VELOCITY_FIELD_NORMALIZAITON 1
|
#define FLUID_PRESSURECELL_ENABLE_VELOCITY_FIELD_NORMALIZAITON 0
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@ -24,7 +24,7 @@ public class FluidAcceleratedSimulator implements ServerFluidSimulator {
|
|||||||
/**
|
/**
|
||||||
* Timestep to simulate by
|
* Timestep to simulate by
|
||||||
*/
|
*/
|
||||||
public static final float SIMULATE_TIMESTEP = 0.01f;
|
public static final float SIMULATE_TIMESTEP = 0.1f;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The gravity constant
|
* The gravity constant
|
||||||
|
|||||||
@ -63,7 +63,9 @@ int fluid_sim_pressurecell_add_gravity_test1(){
|
|||||||
//
|
//
|
||||||
// cell that originall had values
|
// cell that originall had values
|
||||||
//
|
//
|
||||||
expected = 0;
|
float gravForce = FLUID_PRESSURECELL_SIM_STEP * FLUID_PRESSURECELL_GRAVITY;
|
||||||
|
gravForce = fmax(fmin(1.0f, gravForce),-1.0f); //gravity force is clamped
|
||||||
|
expected = -0.87;
|
||||||
actual = currentChunk->v[CENTER_LOC][IX(1,1,DIM-2)];
|
actual = currentChunk->v[CENTER_LOC][IX(1,1,DIM-2)];
|
||||||
if(fabs(expected - actual) > FLUID_PRESSURE_CELL_ERROR_MARGIN){
|
if(fabs(expected - actual) > FLUID_PRESSURE_CELL_ERROR_MARGIN){
|
||||||
rVal++;
|
rVal++;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user