This commit is contained in:
aozhiwei 2019-04-13 11:56:11 +08:00
parent b3a44a888e
commit b5c3f69440
3 changed files with 11 additions and 0 deletions

View File

@ -65,6 +65,12 @@ static void SavePerfLog()
void App::Init(int argc, char* argv[])
{
#if 0
{
Vector2D dir;
dir.Normalize();
}
#endif
signal(SIGPIPE, SIG_IGN);
this->argc = argc;
this->argv = argv;

View File

@ -40,6 +40,7 @@ class Entity
unsigned short entity_uniid = 0;
EntityType_e entity_type = ET_None;
EntitySubType_e entity_subtype = EST_None;
long long create_frameno = 0;
Room* room = nullptr;
Vector2D pos;
int updated_times = 0;

View File

@ -1,5 +1,7 @@
#include "precompile.h"
#include <math.h>
#if 1
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
@ -34,6 +36,8 @@ void Vector2D::Normalize()
glm::vec2 v = glm::normalize(glm::vec2(x, y));
x = v[0];
y = v[1];
assert(!isnan(x));
assert(!isnan(x));
#else
Eigen::Vector2f v(x, y);
v.normalize();