Skip to content

Commit

Permalink
falling cloth
Browse files Browse the repository at this point in the history
  • Loading branch information
Salil03 committed Apr 11, 2024
1 parent 3f68180 commit a570c3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion a4/src/cloth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "cloth.hpp"

constexpr float GRAVITY = 10;
constexpr float GRAVITY = 0.1;

Cloth::Cloth(glm::vec3 p1, glm::vec3 p2, glm::vec3 p3, glm::vec3 p4, int _res_w, int _res_h, float _k_struct,
float _k_shear, float _k_bend, float _mass, float _time)
Expand Down
4 changes: 2 additions & 2 deletions a4/src/e2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ int main()
// initializeScene();

object = r.createObject();
Cloth cloth(glm::vec3(-0.5f, 0.5f, -1.0f), glm::vec3(0.5f, 0.5f, -1.0f), glm::vec3(0.5f, -0.5f, -1.0f),
glm::vec3(-0.5f, -0.5f, -1.0f), 10, 10, 100000.0f, 10, 1, 100, SDL_GetTicks64() * 1e-3);
Cloth cloth(glm::vec3(-0.5f, 0.0f, -2.0f), glm::vec3(0.5f, 0.0f, -2.0f), glm::vec3(0.5f, 0.0f, -1.0f),
glm::vec3(-0.5f, 0.0f, -1.0f), 10, 10, 10000.0f, 500.0f, 100.0f, 100, SDL_GetTicks64() * 1e-3);
for (int i = 0; i < cloth.res_w; i++)
{
cloth.fix_vertex(0, i);
Expand Down

0 comments on commit a570c3b

Please sign in to comment.