bug fixed with respawn animation

master
Vectozavr 2021-11-03 22:06:41 +07:00
parent 943253b1bc
commit 2e926a10f4
4 changed files with 6 additions and 7 deletions

View File

@ -123,9 +123,8 @@ void ShooterClient::processCustomPacket(sf::Packet &packet) {
_player->unattach(ObjectNameTag("Camera"));
_player->translateToPoint(Vec3D{10000});
Vec2D cameraOrientation(camera->angleLeftUpLookAt().x(), _player->angle().y());
camera->rotateLeft(-cameraOrientation.x());
camera->transform(Matrix4x4::Rotation(Vec3D(-_player->angle())));
camera->rotateLeft(-camera->angleLeftUpLookAt().x());
camera->transform(Matrix4x4::Rotation(-_player->angle()));
Timeline::animate(AnimationListTag("camera_anim"), std::make_shared<ATranslateToPoint>(camera, Vec3D(-20, 30, -100)));
Timeline::animate(AnimationListTag("camera_anim"), std::make_shared<ARotateRelativePoint>(camera, Vec3D(0), Vec3D{0, Consts::PI, 0}, 5, Animation::LoopOut::None, Animation::InterpolationType::Linear));

View File

@ -38,7 +38,7 @@ namespace ShooterConsts {
const std::string SHOTGUN_RELOAD_SOUND = "sound/weapons/reload_shotgun.ogg";
const std::string CUBE_OBJ = "obj/cube.obj";
const std::string MAP_OBJ = "maps/map.obj";
const std::string MAP_OBJ = "maps/map2.obj";
const std::string MAIN_MENU_BACK = "textures/back.png";
const std::string MAIN_MENU_GUI = "textures/gui.png";

View File

@ -10,10 +10,10 @@ using namespace std;
int main() {
Shooter game;
//game.create(1280, 720, ShooterConsts::PROJECT_NAME);
game.create(1280, 720, ShooterConsts::PROJECT_NAME);
//game.create(1920, 1080, ShooterConsts::PROJECT_NAME, true, Consts::BACKGROUND_COLOR, sf::Style::Fullscreen);
game.create(2048, 1152, ShooterConsts::PROJECT_NAME, true);
//game.create(2048, 1152, ShooterConsts::PROJECT_NAME, true);
//game.create(3072, 1920, ShooterConsts::PROJECT_NAME, true, Consts::BACKGROUND_COLOR, sf::Style::Fullscreen);
return 0;

View File

@ -16,7 +16,7 @@ private:
const std::function<void()> _callBack;
void update() override {
if (_allCalls != 0 && progress() >= (double) (_callsCounter + 1) / (_allCalls + 1)) {
if (_allCalls != 0 && progress() > (double) _callsCounter / _allCalls) {
_callsCounter++;
_callBack();
}