dm 7 years ago
parent
commit
274e862a18

+ 10 - 0
oxygine/src/oxygine/actor/Actor.cpp

@@ -1087,11 +1087,21 @@ namespace oxygine
         return convert_local2stage(this, pos, stage);
     }
 
+    Vector2 Actor::local2stage(float x, float y, Actor* stage) const
+    {
+        return convert_local2stage(this, Vector2(x, y), stage);
+    }
+
     Vector2 Actor::stage2local(const Vector2& pos, Actor* stage) const
     {
         return convert_stage2local(this, pos, stage);
     }
 
+    Vector2 Actor::stage2local(float x, float y, Actor* stage) const
+    {
+        return convert_stage2local(this, Vector2(x, y), stage);
+    }
+
 
     bool Actor::prepareRender(RenderState& rs, const RenderState& parentRS)
     {

+ 3 - 1
oxygine/src/oxygine/actor/Actor.h

@@ -254,8 +254,10 @@ namespace oxygine
 
         //converts local position to Stage
         Vector2 local2stage(const Vector2& pos = Vector2(0, 0), Actor* stage = 0) const;
+        Vector2 local2stage(float x, float y, Actor* stage = 0) const;
         //converts global position (position in Stage space) to local space
-        Vector2 stage2local(const Vector2& pos, Actor* stage = 0) const;
+        Vector2 stage2local(const Vector2& pos = Vector2(0, 0), Actor* stage = 0) const;
+        Vector2 stage2local(float x, float y, Actor* stage = 0) const;
 
         typedef Property2Args<float, Vector2, const Vector2&, Actor, &Actor::getPosition, &Actor::setPosition>  TweenPosition;
         typedef Property<float, float, Actor, &Actor::getX, &Actor::setX>                                       TweenX;

+ 2 - 2
oxygine/src/oxygine/core/Object.h

@@ -74,12 +74,12 @@ namespace oxygine
 
         int __id;
 
-        union 
+        union
         {
             const void* __userData;
             uint64 __userData64;
         };
-        
+
 
 
 #ifdef OXYGINE_DEBUG_TRACE_LEAKS

+ 5 - 5
oxygine/src/oxygine/math/Matrix.h

@@ -521,9 +521,9 @@ namespace oxygine
     inline VectorT3<T>& MatrixT<T>::transformVec3(VectorT3<T>& out, const vector3& in, const MatrixT& mat)
     {
         out = vector3(
-            in.x * mat.m11 + in.y * mat.m21 + in.z * mat.m31 + mat.m41,
-            in.x * mat.m12 + in.y * mat.m22 + in.z * mat.m32 + mat.m42,
-            in.x * mat.m13 + in.y * mat.m23 + in.z * mat.m33 + mat.m43);
+                  in.x * mat.m11 + in.y * mat.m21 + in.z * mat.m31 + mat.m41,
+                  in.x * mat.m12 + in.y * mat.m22 + in.z * mat.m32 + mat.m42,
+                  in.x * mat.m13 + in.y * mat.m23 + in.z * mat.m33 + mat.m43);
         return out;
     }
 
@@ -531,8 +531,8 @@ namespace oxygine
     inline VectorT2<T>& MatrixT<T>::transformVec2(VectorT2<T>& out, const vector2& in, const MatrixT& mat)
     {
         out = vector2(
-            in.x * mat.m11 + in.y * mat.m21 + mat.m41,
-            in.x * mat.m12 + in.y * mat.m22 + mat.m42);
+                  in.x * mat.m11 + in.y * mat.m21 + mat.m41,
+                  in.x * mat.m12 + in.y * mat.m22 + mat.m42);
         return out;
     }
 

+ 1 - 1
oxygine/src/oxygine/math/Rect.h

@@ -140,7 +140,7 @@ namespace oxygine
         void moveBottom(T v) {size.y = v - pos.y;}
 
         void expand(const point2& v1, const point2& v2) {pos -= v1; size += v1 + v2;}
-        void expand2(const point2& v) { expand(v,v); }
+        void expand2(const point2& v) { expand(v, v); }
 
         template<class R>
         RectT operator * (const VectorT2<R>& v) const