From d6e2105aa23bc25f2e497c92a7ca0dcb0eb05ba7 Mon Sep 17 00:00:00 2001 From: Irlan Date: Sun, 7 Jul 2019 09:33:20 -0300 Subject: [PATCH] Small refactor --- include/bounce/bounce.h | 1 + include/bounce/cloth/cloth_mesh.h | 13 ------- include/bounce/cloth/forces/strech_force.h | 4 +-- include/bounce/cloth/garment_cloth_mesh.h | 36 +++++++++++++++++++ ...{cloth_mesh.cpp => garment_cloth_mesh.cpp} | 2 +- 5 files changed, 40 insertions(+), 16 deletions(-) create mode 100644 include/bounce/cloth/garment_cloth_mesh.h rename src/bounce/cloth/{cloth_mesh.cpp => garment_cloth_mesh.cpp} (98%) diff --git a/include/bounce/bounce.h b/include/bounce/bounce.h index 58e0faa..3826bb5 100644 --- a/include/bounce/bounce.h +++ b/include/bounce/bounce.h @@ -65,6 +65,7 @@ #include #include +#include #include #include #include diff --git a/include/bounce/cloth/cloth_mesh.h b/include/bounce/cloth/cloth_mesh.h index 391f88e..98c9205 100644 --- a/include/bounce/cloth/cloth_mesh.h +++ b/include/bounce/cloth/cloth_mesh.h @@ -19,7 +19,6 @@ #ifndef B3_CLOTH_MESH_H #define B3_CLOTH_MESH_H -#include #include struct b3ClothMeshTriangle @@ -53,16 +52,4 @@ struct b3ClothMesh b3ClothMeshSewingLine* sewingLines; }; -struct b3GarmentMesh; - -// Convenience structure. -struct b3GarmentClothMesh : public b3ClothMesh -{ - b3GarmentClothMesh(); - ~b3GarmentClothMesh(); - - // Set this mesh from a 2D garment mesh. - void Set(const b3GarmentMesh* garment); -}; - #endif \ No newline at end of file diff --git a/include/bounce/cloth/forces/strech_force.h b/include/bounce/cloth/forces/strech_force.h index 7d8dde9..ecbb5a2 100644 --- a/include/bounce/cloth/forces/strech_force.h +++ b/include/bounce/cloth/forces/strech_force.h @@ -83,10 +83,10 @@ private: // Damping stiffness float32 m_kd; - // bu + // Desired strechiness in u direction float32 m_bu; - // bv + // Desired strechiness in v direction float32 m_bv; // Action forces diff --git a/include/bounce/cloth/garment_cloth_mesh.h b/include/bounce/cloth/garment_cloth_mesh.h new file mode 100644 index 0000000..b33d810 --- /dev/null +++ b/include/bounce/cloth/garment_cloth_mesh.h @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2016-2019 Irlan Robson https://irlanrobson.github.io +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B3_GARMENT_CLOTH_MESH_H +#define B3_GARMENT_CLOTH_MESH_H + +#include + +struct b3GarmentMesh; + +// Convenience structure. +struct b3GarmentClothMesh : public b3ClothMesh +{ + b3GarmentClothMesh(); + ~b3GarmentClothMesh(); + + // Set this mesh from a 2D garment mesh. + void Set(const b3GarmentMesh* garment); +}; + +#endif \ No newline at end of file diff --git a/src/bounce/cloth/cloth_mesh.cpp b/src/bounce/cloth/garment_cloth_mesh.cpp similarity index 98% rename from src/bounce/cloth/cloth_mesh.cpp rename to src/bounce/cloth/garment_cloth_mesh.cpp index 59b106e..5f09f49 100644 --- a/src/bounce/cloth/cloth_mesh.cpp +++ b/src/bounce/cloth/garment_cloth_mesh.cpp @@ -16,7 +16,7 @@ * 3. This notice may not be removed or altered from any source distribution. */ -#include +#include #include #include #include