| 182 | } |
| 183 | |
| 184 | void ApplySpawnIniToPhysicShell(CInifile* ini, CPhysicsShell* physics_shell, bool fixed) |
| 185 | { |
| 186 | if (!ini) |
| 187 | return; |
| 188 | |
| 189 | if (ini->section_exist("physics_common")) |
| 190 | { |
| 191 | fixed = fixed || (ini->line_exist("physics_common", "fixed_bones")); |
| 192 | fix_bones(ini->r_string("physics_common", "fixed_bones"), physics_shell); |
| 193 | } |
| 194 | |
| 195 | if (ini->section_exist("collide")) |
| 196 | { |
| 197 | #ifdef ANIMATED_PHYSICS_OBJECT_SUPPORT |
| 198 | if ((ini->line_exist("collide", "ignore_static") && fixed) || (ini->line_exist("collide", "ignore_static") && ini->section_exist("animated_object"))) |
| 199 | #else |
| 200 | if (ini->line_exist("collide", "ignore_static") && fixed) |
| 201 | #endif |
| 202 | { |
| 203 | physics_shell->SetIgnoreStatic(); |
| 204 | } |
| 205 | if (ini->line_exist("collide", "small_object")) |
| 206 | { |
| 207 | physics_shell->SetSmall(); |
| 208 | } |
| 209 | if (ini->line_exist("collide", "ignore_small_objects")) |
| 210 | { |
| 211 | physics_shell->SetIgnoreSmall(); |
| 212 | } |
| 213 | if (ini->line_exist("collide", "ignore_ragdoll")) |
| 214 | { |
| 215 | physics_shell->SetIgnoreRagDoll(); |
| 216 | } |
| 217 | if (ini->line_exist("collide", "ignore_dynamic")) |
| 218 | { |
| 219 | physics_shell->SetIgnoreDynamic(); |
| 220 | } |
| 221 | |
| 222 | #ifdef ANIMATED_PHYSICS_OBJECT_SUPPORT |
| 223 | // If need, then show here that it is needed to ignore collisions with "animated_object" |
| 224 | if (ini->line_exist("collide", "ignore_animated_objects")) |
| 225 | { |
| 226 | physics_shell->SetIgnoreAnimated(); |
| 227 | } |
| 228 | #endif |
| 229 | } |
| 230 | |
| 231 | #ifdef ANIMATED_PHYSICS_OBJECT_SUPPORT |
| 232 | // If next section is available then given "PhysicShell" is classified |
| 233 | // as animated and we read options for his animation |
| 234 | |
| 235 | if (ini->section_exist("animated_object")) |
| 236 | { |
| 237 | // Show that given "PhysicShell" animated |
| 238 | physics_shell->CreateShellAnimator(); |
| 239 | } |
| 240 | #endif |
| 241 | } |
no test coverage detected