Render other players

This commit is contained in:
MarcEricMartel 2023-11-24 12:58:06 -05:00
parent 2e30995f1b
commit ce2d03c354
2 changed files with 12 additions and 6 deletions

View File

@ -190,7 +190,7 @@ void Server::Run() {
m_world->BuildWorld();
for (auto& [key, conn] : m_players) { // Creation des instances de joueurs et premier sync.
conn->player = std::make_unique<Player>(Vector3f(8.5f, CHUNK_SIZE_Y + 1.8f, 8.5f));
conn->player = std::make_unique<Player>(Vector3f(128.5f, CHUNK_SIZE_Y + 1.8f, 128.5f));
Sync sync;
sync.position = conn->player->GetPosition();
sync.hp = conn->player->GetHP();

View File

@ -1241,13 +1241,19 @@ void Engine::Render(float elapsedTime) {
gameTime += elapsedTime * 10;
Vector3f dance = Vector3f(sin(gameTime), 0, cos(-gameTime));
dance.Normalize();
m_remotePlayer.ApplyPhysics(dance, &m_world, elapsedTime);
for (auto& [key, player] : m_players) {
RemotePlayer* rt = (RemotePlayer*)player;
rt->Render(m_animeAtlas, m_shader01, all, elapsedTime);
}
//Vector3f dance = Vector3f(sin(gameTime), 0, cos(-gameTime));
//dance.Normalize();
//m_remotePlayer.ApplyPhysics(dance, &m_world, elapsedTime);
m_world.Update(m_bullets, m_player.GetPosition(), m_blockinfo);
m_renderer.UpdateMesh(&m_world, m_player.GetPosition(), m_blockinfo);
m_remotePlayer.Render(m_animeAtlas, m_shader01, all, elapsedTime);
m_booster.RenderBillboard({ 195,16,195 }, m_textureAtlas, m_shader01, all);
//m_remotePlayer.Render(m_animeAtlas, m_shader01, all, elapsedTime);
//m_booster.RenderBillboard({ 195,16,195 }, m_textureAtlas, m_shader01, all);
if (m_isSkybox) m_renderer.RenderWorld(&m_world, m_renderCount, m_player.GetPosition(), m_player.GetDirection(), all, m_shader01, m_textureAtlas);