|
|
@@ -1286,10 +1286,10 @@ namespace oxygine
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Vector2 convert_global2local_(Actor* child, Actor* parent, Vector2 pos)
|
|
|
+ Vector2 convert_global2local_(const Actor* child, const Actor* parent, Vector2 pos)
|
|
|
{
|
|
|
if (child->getParent() && child->getParent() != parent)
|
|
|
- pos = convert_global2local(child->getParent(), parent, pos);
|
|
|
+ pos = convert_global2local_(child->getParent(), parent, pos);
|
|
|
/*
|
|
|
Actor *p = child->getParent();
|
|
|
if (p && child != parent)
|
|
|
@@ -1304,7 +1304,7 @@ namespace oxygine
|
|
|
return convert_global2local_(child.get(), parent.get(), pos);
|
|
|
}
|
|
|
|
|
|
- Vector2 convert_local2global_(Actor* child, Actor* parent, Vector2 pos)
|
|
|
+ Vector2 convert_local2global_(const Actor* child, const Actor* parent, Vector2 pos)
|
|
|
{
|
|
|
while (child && child != parent)
|
|
|
{
|
|
|
@@ -1327,6 +1327,13 @@ namespace oxygine
|
|
|
return convert_local2global(actor, root, pos);
|
|
|
}
|
|
|
|
|
|
+ Vector2 convert_local2stage(const Actor* actor, const Vector2& pos, const Actor* root)
|
|
|
+ {
|
|
|
+ if( !root )
|
|
|
+ root = getStage().get();
|
|
|
+ return convert_local2global_(actor, root, pos);
|
|
|
+ }
|
|
|
+
|
|
|
Vector2 convert_stage2local(spActor actor, const Vector2& pos, spActor root)
|
|
|
{
|
|
|
if (!root)
|
|
|
@@ -1334,6 +1341,13 @@ namespace oxygine
|
|
|
return convert_global2local(actor, root, pos);
|
|
|
}
|
|
|
|
|
|
+ Vector2 convert_stage2local(const Actor* actor, const Vector2& pos, const Actor* root )
|
|
|
+ {
|
|
|
+ if( !root )
|
|
|
+ root = getStage().get();
|
|
|
+ return convert_global2local_(actor, root, pos);
|
|
|
+ }
|
|
|
+
|
|
|
Renderer::transform getGlobalTransform(spActor child, spActor parent)
|
|
|
{
|
|
|
Renderer::transform t;
|