布置了手雷投掷兵的位置
parent
a60cd33221
commit
2e7fe9879b
|
@ -25,8 +25,8 @@ DemoWorld::DemoWorld()
|
||||||
shoot->setScale(glm::vec3(45));
|
shoot->setScale(glm::vec3(45));
|
||||||
|
|
||||||
throwPerson = std::make_shared<Actor>("Models\\grenade_throw\\grenade_throw.gltf");
|
throwPerson = std::make_shared<Actor>("Models\\grenade_throw\\grenade_throw.gltf");
|
||||||
throwPerson->setPosition({ -7,0,-1 });
|
throwPerson->setPosition({ 0.25,6.8,-8.1 });
|
||||||
throwPerson->setRotaion(glm::angleAxis(glm::radians(90.f), glm::vec3(0, 1, 0)));
|
//throwPerson->setRotaion(glm::angleAxis(glm::radians(90.f), glm::vec3(0, 1, 0)));
|
||||||
throwPerson->setScale(glm::vec3{ 45 });
|
throwPerson->setScale(glm::vec3{ 45 });
|
||||||
|
|
||||||
mk2 = std::make_shared<Particle>(10, "Models\\mk2-frag-grenade\\mk2-frag-grenade.gltf");
|
mk2 = std::make_shared<Particle>(10, "Models\\mk2-frag-grenade\\mk2-frag-grenade.gltf");
|
||||||
|
@ -93,7 +93,7 @@ void DemoWorld::logicalTick(float deltaTime)
|
||||||
if (abs(throwPerson->getAnimatorCurrentTime() - 3.41f) < 1e-2f)
|
if (abs(throwPerson->getAnimatorCurrentTime() - 3.41f) < 1e-2f)
|
||||||
{
|
{
|
||||||
mk2->setPosition(throwPerson->getPosition() + glm::vec3(-0.5, 2.2, 0));
|
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, 1, 1)/*方向*/))) * glm::vec3(15/*速度*/, 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->setEnableGravity(true);
|
mk2->setEnableGravity(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,7 +126,7 @@ int MainWindow::exec()
|
||||||
if (accTime > 1.)
|
if (accTime > 1.)
|
||||||
{
|
{
|
||||||
std::cout << std::format("{:20}\r", "");
|
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;
|
accTime = 0;
|
||||||
frameCnt = 0;
|
frameCnt = 0;
|
||||||
logicalTickCount = 0;
|
logicalTickCount = 0;
|
||||||
|
|
Loading…
Reference in New Issue