void ParticleContact::ContactResolve(XPhysics *_p1, XPhysics *_p2, float _restitution, float penetration, XMVECTOR _contactNormal) { this->m_pParticle1 = _p1; this->m_pParticle2 = _p2; this->m_restitution = _restitution; this->m_contactNormal = _contactNormal; ResolveVelocity(); ResolvePenetration(); }
bool UMovementComponent::SafeMoveUpdatedComponent(const FVector& Delta, const FQuat& NewRotation, bool bSweep, FHitResult& OutHit, ETeleportType Teleport) { if (UpdatedComponent == NULL) { OutHit.Reset(1.f); return false; } bool bMoveResult = MoveUpdatedComponent(Delta, NewRotation, bSweep, &OutHit, Teleport); // Handle initial penetrations if (OutHit.bStartPenetrating && UpdatedComponent) { const FVector RequestedAdjustment = GetPenetrationAdjustment(OutHit); if (ResolvePenetration(RequestedAdjustment, OutHit, NewRotation)) { // Retry original move bMoveResult = MoveUpdatedComponent(Delta, NewRotation, bSweep, &OutHit, Teleport); } } return bMoveResult; }