Skip to content

Commit

Permalink
Working on pressure area object problems.
Browse files Browse the repository at this point in the history
  • Loading branch information
erayzesen committed Mar 26, 2024
1 parent 8fd60f0 commit 525ee8f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion QuarkPhysics/qmesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct QMesh

//Polygon Properties
vector<float> lastPolygonCornerAngles;
float minAngleConstraintOfPolygon=M_PI*0.1;
float minAngleConstraintOfPolygon=M_PI*0.3;

//Polygon Methods
void UpdateSubConvexPolygons();
Expand Down
3 changes: 2 additions & 1 deletion QuarkPhysics/qworld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1074,13 +1074,14 @@ bool QWorld::SortBodiesVertical(const QBody *bodyA, const QBody *bodyB)
if(body->GetMode()!=QBody::STATIC && body->GetSimulationModel()!=QBody::SimulationModels::RIGID_BODY){
QSoftBody *sBody=static_cast<QSoftBody*>(body);


for(int i=0;i<sBody->GetMeshCount();i++){
QMesh * mesh=sBody->GetMeshAt(i);
for(auto spring:mesh->springs){
spring->Update(sBody->GetRigidity()*ts,sBody->GetPassivationOfInternalSpringsEnabled());
}
}



}

Expand Down
3 changes: 1 addition & 2 deletions examples/examplesceneblobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ void ExampleSceneBlobs::OnKeyPressed(sf::Keyboard::Key key)
{
if(key==sf::Keyboard::Space){
QSoftBody *pressureBody=new QSoftBody();
pressureBody->AddMesh( QMesh::CreateWithPolygon(64,24,QVector::Zero(),-1 ,true,true) );
pressureBody->AddMesh( QMesh::CreateWithPolygon(64,12,QVector::Zero(),-1 ,true,true) );
pressureBody->SetRigidity(0.5f)->SetPosition(mousePos)->SetMass(0.5f);
pressureBody->SetAreaPreservingEnabled(true)->SetAreaPreservingRate(0.7);
pressureBody->SetSelfCollisionsEnabled(true)->SetSelfCollisionsSpecifiedRadius(6.0f);
world->AddBody(pressureBody);
}
}
Expand Down
Binary file modified resources/robotoFont.hpp.gch
Binary file not shown.

0 comments on commit 525ee8f

Please sign in to comment.