Exemplo n.º 1
0
NewActionTypes::ResultE Joint::intersectActorEnter(
    ActorBase::FunctorArgumentType &funcArg)
{
    IntersectActor *pIA        = dynamic_cast<IntersectActor *>(
                                                           funcArg.getActor());
    Matrix          matrix     = this->getMatrix();
    Line            transLine;
    Pnt3f           pos;
    Vec3f           dir;

    matrix.mult(this->getJointTransformation());
    matrix.invert();

    matrix.multFull(pIA->getRay().getPosition (), pos);
    matrix.mult    (pIA->getRay().getDirection(), dir);

    transLine.setValue(pos, dir);

    pIA->beginEditState();
    {
        pIA->setRay        (transLine                           );
        pIA->setScaleFactor(pIA->getScaleFactor() / dir.length());
    }
    pIA->endEditState  ();

    pIA->setupChildrenPriorities();

    return NewActionTypes::Continue;
}
Exemplo n.º 2
0
// This is the default operation of the IntersectActor
NewActionTypes::ResultE
enterDefault(NodeCorePtr pNodeCore, ActorBase::FunctorArgumentType &funcArg)
{
    IntersectActor *pIA = dynamic_cast<IntersectActor *>(funcArg.getActor());

    pIA->setupChildrenPriorities();

    return NewActionTypes::Continue;
}