Exemplo n.º 1
0
void bulletSimulation::ResetSettings()
{
   // test if the momentum settings exist
   XSI::CRef settingsRef;
   settingsRef.Set(L"Scene_Root.MomentumSettings");
   XSI::CustomProperty settingsProperty;
   if(!settingsRef.IsValid())
   {
      if(XSI::Application().GetActiveSceneRoot().IsValid())
         settingsProperty = XSI::Application().GetActiveSceneRoot().AddProperty(L"MomentumSettings",false,L"MomentumSettings");
   }
   else
      settingsProperty = XSI::CustomProperty(settingsRef);

   if(settingsRef.IsValid())
   {
      //retrieve the substeps and gravity settings
      mSubSteps = (LONG)settingsProperty.GetParameterValue(L"substeps");
      btVector3 gravity;
      gravity.setX((float)settingsProperty.GetParameterValue(L"gravity_x"));
      gravity.setY((float)settingsProperty.GetParameterValue(L"gravity_y"));
      gravity.setZ((float)settingsProperty.GetParameterValue(L"gravity_z"));
      mDynamicsWorld->setGravity(gravity);
   }

   // get the fps and update the frame
   XSI::CRef fpsParamRef;
   fpsParamRef.Set("PlayControl.Rate");
   if(fpsParamRef.IsValid())
      mFps = (float)XSI::Parameter(fpsParamRef).GetValue();
}
Exemplo n.º 2
0
XSI::CRef findTimeControlDccIdentifier(SceneNodeAlembicPtr fileRoot, XSI::CRef importRoot, XSI_XformTypes::xte in_xte)
{
   XSI::CRef ref;

   SceneNodeAlembic* currNode = fileRoot.get();

   while( true )
   {
      XSI_XformTypes::xte xte = XSI_XformTypes::UNKNOWN;
      Abc::IObject iObj = currNode->getObject();
      if(AbcG::IXform::matches(iObj.getMetaData()))
      {
         AbcG::IXform xform(iObj, Abc::kWrapExisting);
         xte = getXformType(xform);
         if(xte == XSI_XformTypes::UNKNOWN && currNode->type == SceneNode::ITRANSFORM){
            xte = in_xte;
         }
      }
      
      if( currNode->parent == NULL ){
         ref = importRoot;
         break;
      }
      if (currNode->bIsDirectChild && xte == XSI_XformTypes::XMODEL){
         ref.Set(currNode->dccIdentifier.c_str());
         break;
      }

      currNode = (SceneNodeAlembic*) currNode->parent;
   }

   
   
   return ref;
}