Browse Source

scene: change sprite tile angles to radians.

undefined
Sam Hocevar 8 years ago
parent
commit
cfaa27df47
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      src/scene.cpp
  2. +1
    -1
      src/scene.h

+ 2
- 2
src/scene.cpp View File

@@ -457,7 +457,7 @@ void Scene::ReleaseAllPrimitiveRenderers(uintptr_t key)
} }


//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void Scene::AddTile(TileSet *tileset, int id, vec3 pos, int o, vec2 scale, float degrees)
void Scene::AddTile(TileSet *tileset, int id, vec3 pos, int o, vec2 scale, float radians)
{ {
ASSERT(id < tileset->GetTileCount()); ASSERT(id < tileset->GetTileCount());


@@ -465,7 +465,7 @@ void Scene::AddTile(TileSet *tileset, int id, vec3 pos, int o, vec2 scale, float
mat4 model = mat4::translate(pos) mat4 model = mat4::translate(pos)
* mat4::scale(scale.x, scale.y, 1.f) * mat4::scale(scale.x, scale.y, 1.f)
* mat4::translate(size.x * 0.5f, size.y * 0.5f, 0.f) * mat4::translate(size.x * 0.5f, size.y * 0.5f, 0.f)
* mat4::rotate(radians(scale.x * scale.y < 0 ? degrees : -degrees),
* mat4::rotate(scale.x * scale.y < 0 ? radians : -radians,
vec3::axis_z); vec3::axis_z);


AddTile(tileset, id, model); AddTile(tileset, id, model);


+ 1
- 1
src/scene.h View File

@@ -229,7 +229,7 @@ public:


/* FIXME: this should be deprecated -- it doesn't really match /* FIXME: this should be deprecated -- it doesn't really match
* the architecture we want to build */ * the architecture we want to build */
void AddTile(TileSet *tileset, int id, vec3 pos, int o, vec2 scale, float angle);
void AddTile(TileSet *tileset, int id, vec3 pos, int o, vec2 scale, float radians);
void AddTile(TileSet *tileset, int id, mat4 model); void AddTile(TileSet *tileset, int id, mat4 model);


public: public:


Loading…
Cancel
Save