diff --git a/Content/BP_Gamemode.uasset b/Content/BP_Gamemode.uasset deleted file mode 100644 index c4db56d..0000000 Binary files a/Content/BP_Gamemode.uasset and /dev/null differ diff --git a/Content/Blueprints/BP_Puma.uasset b/Content/Blueprints/BP_Puma.uasset index 55ec9b2..7a1b5e3 100644 Binary files a/Content/Blueprints/BP_Puma.uasset and b/Content/Blueprints/BP_Puma.uasset differ diff --git a/Content/Blueprints/BP_Robot.uasset b/Content/Blueprints/BP_Robot.uasset index faa0706..dcd2c89 100644 Binary files a/Content/Blueprints/BP_Robot.uasset and b/Content/Blueprints/BP_Robot.uasset differ diff --git a/Content/Levels/Main.umap b/Content/Levels/Main.umap index a6a29d2..cb17aa2 100644 Binary files a/Content/Levels/Main.umap and b/Content/Levels/Main.umap differ diff --git a/Source/PBDRobotics/Joint.cpp b/Source/PBDRobotics/Joint.cpp index 8906e18..3a696f6 100644 --- a/Source/PBDRobotics/Joint.cpp +++ b/Source/PBDRobotics/Joint.cpp @@ -27,8 +27,6 @@ Vector3d UJoint::GetSecondWorldAxis() const{ return SecondLink->Orientation * SecondRotateAxis; } - - void UJoint::SolvePosition(const double H) const{ ULink* L1 = FirstLink; ULink* L2 = SecondLink; @@ -109,7 +107,16 @@ void UJoint::SolvePosition(const double H) const{ void UJoint::SolveVelocity(const double H) const{ ULink* L1 = FirstLink; ULink* L2 = SecondLink; - + + constexpr double A = 7; // Damping strength + const double Damp = 1 - (A * H < 0.5 ? A * H : 0.5); + + L1->Velocity *= Damp; + L2->Velocity *= Damp; + L1->AngularVelocity *= Damp; + L2->AngularVelocity *= Damp; + + /* // Positional Damping { const Vector3d V1 = L1->Velocity; @@ -136,14 +143,6 @@ void UJoint::SolveVelocity(const double H) const{ //L1->AngularVelocity += I1.inverse() * R1.cross(P); //L2->AngularVelocity -= I2.inverse() * R2.cross(P); - - constexpr double A = 7; - const double Damp = 1 - A * H; - - L1->Velocity *= Damp; - L2->Velocity *= Damp; - L1->AngularVelocity *= Damp; - L2->AngularVelocity *= Damp; } // Rotational Damping @@ -153,6 +152,7 @@ void UJoint::SolveVelocity(const double H) const{ } + */ } UJoint::UJoint()