47 lines
1.6 KiB
C++
47 lines
1.6 KiB
C++
/** @file
|
|
* Original ReactPhysics3D C++ library by Daniel Chappuis <http://www.reactphysics3d.com/> This code is re-licensed with permission from ReactPhysics3D author.
|
|
* @author Daniel CHAPPUIS
|
|
* @author Edouard DUPIN
|
|
* @copyright 2010-2016, Daniel Chappuis
|
|
* @copyright 2017, Edouard DUPIN
|
|
* @license MPL v2.0 (see license file)
|
|
*/
|
|
#pragma once
|
|
|
|
#include <ephysics/mathematics/mathematics.hpp>
|
|
|
|
namespace ephysics {
|
|
/**
|
|
* @brief Represents an impulse that we can apply to bodies in the contact or raint solver.
|
|
*/
|
|
class Impulse {
|
|
private:
|
|
/// Private assignment operator
|
|
Impulse operator=( Impulse impulse);
|
|
public:
|
|
vec3 linearImpulseBody1; //!< Linear impulse applied to the first body
|
|
vec3 angularImpulseBody1; //!< Angular impulse applied to the first body
|
|
vec3 linearImpulseBody2; //!< Linear impulse applied to the second body
|
|
vec3 angularImpulseBody2; //!< Angular impulse applied to the second body
|
|
/// Constructor
|
|
Impulse( vec3 initLinearImpulseBody1,
|
|
vec3 initAngularImpulseBody1,
|
|
vec3 initLinearImpulseBody2,
|
|
vec3 initAngularImpulseBody2):
|
|
linearImpulseBody1(initLinearImpulseBody1),
|
|
angularImpulseBody1(initAngularImpulseBody1),
|
|
linearImpulseBody2(initLinearImpulseBody2),
|
|
angularImpulseBody2(initAngularImpulseBody2) {
|
|
|
|
}
|
|
/// Copy-ructor
|
|
Impulse( Impulse impulse):
|
|
linearImpulseBody1(impulse.linearImpulseBody1),
|
|
angularImpulseBody1(impulse.angularImpulseBody1),
|
|
linearImpulseBody2(impulse.linearImpulseBody2),
|
|
angularImpulseBody2(impulse.angularImpulseBody2) {
|
|
|
|
}
|
|
};
|
|
}
|