Blender V2.61 - r43446

DNA_cloth_types.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2006 by NaN Holding BV.
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): Daniel (Genscher)
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00027 
00032 #ifndef DNA_CLOTH_TYPES_H
00033 #define DNA_CLOTH_TYPES_H
00034 
00047 typedef struct ClothSimSettings
00048 {
00049     struct  LinkNode *cache; /* UNUSED atm */   
00050     float   mingoal;    /* see SB */
00051     float   Cdis;       /* Mechanical damping of springs.       */
00052     float   Cvi;        /* Viscous/fluid damping.           */
00053     float   gravity[3]; /* Gravity/external force vector.       */
00054     float   dt;     /* This is the duration of our time step, computed. */
00055     float   mass;       /* The mass of the entire cloth.        */
00056     float   structural; /* Structural spring stiffness.         */
00057     float   shear;      /* Shear spring stiffness.          */
00058     float   bending;    /* Flexion spring stiffness.            */
00059     float   max_bend;   /* max bending scaling value, min is "bending" */
00060     float   max_struct;     /* max structural scaling value, min is "structural" */
00061     float   max_shear;  /* max shear scaling value, UNUSED */
00062     float   avg_spring_len; /* used for normalized springs */
00063     float   timescale; /* parameter how fast cloth runs */
00064     float   maxgoal;    /* see SB */
00065     float   eff_force_scale;/* Scaling of effector forces (see softbody_calc_forces).*/
00066     float   eff_wind_scale; /* Scaling of effector wind (see softbody_calc_forces). */
00067     float   sim_time_old;
00068     float   defgoal;
00069     float   goalspring;
00070     float   goalfrict;
00071     float   velocity_smooth; /* smoothing of velocities for hair */
00072     float   collider_friction; /* friction with colliders */
00073 
00074     int     stepsPerFrame;  /* Number of time steps per frame.      */
00075     int flags;      /* flags, see CSIMSETT_FLAGS enum above.    */
00076     int preroll;    /* How many frames of simulation to do before we start. */
00077     int maxspringlen;   /* in percent!; if tearing enabled, a spring will get cut */
00078     short   solver_type;    /* which solver should be used?     txold   */
00079     short   vgroup_bend;    /* vertex group for scaling bending stiffness */
00080     short   vgroup_mass;    /* optional vertexgroup name for assigning weight.*/
00081     short   vgroup_struct;  /* vertex group for scaling structural stiffness */
00082     short   shapekey_rest;  /* vertex group for scaling structural stiffness */
00083     short   presets; /* used for presets on GUI */
00084     short   reset;
00085     short   pad[3];
00086 
00087     struct EffectorWeights *effector_weights;
00088 } ClothSimSettings;
00089 
00090 
00091 typedef struct ClothCollSettings
00092 {
00093     struct  LinkNode *collision_list; /* e.g. pointer to temp memory for collisions */
00094     float   epsilon;        /* min distance for collisions.     */
00095     float   self_friction;      /* Fiction/damping with self contact. */
00096     float   friction;       /* Friction/damping applied on contact with other object.*/
00097     float   selfepsilon;        /* for selfcollision */
00098     float repel_force, distance_repel;
00099     int flags;          /* collision flags defined in BKE_cloth.h */
00100     short   self_loop_count;    /* How many iterations for the selfcollision loop   */
00101     short   loop_count;     /* How many iterations for the collision loop.      */
00102     struct Group *group;    /* Only use colliders from this group of objects */
00103 } ClothCollSettings;
00104 
00105 
00106 #endif