diff options
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_rigidbody_types.h | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/source/blender/makesdna/DNA_rigidbody_types.h b/source/blender/makesdna/DNA_rigidbody_types.h index 5a7e7c92380..b7d422e7bdf 100644 --- a/source/blender/makesdna/DNA_rigidbody_types.h +++ b/source/blender/makesdna/DNA_rigidbody_types.h @@ -42,6 +42,16 @@ struct EffectorWeights; /* ******************************** */ /* RigidBody World */ +/* Container for data shared by original and evaluated copies of RigidBodyWorld */ +typedef struct RigidBodyWorld_Shared { + /* cache */ + struct PointCache *pointcache; + struct ListBase ptcaches; + + /* References to Physics Sim objects. Exist at runtime only ---------------------- */ + void *physics_world; /* Physics sim world (i.e. btDiscreteDynamicsWorld) */ +} RigidBodyWorld_Shared; + /* RigidBodyWorld (rbw) * * Represents a "simulation scene" existing within the parent scene. @@ -58,9 +68,9 @@ typedef struct RigidBodyWorld { int pad; float ltime; /* last frame world was evaluated for (internal) */ - /* cache */ - struct PointCache *pointcache; - struct ListBase ptcaches; + struct RigidBodyWorld_Shared *shared; /* This pointer is shared between all evaluated copies */ + struct PointCache *pointcache DNA_DEPRECATED; /* Moved to shared->pointcache */ + struct ListBase ptcaches DNA_DEPRECATED; /* Moved to shared->ptcaches */ int numbodies; /* number of objects in rigid body group */ short steps_per_second; /* number of simulation steps thaken per second */ @@ -68,9 +78,6 @@ typedef struct RigidBodyWorld { int flag; /* (eRigidBodyWorld_Flag) settings for this RigidBodyWorld */ float time_scale; /* used to speed up or slow down the simulation */ - - /* References to Physics Sim objects. Exist at runtime only ---------------------- */ - void *physics_world; /* Physics sim world (i.e. btDiscreteDynamicsWorld) */ } RigidBodyWorld; /* Flags for RigidBodyWorld */ @@ -86,6 +93,18 @@ typedef enum eRigidBodyWorld_Flag { /* ******************************** */ /* RigidBody Object */ +/* Container for data that is shared among CoW copies. + * + * This is placed in a separate struct so that, for example, the physics_shape + * pointer can be replaced without having to update all CoW copies. */ +# +# +typedef struct RigidBodyOb_Shared { + /* References to Physics Sim objects. Exist at runtime only */ + void *physics_object; /* Physics object representation (i.e. btRigidBody) */ + void *physics_shape; /* Collision shape used by physics sim (i.e. btCollisionShape) */ +} RigidBodyOb_Shared; + /* RigidBodyObject (rbo) * * Represents an object participating in a RigidBody sim. @@ -93,10 +112,6 @@ typedef enum eRigidBodyWorld_Flag { * participating in a sim. */ typedef struct RigidBodyOb { - /* References to Physics Sim objects. Exist at runtime only */ - void *physics_object; /* Physics object representation (i.e. btRigidBody) */ - void *physics_shape; /* Collision shape used by physics sim (i.e. btCollisionShape) */ - /* General Settings for this RigidBodyOb */ short type; /* (eRigidBodyOb_Type) role of RigidBody in sim */ short shape; /* (eRigidBody_Shape) collision shape to use */ @@ -123,6 +138,8 @@ typedef struct RigidBodyOb { float orn[4]; /* rigid body orientation */ float pos[3]; /* rigid body position */ float pad1; + + struct RigidBodyOb_Shared *shared; /* This pointer is shared between all evaluated copies */ } RigidBodyOb; |