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

Function do_collide_and_move

ogsr_engine/xrGame/ActorCameraCollision.cpp:246–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246bool do_collide_and_move(const Fmatrix& xform, CPhysicsShellHolder* l_actor, CPhysicsShell* shell, CPhysicsElement* roote)
247{
248 ZoneScoped;
249
250 ///////////////////////////////////////////////////////////////////
251 VERIFY(ph_world);
252 VERIFY(!ph_world->Processing());
253 cam_collided = false;
254 cam_step = false;
255 VERIFY(l_actor);
256 // VERIFY( l_actor->character_physics_support() );
257 // VERIFY( l_actor->character_physics_support()->movement() );
258 // l_actor->character_physics_support()->movement()->CollisionEnable( FALSE );
259 l_actor->MovementCollisionEnable(false);
260 shell->EnableCollision();
261 shell->CollideAll();
262
263 bool collided = false;
264 if (cam_collided)
265 {
266 collided = true;
267 //#ifdef DEBUG
268 // debug_output().PH_DBG_Clear();
269 // debug_output().DBG_OpenCashedDraw();
270 //#endif
271 cam_step = true;
272 for (u16 i = 0; i < cam_correction_steps_num; ++i)
273 {
274 shell->set_LinearVel(Fvector().set(0, 0, 0));
275 shell->set_AngularVel(Fvector().set(0, 0, 0));
276 roote->setQuaternion(Fquaternion().set(xform));
277 cam_collided = false;
278 shell->PureStep();
279
280 if (!cam_collided)
281 break;
282 }
283 cam_step = false;
284 //#ifdef DEBUG
285 // debug_output().DBG_ClosedCashedDraw( 5000 );
286 //#endif
287 }
288
289 shell->DisableCollision();
290 // l_actor->character_physics_support()->movement()->CollisionEnable( TRUE );
291 l_actor->MovementCollisionEnable(true);
292 shell->Disable();
293
294 return collided;
295}
296
297bool do_collide_not_move(const Fmatrix& xform, CPhysicsShellHolder* l_actor, CPhysicsShell* shell, CPhysicsElement* roote)
298{

Callers 1

collide_cameraFunction · 0.85

Calls 10

EnableCollisionMethod · 0.80
CollideAllMethod · 0.80
PureStepMethod · 0.80
DisableCollisionMethod · 0.80
set_LinearVelMethod · 0.45
setMethod · 0.45
set_AngularVelMethod · 0.45
setQuaternionMethod · 0.45
DisableMethod · 0.45

Tested by

no test coverage detected