예제 #1
0
static int pyPickedEventData_setPicker(pyPickedEventData* self, PyObject* value, void*) {
    if (value == NULL || value == Py_None) {
        self->fThis->setPicker(plKey());
        return 0;
    } else if (pyKey_Check(value)) {
        self->fThis->setPicker(*((pyKey*)value)->fThis);
        return 0;
    } else {
        PyErr_SetString(PyExc_TypeError, "picker should be a plKey");
        return -1;
    }
}
예제 #2
0
static int pyLayerLinkAnimation_setLinkKey(pyLayerLinkAnimation* self, PyObject* value, void*) {
    if (value == NULL || value == Py_None) {
        Py_XDECREF(value);
        self->fThis->setLinkKey(plKey());
        return 0;
    }
    if (!pyKey_Check(value)) {
        PyErr_SetString(PyExc_TypeError, "linkKey should be a plKey");
        return -1;
    }
    self->fThis->setLinkKey(*((pyKey*)value)->fThis);
    return 0;
}
예제 #3
0
static int pyMessage_setSender(pyMessage* self, PyObject* value, void*) {
    if (value == NULL || value == Py_None) {
        Py_XDECREF(value);
        self->fThis->setSender(plKey());
        return 0;
    }
    if (!pyKey_Check(value)) {
        PyErr_SetString(PyExc_TypeError, "sender should be a plKey");
        return -1;
    }
    self->fThis->setSender(*((pyKey*)value)->fThis);
    return 0;
}
예제 #4
0
void plAvBrainCoop::read(hsStream* S, plResManager* mgr) {
    plAvBrainGeneric::read(S, mgr);

    fInitiatorID = S->readInt();
    fInitiatorSerial = S->readShort();

    if (S->readBool())
        fHostKey = mgr->readKey(S);
    else
        fHostKey = plKey();

    if (S->readBool())
        fGuestKey = mgr->readKey(S);
    else
        fGuestKey = plKey();

    fWaitingForClick = S->readBool();

    fRecipients.resize(S->readShort());
    for (size_t i=0; i<fRecipients.size(); i++)
        fRecipients[i] = mgr->readKey(S);
}
예제 #5
0
void pyNotify::AddContainerEvent( hsBool entering, pyKey* contained, pyKey* container)
{
    fBuildMsg.AddContainerEvent( container ? container->getKey() : plKey(),
                                 contained ? contained->getKey() : plKey() ,
                                 entering);
}
예제 #6
0
void pyNotify::AddFacingEvent( hsBool enabled, pyKey* other, pyKey* self, float dot)
{
    fBuildMsg.AddFacingEvent( other ? other->getKey() : plKey(),
                              self ? self->getKey() : plKey(),
                              dot, enabled);
}
예제 #7
0
void pyNotify::AddVarKey(const char* name, pyKey* key)
{
    fBuildMsg.AddVariableEvent(name, key ? key->getKey() : plKey() );
}
예제 #8
0
void pyNotify::AddCollisionEvent( hsBool enter, pyKey* other, pyKey* self )
{
    fBuildMsg.AddCollisionEvent(enter, other ? other->getKey() : plKey(),
                                self ? self->getKey() : plKey() );
}
예제 #9
0
void QWinSound::unsetSoftOcclusionRegion()
{
    plSound* obj = plSound::Convert(fCreatable);
    obj->setSoftOcclusionRegion(plKey());
    fSoftOcclusionRegion->setCreatable(NULL, "(None)");
}
예제 #10
0
void QWinSound::unsetDataBuffer()
{
    plSound* obj = plSound::Convert(fCreatable);
    obj->setDataBuffer(plKey());
    fDataBuffer->setCreatable(NULL, "(None)");
}
예제 #11
0
void plCameraModifier1::Update()
{
    // update the brain

    // this freeze thing is a useful debugging tool...  
    if (plVirtualCam1::Instance()->freeze)
        return;
    
    if (GetBrain())
    {
        if (fUpdateBrainTarget && fTarget->GetCoordinateInterface()) // if we need to update the brain and the target is loaded
        {
            fUpdateBrainTarget = false;
            GetBrain()->AddTarget(); // update the brain's target
        }

        bool moveInSub = !(GetBrain()->HasFlag(plCameraBrain1::kIgnoreSubworldMovement));

        if (moveInSub && GetBrain()->GetSubject())
        {
            plKey worldKey = nil;

            // First check if this is a physical.  If so, grab the subworld from that
            if (GetBrain()->GetSubject()->GetSimulationInterface())
            {
                plPhysical* phys = GetBrain()->GetSubject()->GetSimulationInterface()->GetPhysical();
                if (phys)
                    worldKey = phys->GetWorldKey();
            }
            // Also, check if this is an avatar.  They don't have physicals, you
            // have to ask the avatar controller for the subworld key.
            if (!worldKey)
            {
                plKey subject = plKey(GetBrain()->GetSubject()->GetKey());
                plArmatureMod* armMod = plAvatarMgr::FindAvatar(subject);
                if (armMod && armMod->GetController() )
                    worldKey = armMod->GetController()->GetSubworld();
            }

            if (worldKey)
            {
                // this picks up and moves the camera to it's previous subworld coordinate (so the subworld isn't moving out from underneath us)
                hsMatrix44 l2w, w2l;
                plSceneObject* so = plSceneObject::ConvertNoRef(worldKey->ObjectIsLoaded());
                if (so)
                {
                    l2w = so->GetLocalToWorld();
                    w2l = so->GetWorldToLocal();

                    if (fInSubLastUpdate)
                    {
                        if (!(fLastSubPos == fFrom && fLastSubPOA == fAt))
                        {
                            SetTargetPos(l2w * fLastSubPos);
                            SetTargetPOA(l2w * fLastSubPOA);
                        }
                    }
                    else
                    {
                        fInSubLastUpdate = true;
                    }
                    GetBrain()->Update();
                    fLastSubPos = w2l * GetTargetPos();
                    fLastSubPOA = w2l * GetTargetPOA();
                }
                return;
            }
            else
            {
                fInSubLastUpdate = false;
            }
        }
        GetBrain()->Update();
        fLastSubPos = GetTargetPos();
        fLastSubPOA = GetTargetPOA();
    }
}   
예제 #12
0
void QGUIMultiLineEditCtrl::unsetScrollCtrl()
{
    pfGUIMultiLineEditCtrl* ctrl = pfGUIMultiLineEditCtrl::Convert(fCreatable);
    ctrl->setScrollCtrl(plKey());
    fScrollCtrl->setCreatable(NULL, "(None)");
}
예제 #13
0
void QGUISkin::unsetTexture()
{
    pfGUISkin* skin = pfGUISkin::Convert(fCreatable);
    skin->setTexture(plKey());
    fTexture->setCreatable(NULL, "(None)");
}