Beispiel #1
0
 def _GetBonePosRot(self, ENTID, boneName, posProp, rotProp):
     entity = self.entityService.FindEntityByID(ENTID)
     if entity is None:
         self.LogError('GetBonePosRot: Entity with ID ', ENTID,
                       ' not found!')
         return False
     animClient = entity.GetComponent('animation')
     posComp = entity.GetComponent('position')
     if animClient is not None and posComp is not None:
         if animClient.controller is not None:
             boneTransform = animClient.controller.animationNetwork.GetBoneTransform(
                 boneName)
             if boneTransform:
                 translation, orientation = boneTransform
                 translation = geo2.QuaternionTransformVector(
                     posComp.rotation, translation)
                 translation = geo2.Vec3Add(posComp.position, translation)
                 orientation = geo2.QuaternionMultiply(
                     posComp.rotation, orientation)
                 translation = list(translation)
                 orientation = list(orientation)
                 GameWorld.AddPropertyForCurrentPythonProc(
                     {posProp: translation})
                 GameWorld.AddPropertyForCurrentPythonProc(
                     {rotProp: orientation})
                 return True
     self.LogError('GetBonePosRot: Missing critical data in entity!')
     return False
Beispiel #2
0
 def _GetEntitySceneID(self, ENTID):
     entity = self.entityService.FindEntityByID(ENTID)
     if entity is None:
         self.LogError('GetEntitySceneID: Entity with ID ', ENTID,
                       ' not found!')
         return False
     GameWorld.AddPropertyForCurrentPythonProc(
         {'entitySceneID': entity.scene.sceneID})
     return True
Beispiel #3
0
def AddPropertyForCurrentPythonProc(propDict):
    GameWorld.AddPropertyForCurrentPythonProc(
        propDict,
        stackless.getcurrent().localStorage.get('callbackHandle'))