MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / ApplySpawnIniToPhysicShell

Function ApplySpawnIniToPhysicShell

ogsr_engine/xrGame/PhysicsShell.cpp:184–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184void 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}

Callers 4

CreateBodyMethod · 0.85
net_SpawnMethod · 0.85
CreateSkeletonMethod · 0.85
CreateSkeletonMethod · 0.85

Calls 11

fix_bonesFunction · 0.85
section_existMethod · 0.80
line_existMethod · 0.80
SetIgnoreStaticMethod · 0.80
SetSmallMethod · 0.80
SetIgnoreSmallMethod · 0.80
SetIgnoreRagDollMethod · 0.80
SetIgnoreDynamicMethod · 0.80
SetIgnoreAnimatedMethod · 0.80
CreateShellAnimatorMethod · 0.80
r_stringMethod · 0.45

Tested by

no test coverage detected