Repository: FlaxEngine/FlaxEngine
File: Source/Engine/Physics/Actors/RigidBody.h (C/C++)

Code before:
    /// <para>
    /// If intersecting bodies are being depenetrated too violently, increase the number of velocity
    /// iterations. More velocity iterations will drive the relative exit velocity of the intersecting
    /// objects closer to the correct value given the restitution.
    /// </para>
    /// <para>
    /// Default: 4 position iterations, 1 velocity iteration.
    /// </para>
    /// </remarks>
    /// <param name="minPositionIters">The minimum number of position iterations the solver should perform for this body.</param>
    /// <param name="minVelocityIters">The minimum number of velocity iterations the solver should perform for this body.</param>
    API_FUNCTION() void SetSolverIterationCounts(int32 minPositionIters, int32 minVelocityIters) const;

    /// <summary>
    /// Gets a point on one of the colliders attached to the attached that is closest to a given location. Can be used to find a hit location or position to apply explosion force or any other special effects.
    /// </summary>
    /// <param name="position">The position to find the closest point to it.</param>
    /// <param name="result">The result point on the rigidbody shape that is closest to the specified location.</param>
    API_FUNCTION() void ClosestPoint(const Vector3& position, API_PARAM(Out) Vector3& result) const;

    /// <summary>
    /// Moves and rotates the rigidbody in world space within the limits of defined constraints.
    /// </summary>
    /// <param name="translation">The translation vector.</param>
    /// <param name="rotation">The rotation quaternion.</param>
    API_FUNCTION() void AddMovement(const Vector3& translation, const Quaternion& rotation) override;
public:
    /// <summary>
    /// Occurs when a collision start gets registered for this rigidbody (it collides with something).
    /// </summary>
    API_EVENT() Delegate<const Collision&> CollisionEnter;

    /// <summary>
    /// Occurs when a collision end gets registered for this rigidbody (it ends colliding with something).
    /// </summary>
    API_EVENT() Delegate<const Collision&> CollisionExit;

    /// <summary>
    /// Occurs when this rigidbody trigger touching start gets registered for this collider (the other collider enters it and triggers the event).
    /// </summary>
    API_EVENT() Delegate<PhysicsColliderActor*> TriggerEnter;

    /// <summary>
    /// Occurs when this rigidbody trigger touching end gets registered for this collider (the other collider enters it and triggers the event).
    /// </summary>
    API_EVENT() Delegate<PhysicsColliderActor*> TriggerExit;

public:
    void OnCollisionEnter(const Collision& c);
    void OnCollisionExit(const Collision& c);


Review comment (suggestion):
Move it down below `// [Actor]` and remove not needed XML doc comments and `API_FUNCTION()` so it's just pure override (base Actor class has proper docs and exposed scripting info).

Code after:
    /// <para>
    /// If intersecting bodies are being depenetrated too violently, increase the number of velocity
    /// iterations. More velocity iterations will drive the relative exit velocity of the intersecting
    /// objects closer to the correct value given the restitution.
    /// </para>
    /// <para>
    /// Default: 4 position iterations, 1 velocity iteration.
    /// </para>
    /// </remarks>
    /// <param name="minPositionIters">The minimum number of position iterations the solver should perform for this body.</param>
    /// <param name="minVelocityIters">The minimum number of velocity iterations the solver should perform for this body.</param>
    API_FUNCTION() void SetSolverIterationCounts(int32 minPositionIters, int32 minVelocityIters) const;

    /// <summary>
    /// Gets a point on one of the colliders attached to the attached that is closest to a given location. Can be used to find a hit location or position to apply explosion force or any other special effects.
    /// </summary>
    /// <param name="position">The position to find the closest point to it.</param>
    /// <param name="result">The result point on the rigidbody shape that is closest to the specified location.</param>
    API_FUNCTION() void ClosestPoint(const Vector3& position, API_PARAM(Out) Vector3& result) const;

public:
    /// <summary>
    /// Occurs when a collision start gets registered for this rigidbody (it collides with something).
    /// </summary>
    API_EVENT() Delegate<const Collision&> CollisionEnter;

    /// <summary>
    /// Occurs when a collision end gets registered for this rigidbody (it ends colliding with something).
    /// </summary>
    API_EVENT() Delegate<const Collision&> CollisionExit;

    /// <summary>
    /// Occurs when this rigidbody trigger touching start gets registered for this collider (the other collider enters it and triggers the event).
    /// </summary>
    API_EVENT() Delegate<PhysicsColliderActor*> TriggerEnter;

    /// <summary>
    /// Occurs when this rigidbody trigger touching end gets registered for this collider (the other collider enters it and triggers the event).
    /// </summary>
    API_EVENT() Delegate<PhysicsColliderActor*> TriggerExit;

public:
    void OnCollisionEnter(const Collision& c);
    void OnCollisionExit(const Collision& c);

    void OnTriggerEnter(PhysicsColliderActor* c);
    void OnTriggerExit(PhysicsColliderActor* c);

    // Called when collider gets detached from this rigidbody or activated/deactivated. Used to update rigidbody mass.
    virtual void OnColliderChanged(Collider* c);