diff options
author | Jacques Lucke <jacques@blender.org> | 2020-07-25 12:54:06 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-07-25 12:54:06 +0300 |
commit | eeaa4379aaeb17adf8df168baeb2617d8af506ed (patch) | |
tree | ea96485e859ffedfb3cd81f40b59d42df52c1707 /source/blender/makesdna/DNA_simulation_types.h | |
parent | ddd4fec386f9a1e4543b8be2de3dce538cd90ccf (diff) |
Simulation: cleanup dna data
Diffstat (limited to 'source/blender/makesdna/DNA_simulation_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_simulation_types.h | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/source/blender/makesdna/DNA_simulation_types.h b/source/blender/makesdna/DNA_simulation_types.h index c0be66dcb30..afc59b422c5 100644 --- a/source/blender/makesdna/DNA_simulation_types.h +++ b/source/blender/makesdna/DNA_simulation_types.h @@ -30,16 +30,21 @@ typedef struct Simulation { struct bNodeTree *nodetree; - int flag; + uint32_t flag; + + /** This is the frame in scene time, that the states correspond to. */ float current_frame; + + /** Time since the start of the simulation in simulation time (which might differ from scene + * time). */ float current_simulation_time; char _pad[4]; /** List containing SimulationState objects. */ struct ListBase states; - /** List containing PersistentDataHandleItem objects. */ - struct ListBase persistent_data_handles; + /** List containing SimulationDependency objects. */ + struct ListBase dependencies; } Simulation; typedef struct SimulationState { @@ -54,8 +59,8 @@ typedef struct ParticleSimulationState { SimulationState head; /** Contains the state of the particles at time Simulation->current_frame. */ - int tot_particles; - int next_particle_id; + int32_t tot_particles; + int32_t next_particle_id; struct CustomData attributes; } ParticleSimulationState; @@ -66,24 +71,25 @@ typedef struct ParticleMeshEmitterSimulationState { char _pad[4]; } ParticleMeshEmitterSimulationState; -/** Stores a mapping between an integer handle and a corresponding ID data block. */ -typedef struct PersistentDataHandleItem { - struct PersistentDataHandleItem *next; - struct PersistentDataHandleItem *prev; +/** Stores a reference to data that the simulation depends on. This is partially derived from the + * simulation node tree. */ +typedef struct SimulationDependency { + struct SimulationDependency *next; + struct SimulationDependency *prev; struct ID *id; - int handle; - int flag; -} PersistentDataHandleItem; + int32_t handle; + uint32_t flag; +} SimulationDependency; /* Simulation.flag */ enum { SIM_DS_EXPAND = (1 << 0), }; -/* PersistentDataHandleItem.flag */ +/* SimulationDependency.flag */ enum { - SIM_HANDLE_DEPENDS_ON_TRANSFORM = (1 << 0), - SIM_HANDLE_DEPENDS_ON_GEOMETRY = (1 << 1), + SIM_DEPENDS_ON_TRANSFORM = (1 << 0), + SIM_DEPENDS_ON_GEOMETRY = (1 << 1), }; #define SIM_TYPE_NAME_PARTICLE_SIMULATION "Particle Simulation" |