blender/intern/elbeem/intern/ntl_geometryclass.h
Nils Thuerey 3bea663ffa - bugfixes
#4742 exported normals are now correct
  #4821 & 4956 for complex movements in/outflows can now also
  use the animated mesh option
- new features
  * isosurface subdivision: directly
    creates a finer surface mesh from the simulation data.
    this increases simulation time and harddisk usage, though, so
    be careful - usually values of 2-4 should be enough.
  * fluidsim particles: extended model for particle
    simulation and generation. When isosurface subdivision is enabled,
    the particles are now included in the surface generation,
    giving a better impression of a single connected surface.
    Note - the particles are only included in the final surface
    mesh, so the preview surface shows none of the particle
    effects.
  * particle loading: different types of particles can now be selected for
    display: drops, floats and tracers. This is a bit obsolete
    due to the extensions mentioned above, but might still be useful.
    Floats are just particles floating on the fluid surface, could
    be used for e.g. foam.
  * moving objects impact factor: this is another tweaking option,
    as the handling of moving objects is still not conserving
    mass. setting this to zero simply deletes the fluid, 1 is
    the default, while larger values cause a stronger
    impact. For tweaking the simulation: if fluid disappears, try
    increasing this value, and if too much is appearing reduce it.
    You can even use negative values for some strange results :)
- more code cleanup, e.g. removed config file writing in fluidsim.c,
  added additional safety checks for particles & fluidsim domains (these
  currently dont work together). I also removed the "build particles"
  debug message in effects.c (seemed to be unnecessary?).

Some more info on the new features:
Here are two test animations showing the difference between
using the particle generation with isosurface subdivision.
This is how it would look with the old solver version:
http://www10.informatik.uni-erlangen.de/~sinithue/blender/fluid6_fl6manc4_1noparts.mpg
and this with the new one:
http://www10.informatik.uni-erlangen.de/~sinithue/blender/fluid6_fl6manc4_2wparts.mpg
Both simulations use a resolution of 64, however, the version with particles
takes significantly longer (almost twice as long).
The .blend file for a similar setup can be found here:
http://www10.informatik.uni-erlangen.de/~sinithue/blender/fluid6_testmanc4.blend
(Minor Tips for this file: dont enable subdivions of characters until rendering,
thus leave off for simulation, as it uses the rendering settings! For making
nice pictures switch on subdivion, and OSA.)

And here's a picture of old vs. new (for webpage or so):
http://www10.informatik.uni-erlangen.de/~sinithue/blender/fluid6_manc4compare.png
2006-11-05 16:30:29 +00:00

116 lines
3.5 KiB
C++

/******************************************************************************
*
* El'Beem - Free Surface Fluid Simulation with the Lattice Boltzmann Method
* Copyright 2003-2006 Nils Thuerey
*
* Base class for geometry shaders and objects
*
*****************************************************************************/
#ifndef NTL_GEOMETRYCLASS_H
#define NTL_GEOMETRYCLASS_H
#include "attributes.h"
//! geometry class type ids
#define GEOCLASSTID_OBJECT 1
#define GEOCLASSTID_SHADER 2
#define GEOCLASSTID_BOX (GEOCLASSTID_OBJECT| 4)
#define GEOCLASSTID_OBJMODEL (GEOCLASSTID_OBJECT| 8)
#define GEOCLASSTID_SPHERE (GEOCLASSTID_OBJECT| 16)
class ntlGeometryClass
{
public:
//! Default constructor
inline ntlGeometryClass() :
mVisible( 1 ), mName( "[ObjNameUndef]" ),
mObjectId(-1), mpAttrs( NULL ), mGeoInitId(-1)
{
mpAttrs = new AttributeList("objAttrs");
mpSwsAttrs = new AttributeList("swsAttrs");
};
//! Default destructor
virtual ~ntlGeometryClass() {
delete mpAttrs;
};
//! Return type id
virtual int getTypeId() = 0;
/*! Set the object name */
inline void setName(string set) { mName = set; }
/*! Get the object name */
inline string getName( void ) { return mName; }
/*! Sets the visibility attribute
* visibility can be determined at shader _and_ object level , hiding a shader
* means comepletely decativating it */
inline void setVisible(int set) { mVisible=set; }
/*! Returns the visibility attribute */
inline int getVisible() const { return mVisible; }
/*! Sets the attribute list pointer */
inline void setAttributeList(AttributeList *set) { mpAttrs=set; }
/*! Returns the attribute list pointer */
inline AttributeList *getAttributeList() { return mpAttrs; }
/*! Get/Sets the attribute list pointer */
inline void setSwsAttributeList(AttributeList *set) { mpSwsAttrs=set; }
inline AttributeList *getSwsAttributeList() { return mpSwsAttrs; }
/*! for easy GUI detection get start of axis aligned bounding box, return NULL of no BB */
virtual inline ntlVec3Gfx *getBBStart() { return NULL; }
virtual inline ntlVec3Gfx *getBBEnd() { return NULL; }
/*! Set/get the object id*/
inline void setObjectId(int set) { mObjectId=set; }
inline int getObjectId() const { return mObjectId; }
/*! GUI - this function is called for selected objects to display debugging information with OpenGL */
virtual void drawDebugDisplay() { /* do nothing by default */ }
/*! GUI - this function is called for selected objects to display interactive information with OpenGL */
virtual void drawInteractiveDisplay() { /* do nothing by default */ }
/*! GUI - handle mouse movement for selection */
virtual void setMousePos(int ,int , ntlVec3Gfx , ntlVec3Gfx ) { /* do nothing by default */ }
/*! GUI - notify object that mouse was clicked at last pos */
virtual void setMouseClick() { /* do nothing by default */ }
/*! Returns the geo init id */
inline void setGeoInitId(int set) { mGeoInitId=set; }
/*! Returns the geo init id */
inline int getGeoInitId() const { return mGeoInitId; }
protected:
/*! Object visible on/off */
int mVisible;
/*! Name of this object */
string mName;
/*! global scene object id */
int mObjectId;
/*! configuration attributes */
AttributeList *mpAttrs;
/*! sws configuration attributes */
AttributeList *mpSwsAttrs;
/* fluid init data */
/*! id of fluid init (is used in solver initialization), additional data stored only for objects */
int mGeoInitId;
private:
};
#endif