完成丢手雷

main
wuyize 2023-04-20 13:45:46 +08:00
commit 62369c0bf0
2 changed files with 5 additions and 4 deletions

View File

@ -25,8 +25,8 @@ DemoWorld::DemoWorld()
shoot->setScale(glm::vec3(45));
throwPerson = std::make_shared<Actor>("Models\\grenade_throw\\grenade_throw.gltf");
throwPerson->setPosition({ -7,0,-1 });
throwPerson->setRotaion(glm::angleAxis(glm::radians(90.f), glm::vec3(0, 1, 0)));
throwPerson->setPosition({ 0.25,6.8,-8.1 });
//throwPerson->setRotaion(glm::angleAxis(glm::radians(90.f), glm::vec3(0, 1, 0)));
throwPerson->setScale(glm::vec3{ 45 });
mk2 = std::make_shared<Particle>(10, "Models\\mk2-frag-grenade\\mk2-frag-grenade.gltf");
@ -93,7 +93,8 @@ void DemoWorld::logicalTick(float deltaTime)
if (abs(throwPerson->getAnimatorCurrentTime() - 3.41f) < 1e-2f)
{
mk2->setPosition(throwPerson->getPosition() + glm::vec3(-0.5, 2.2, 0));
mk2->setSpeed(glm::mat3_cast(throwPerson->getRotation() * glm::rotation(glm::vec3(1, 0, 0), glm::normalize(glm::vec3(0, 2, 1)/*方向*/))) * glm::vec3(10/*速度*/, 0, 0));
mk2->setSpeed(glm::mat3_cast(throwPerson->getRotation() * glm::rotation(glm::vec3(1, 0, 0), glm::normalize(glm::vec3(0, 0.8, 1)/*方向*/))) * glm::vec3(8.3/*速度*/, 0, 0));
//mk2->setSpeed(glm::mat3_cast(throwPerson->getRotation() * glm::rotation(glm::vec3(1, 0, 0), glm::normalize(glm::vec3(0, 2, 1)/*方向*/))) * glm::vec3(10/*速度*/, 0, 0));
mk2->setEnableGravity(true);
}

View File

@ -126,7 +126,7 @@ int MainWindow::exec()
if (accTime > 1.)
{
std::cout << std::format("{:20}\r", "");
std::cout << std::format("FPS: {:.2f} TPS: {:.2f}\r", frameCnt / accTime, logicalTickCount / accTime);
std::cout << std::format("FPS: {:.2f} TPS: {:.2f} {} {} {}\r", frameCnt / accTime, logicalTickCount / accTime, camera.Position.x, camera.Position.y, camera.Position.z);
accTime = 0;
frameCnt = 0;
logicalTickCount = 0;