完成丢手雷

main
wuyize 2023-04-20 13:46:01 +08:00
parent 62369c0bf0
commit 942db18774
1 changed files with 4 additions and 4 deletions

View File

@ -65,7 +65,7 @@ DemoWorld::DemoWorld()
if (i != 0) if (i != 0)
{ {
float ks = 300, kd = 500; float ks = 300, kd = 100;
physicsManager.addSpring(particles[i - 1], particle, 0.005, ks, kd); physicsManager.addSpring(particles[i - 1], particle, 0.005, ks, kd);
} }
} }
@ -98,12 +98,12 @@ void DemoWorld::logicalTick(float deltaTime)
mk2->setEnableGravity(true); mk2->setEnableGravity(true);
} }
if (mk2->getPosition().y < 6.5f && mk2->getSpeed().y<0) if (mk2->getPosition().y < 7.5f && mk2->getSpeed().y<0)
{ {
particles[particles.size() / 2]->setSpeed(particles[particles.size() / 2]->getSpeed() + mk2->getSpeed()/2.f); particles[3]->setSpeed(particles[3]->getSpeed() + mk2->getSpeed()/2.f);
mk2->setEnableGravity(false); mk2->setEnableGravity(false);
mk2->setSpeed(glm::vec3(0)); mk2->setSpeed(glm::vec3(0));
//mk2->setPosition({ 0,-100,0 }); mk2->setPosition({ 0,-100,0 });
} }
} }