Hi Drake,

You could have a matrix wrapped up in your custom GizmoDrawable but you'd
have to be careful about when you passed on the matrix.

One normally doesn't cache matrices this way, as it usually isn't
required.  There is chance that you are trying to tackle a problem that
there is an established and better solution, but as don't say anything
about the actual problem you trying to solve, just focus on possible
solution to an unknown problem we can't provide any useful advice.

Robert

On 4 January 2015 at 14:11, Drake Aldwyn <azrai...@gmail.com> wrote:

> Hi, all
>
> Below is my code:
> is it possible somehow store matrix transform of PAT inside of children
> (gizmo) ?
>
> Code:
> osg::ref_ptr<osg::Switch> sw = new osg::Switch;
>         sw->setName("Switch");
>         sw->addChild(scene,true);
>         sw->addChild(getLineCube(pos,11),false);
>         osg::ref_ptr<AgentShape> myPos = new AgentShape; // This is PAT
>         myPos->setPosition(pos);
>         myPos->addChild(sw);
>         myPos->setName("AgentShape");
>         osg::ref_ptr<osg::Geode> geodeGizmo = new osg::Geode;
>         osg::ref_ptr<GizmoDrawable> gizmo = new GizmoDrawable;
>         gizmo->setName("gizmo");
>         gizmo->setGizmoMode( GizmoDrawable:: NO_GIZMO);
>         gizmo->setTransform(matrixTrasform of PAT);
>         geodeGizmo->addDrawable( gizmo.get() );
>         geodeGizmo->setCullingActive( false );
>
>         myPos->addChild(geodeGizmo);
>         return myPos;
>
>
>
> Thank you!
>
> Cheers,
> Drake
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=62224#62224
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to