82 const SAnimMap animations = entity->GetAnimations();
83 if (animations.empty())
86 SAnimMap::const_iterator iAnimation = animations.begin();
87 while (iAnimation != animations.end())
89 SAnim* newAnimation = iAnimation->second;
90 assert(newAnimation != 0);
91 if ((newAnimation->GetType() != SAnim::SO3_SCENENODE_ANIM) && (newAnimation->GetType() != SAnim::SO3_SEQUENCE_ANIM))
97 const SAnimTrackList animationsTracksListCopy = newAnimation->GetAnimationsTracks();
98 SAnimTrackList::const_iterator iAnimationTrack = animationsTracksListCopy.begin();
99 while (iAnimationTrack != animationsTracksListCopy.end())
101 SAnimTrack* newAnimationTrack = (*iAnimationTrack);
102 assert(newAnimationTrack != 0);
131 MMechostr(MSKDEBUG,
"SO3SceneLoadEntity\n");
135 int name = MMpull(m);
136 int group = MMpull(m);
139 if ((p == NIL) || (s == NIL) || (name == NIL))
145 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
152 std::string tmpEntityName = MMstartstr(m, MTOP(name));
153 std::string tmpMeshName = MMstartstr(m, MTOP(p));
155 for (
unsigned int i = 0; i < tmpMeshName.length(); i++)
157 if (tmpMeshName.substr(i, 1) ==
"\\")
158 tmpMeshName.replace(i, 1,
"/");
161 std::string groupResource(Ogre::RGN_DEFAULT);
163 groupResource = MMstartstr(m, MTOP(group));
165 groupResource = scene->GetName() + groupResource;
167 SEntity* newEntity = 0;
171 newEntity = scene->CreateEntity(groupResource, tmpEntityName, tmpMeshName);
179 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
183 catch (Ogre::Exception &e)
185 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
209 MMechostr(MSKDEBUG,
"SO3SceneLoadEntityInBackground\n");
212 int pUser = MMpull(m);
213 int pCbk = MMpull(m);
215 int name = MMpull(m);
216 int group = MMpull(m);
219 if ((p == NIL) || (s == NIL) || (name == NIL))
225 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
232 std::string tmpEntityName = MMstartstr(m, MTOP(name));
233 std::string tmpMeshName = MMstartstr(m, MTOP(p));
235 for (
unsigned int i = 0; i < tmpMeshName.length(); i++)
237 if (tmpMeshName.substr(i, 1) ==
"\\")
238 tmpMeshName.replace(i, 1,
"/");
241 std::string groupResource(Ogre::RGN_DEFAULT);
243 groupResource = MMstartstr(m, MTOP(group));
245 groupResource = scene->GetName() + groupResource;
247 SEntity* newEntity = 0;
251 newEntity = scene->CreateEntity(groupResource, tmpEntityName, tmpMeshName,
true);
256 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
260 catch (Ogre::Exception &e)
262 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
274 k = OBJaddreflex(m,
SO3OBJTYPE, SO3_OBJECT_LOADED_EVENT);
276 newEntity->LoadAsync();
295 MMechostr(MSKDEBUG,
"SO3SceneLoadEntityByResourceName\n");
299 int name = MMpull(m);
300 int group = MMpull(m);
303 if ((p == NIL) || (s == NIL) || (name == NIL))
309 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
316 std::string tmpEntityName = MMstartstr(m, MTOP(name));
317 std::string tmpMeshName = MMstartstr(m, MTOP(p));
319 for (
unsigned int i = 0; i < tmpMeshName.length(); i++)
321 if (tmpMeshName.substr(i, 1) ==
"\\")
322 tmpMeshName.replace(i, 1,
"/");
325 std::string groupResource(Ogre::RGN_DEFAULT);
327 groupResource = MMstartstr(m, MTOP(group));
329 groupResource = scene->GetName() + groupResource;
331 SEntity* newEntity = 0;
335 newEntity = scene->CreateEntity(groupResource, tmpEntityName, tmpMeshName);
343 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
347 catch (Ogre::Exception &e)
349 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
370 MMechostr(MSKDEBUG,
"SO3SceneCloneEntity\n");
374 int name = MMpull(m);
377 if ((obj == NIL) || (s == NIL) || (name == NIL))
383 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
390 std::string entityName = MMstartstr(m, MTOP(name));
391 SNode* node = MMgetPointer<SNode*>(m, MTOP(obj));
398 if (node->GetNodeType() != SNode::ENTITY_TYPE_ID)
404 SEntity* entity =
static_cast <SEntity*
> (node);
411 SEntity* newEntity = 0;
415 newEntity = scene->CloneEntity(entityName, entity);
423 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
427 catch (Ogre::Exception &e)
429 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
450 MMechostr(MSKDEBUG,
"SO3SceneConvertFile\n");
453 int flags = MMpull(m);
454 int expPath = MMpull(m);
463 packdir mypack = (packdir)SCgetExtra(
"FirstPack");
464 boost::filesystem::path partitionPath(mypack->path);
465 partitionPath = partitionPath.generic_string();
467 std::string dir(MMstartstr(m, MTOP(expPath)));
468 boost::filesystem::path exportDirectory(dir);
469 exportDirectory = exportDirectory.generic_string();
470 partitionPath /= exportDirectory;
477 std::string fPath = MMstartstr(m, MTOP(p));
479 for (
unsigned int i = 0; i < fPath.length(); i++)
481 if (fPath.substr(i, 1) ==
"\\")
482 fPath.replace(i, 1,
"/");
485 std::string sceneName = boost::filesystem::path(fPath).stem().generic_string();
486 for (
unsigned int i = 0; i < sceneName.length(); i++)
488 if (sceneName.substr(i, 1) ==
" ")
489 sceneName.replace(i, 1,
"_");
493 partitionPath /= sceneName;
495 boost::filesystem::path filePath = partitionPath;
496 filePath /= sceneName +
".scene";
503 std::string resgroup =
"SO3CONVERTER/" + sceneName;
504 bool success =
false;
508 Ogre::ResourceGroupManager::getSingleton().createResourceGroup(resgroup,
false);
510 catch (Ogre::Exception &e)
512 MMechostr(MSKDEBUG,
"Resource group already exist?: %s\n", e.what());
519 ALSceneLoader alLoader(fPath, resgroup,
flags);
520 success = alLoader.convertFile(partitionPath, sceneName);
522 catch (std::exception &e)
526 Ogre::ResourceGroupManager::getSingleton().destroyResourceGroup(resgroup);
528 catch (Ogre::Exception &)
531 MMechostr(MSKDEBUG,
"SO3SceneConvertFile : An exception has occurred: %s\n", e.what());
538 Ogre::ResourceGroupManager::getSingleton().destroyResourceGroup(resgroup);
540 catch (Ogre::Exception &e)
542 MMechostr(MSKDEBUG,
"Resource group already deleted?: %s\n", e.what());
548 Mpushstrbloc(m, (
char*)filePath.generic_string().c_str());
570 MMechostr(MSKDEBUG,
"SO3SceneLoadFile\n");
573 int flags = MMpull(m);
576 int group = MMpull(m);
579 if ((p == NIL) || (s == NIL) || (n == NIL))
585 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
593 node = MMgetPointer<SNode*>(m, MTOP(n));
600 std::string fPath = MMstartstr(m, MTOP(p));
602 for (
unsigned int i = 0; i < fPath.length(); i++)
604 if (fPath.substr(i, 1) ==
"\\")
605 fPath.replace(i, 1,
"/");
608 std::string groupResource(Ogre::RGN_DEFAULT);
610 groupResource = MMstartstr(m, MTOP(group));
612 groupResource = scene->GetName() + groupResource;
613 std::string sceneName =
"";
615 if ((fPath.find(
"content://") != std::string::npos) || (fPath.find(
"file://") != std::string::npos))
616 sceneName = boost::filesystem::path(fPath.substr(fPath.find_last_of(
":") + 1)).stem().generic_string();
618 sceneName = boost::filesystem::path(fPath).stem().generic_string();
626 std::vector<SNode*> objectToLoad;
627 std::vector<SMaterial*> matsToLoad;
630 ALSceneLoader alLoader(scene, fPath, groupResource,
flags);
632 if (!alLoader.loadFile(sceneName, node, objectToLoad, matsToLoad))
634 MMechostr(MSKRUNTIME,
"SO3SceneLoadFile : File not valid: %s\n", fPath.c_str());
641 for (
unsigned int n = 0; n < objectToLoad.size(); ++n)
644 if ((scene->GetRootNode() != objectToLoad[n]) && (node != objectToLoad[n]))
649 if ((objectToLoad[n]->GetNodeType() == SNode::ENTITY_TYPE_ID))
651 SEntity* entity =
static_cast<SEntity*
>(objectToLoad[n]);
654 if (entity && entity->getOgreEntityPointer() && entity->getOgreEntityPointer()->getSkeleton())
656 string tmpSkeletonName = entity->GetName() +
"." + entity->getOgreEntityPointer()->getSkeleton()->getName();
657 SSkeleton* newSkeleton = 0;
660 newSkeleton = scene->CreateSkeleton(tmpSkeletonName, entity);
663 SBoneMap bonesListCopy = newSkeleton->GetBones();
664 SBoneMap::iterator iBone = bonesListCopy.begin();
665 while (iBone != bonesListCopy.end())
667 SBone* newBone = iBone->second;
668 assert(newBone != 0);
669 createBone(m, (SNode*)newBone, scene, entity);
677 const SAnimMap animations = newSkeleton->GetAnimations();
678 SAnimMap::const_iterator iAnimation = animations.begin();
679 while (iAnimation != animations.end())
681 SAnim* newAnimation = iAnimation->second;
682 assert(newAnimation != 0);
687 const SAnimTrackList animationsTracksListCopy = newAnimation->GetAnimationsTracks();
688 SAnimTrackList::const_iterator iAnimationTrack = animationsTracksListCopy.begin();
689 while (iAnimationTrack != animationsTracksListCopy.end())
691 SAnimTrack* newAnimationTrack = (*iAnimationTrack);
692 assert(newAnimationTrack != 0);
699 newAnimation->SetLoop(
true);
700 newAnimation->SetEnable(
true);
707 catch (Ogre::Exception &)
714 for (
unsigned int a = 0; a < objectToLoad[n]->GetNumAnimations(); ++a)
716 SAnim* animation = objectToLoad[n]->GetAnimation(a);
720 animation->SetLoop(
true);
721 animation->SetEnable(
true);
723 for (
unsigned int t = 0; t < animation->GetNumAnimationsTracks(); ++t)
732 catch (Ogre::Exception &e)
735 MMechostr(MSKDEBUG,
"SO3SceneLoadFile : An exception has occurred: %s\n", e.what());
740 if (objectToLoad.size() == 0)
742 MMechostr(MSKDEBUG,
"SO3SceneLoadFile : Unsupported format or nothing to load\n");
767 MMechostr(MSKDEBUG,
"SO3SceneConvertFileEx\n");
770 int scale = MMpull(m);
771 int flags = MMpull(m);
772 int expPath = MMpull(m);
781 packdir mypack = (packdir)SCgetExtra(
"FirstPack");
782 boost::filesystem::path partitionPath(mypack->path);
783 partitionPath = partitionPath.generic_string();
785 std::string dir(MMstartstr(m, MTOP(expPath)));
786 boost::filesystem::path exportDirectory(dir);
787 exportDirectory = exportDirectory.generic_string();
788 partitionPath /= exportDirectory;
795 std::string fPath = MMstartstr(m, MTOP(p));
797 for (
unsigned int i = 0; i < fPath.length(); i++)
799 if (fPath.substr(i, 1) ==
"\\")
800 fPath.replace(i, 1,
"/");
806 partitionPath /= sceneName;
808 boost::filesystem::path filePath = partitionPath;
809 filePath /= sceneName +
".scene";
818 fscale = MTOF(scale);
820 std::string resgroup =
"SO3CONVERTER/" + sceneName;
821 bool success =
false;
825 Ogre::ResourceGroupManager::getSingleton().createResourceGroup(resgroup,
false);
827 catch (Ogre::Exception &e)
829 MMechostr(MSKDEBUG,
"Resource group already exist?: %s\n", e.what());
836 ALSceneLoader alLoader(fPath, resgroup,
flags, fscale);
837 success = alLoader.convertFile(partitionPath, sceneName);
839 catch (std::exception &e)
843 Ogre::ResourceGroupManager::getSingleton().destroyResourceGroup(resgroup);
845 catch (Ogre::Exception &)
849 MMechostr(MSKDEBUG,
"SO3SceneConvertFile : An exception has occurred: %s\n", e.what());
856 Ogre::ResourceGroupManager::getSingleton().destroyResourceGroup(resgroup);
858 catch (Ogre::Exception &e)
860 MMechostr(MSKDEBUG,
"Resource group already deleted?: %s\n", e.what());
866 Mpushstrbloc(m, (
char*)filePath.generic_string().c_str());
889 MMechostr(MSKDEBUG,
"SO3SceneLoadFileEx\n");
892 int scale = MMpull(m);
893 int flags = MMpull(m);
896 int group = MMpull(m);
899 if ((p == NIL) || (s == NIL) || (n == NIL))
905 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
913 node = MMgetPointer<SNode*>(m, MTOP(n));
920 std::string fPath = MMstartstr(m, MTOP(p));
922 for (
unsigned int i = 0; i < fPath.length(); i++)
924 if (fPath.substr(i, 1) ==
"\\")
925 fPath.replace(i, 1,
"/");
928 std::string groupResource(Ogre::RGN_DEFAULT);
930 groupResource = MMstartstr(m, MTOP(group));
932 groupResource = scene->GetName() + groupResource;
934 std::string sceneName = boost::filesystem::path(fPath).stem().generic_string();
943 fscale = MTOF(scale);
946 std::vector<SNode*> objectToLoad;
947 std::vector<SMaterial*> matsToLoad;
950 ALSceneLoader alLoader(scene, fPath, groupResource,
flags, fscale);
952 if (!alLoader.loadFile(sceneName, node, objectToLoad, matsToLoad))
954 MMechostr(MSKRUNTIME,
"SO3SceneLoadFileEx : File not valid: %s\n", fPath.c_str());
961 for (
unsigned int n = 0; n < objectToLoad.size(); ++n)
964 if ((scene->GetRootNode() != objectToLoad[n]) && (node != objectToLoad[n]))
969 if ((objectToLoad[n]->GetNodeType() == SNode::ENTITY_TYPE_ID))
971 SEntity* entity =
static_cast<SEntity*
>(objectToLoad[n]);
974 if (entity && entity->getOgreEntityPointer() && entity->getOgreEntityPointer()->getSkeleton())
976 string tmpSkeletonName = entity->GetName() +
"." + entity->getOgreEntityPointer()->getSkeleton()->getName();
977 SSkeleton* newSkeleton = 0;
980 newSkeleton = scene->CreateSkeleton(tmpSkeletonName, entity);
983 SBoneMap bonesListCopy = newSkeleton->GetBones();
984 SBoneMap::iterator iBone = bonesListCopy.begin();
985 while (iBone != bonesListCopy.end())
987 SBone* newBone = iBone->second;
988 assert(newBone != 0);
989 createBone(m, (SNode*)newBone, scene, entity);
997 const SAnimMap animations = newSkeleton->GetAnimations();
998 SAnimMap::const_iterator iAnimation = animations.begin();
999 while (iAnimation != animations.end())
1001 SAnim* newAnimation = iAnimation->second;
1002 assert(newAnimation != 0);
1007 const SAnimTrackList animationsTracksListCopy = newAnimation->GetAnimationsTracks();
1008 SAnimTrackList::const_iterator iAnimationTrack = animationsTracksListCopy.begin();
1009 while (iAnimationTrack != animationsTracksListCopy.end())
1011 SAnimTrack* newAnimationTrack = (*iAnimationTrack);
1012 assert(newAnimationTrack != 0);
1019 newAnimation->SetLoop(
true);
1020 newAnimation->SetEnable(
true);
1027 catch (Ogre::Exception &)
1034 for (
unsigned int a = 0; a < objectToLoad[n]->GetNumAnimations(); ++a)
1036 SAnim* animation = objectToLoad[n]->GetAnimation(a);
1040 animation->SetLoop(
true);
1041 animation->SetEnable(
true);
1043 for (
unsigned int t = 0; t < animation->GetNumAnimationsTracks(); ++t)
1052 catch (Ogre::Exception &e)
1055 MMechostr(MSKDEBUG,
"SO3SceneLoadFileEx : An exception has occurred: %s\n", e.what());
1060 if (objectToLoad.size() == 0)
1062 MMechostr(MSKDEBUG,
"SO3SceneLoadFileEx : Unsupported format or nothing to load\n");
1086 MMechostr(MSKDEBUG,
"SO3SceneUnloadResource\n");
1089 int type = MTOI(MMpull(m));
1091 int s = MMget(m, 0);
1093 if ((p == NIL) || (s == NIL))
1099 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1171 MMset(m, 0, ITOM(1));
1200 MMechostr(MSKDEBUG,
"SO3SceneLoadResource\n");
1203 int type = MTOI(MMpull(m));
1205 int group = MMpull(m);
1208 if ((p == NIL) || (s == NIL))
1214 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1221 string pathStd = MMstartstr(m, MTOP(p));
1222 for (
unsigned int i = 0; i < pathStd.length(); i++)
1224 if (pathStd.substr(i, 1) ==
"\\")
1225 pathStd.replace(i, 1,
"/");
1228 std::string groupResource(Ogre::RGN_DEFAULT);
1230 groupResource = MMstartstr(m, MTOP(group));
1232 groupResource = scene->GetName() + groupResource;
1234 if (scene->ParseResourceScript(groupResource, pathStd,
static_cast<SResource::ResourceType
>(type)))
1240 MMechostr(MSKDEBUG,
"Error when loading %s in group %s\n", pathStd.c_str(), groupResource.c_str());
1260 MMechostr(MSKDEBUG,
"SO3SceneCloneAnimation\n");
1329 MMechostr(MSKDEBUG,
"SO3SceneCloneAnimTrack\n");
1331 MMechostr(MSKRUNTIME,
"DEPRECATED FUNCTION Call: SO3SceneCloneAnimTrack\n");
1334 int anim = MMpull(m);
1336 int s = MMget(m, 0);
1358 MMechostr(MSKDEBUG,
"SO3SceneLoadResourceMaterial\n");
1362 int group = MMpull(m);
1363 int s = MMget(m, 0);
1365 if ((p == NIL) || (s == NIL))
1371 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1378 string pathStd = MMstartstr(m, MTOP(p));
1379 string::size_type pos = pathStd.rfind(
"/");
1380 string resourceLocation = pathStd.substr(0, pos + 1);
1381 string resource = pathStd.substr(pos + 1, pathStd.length() - 1);
1383 std::string groupResource(Ogre::RGN_DEFAULT);
1385 groupResource = MMstartstr(m, MTOP(group));
1387 groupResource = scene->GetName() + groupResource;
1391 Ogre::ResourceGroupManager::getSingleton().addResourceLocation(resourceLocation,
"ScolFileSystem", groupResource);
1392 Ogre::DataStreamPtr ds = Ogre::ResourceGroupManager::getSingleton().openResource(pathStd, groupResource);
1394 ds = Ogre::ResourceGroupManager::getSingleton().openResource(pathStd, Ogre::RGN_AUTODETECT);
1396 scene->O3MaterialManager->parseScript(ds, groupResource);
1397 MMset(m, 0, ITOM(1));
1400 catch (Ogre::Exception &e)
1402 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.what());
1421 MMechostr(MSKDEBUG,
"SO3SceneCreateAnimationSequence\n");
1424 int name = MMpull(m);
1426 if ((name == NIL) || (s == NIL))
1432 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1441 std::string animationName(MMstartstr(m, MTOP(name)));
1442 SAnim* animation = scene->CreateAnimationSequence(animationName);
1447 MMpush(m, MMfetch(m, p, OFFOBJCHN));
1449 if ((MMpushPointer(m, animation) != 0))
1458 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
1462 catch (Ogre::Exception &e)
1464 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
1483 MMechostr(MSKDEBUG,
"SO3SceneCreate\n");
1486 int name = MMpull(m);
1487 int channel = MMget(m, 0);
1490 if (name == NIL || channel == NIL)
1496 if (!SRoot::getSingleton().IsRenderInitialised())
1498 MMechostr(MSKRUNTIME,
"SO3SceneCreate Error: Create a window first to initialise ressources.");
1504 const char* sceneName = MMstartstr(m, MTOP(name));
1505 SScene* newScene = 0;
1508 newScene =
scolRoot->CreateScene(sceneName);
1510 catch (Ogre::Exception &e)
1512 SAFE_DELETE(newScene);
1513 MMechostr(MSKDEBUG,
"An exception has occurred: %s\nCreate a buffer first\n", e.what());
1518 packdir mypack = (packdir)SCgetExtra(
"FirstPack");
1520 std::vector<string> partitions;
1524 pathStd = mypack->path;
1525 for (
unsigned int i = 0; i < pathStd.length(); i++)
1527 if (pathStd.substr(i, 1) ==
"\\")
1528 pathStd.replace(i, 1,
"/");
1530 partitions.push_back(pathStd);
1531 mypack = mypack->next;
1534 std::string groupResource = newScene->GetName() + Ogre::RGN_DEFAULT;
1535 std::vector<string>::iterator iPartition = partitions.begin();
1536 while (iPartition != partitions.end())
1538 Ogre::ResourceGroupManager::getSingleton().addResourceLocation((*iPartition),
"ScolFileSystem", groupResource,
false);
1544 if ((MMpushPointer(m, newScene) != 0))
1551 int scolSceneCreationReturn = OBJcreate(m,
SO3SCENETYPE, SCOL_PTR newScene, NIL, 0);
1554 SNode* rootNode = newScene->GetRootNode();
1559 if ((MMpushPointer(m, rootNode) != 0))
1570 return scolSceneCreationReturn;
1585 MMechostr(MSKDEBUG,
"SO3SceneDelete\n");
1588 int s = MMget(m, 0);
1597 MMset(m, 0, ITOM(1));
1616 int s = MMget(m, 0);
1623 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1630 if (SRoot::getSingletonPtr()->IsRendering())
1632 MMechostr(MSKRUNTIME,
"SO3SceneClear: Can not be called in a render callback\n");
1638 const SWindowMap windowList =
scolRoot->GetRenderWindowList();
1639 SWindowMap::const_iterator iWindowList = windowList.begin();
1640 while (iWindowList != windowList.end())
1642 SWindow* curWin = iWindowList->second;
1645 curWin->SetStereoMode(StereoManager::SO3_NONE_STEREO);
1648 const SViewPortList sviewportList = curWin->GetViewportList();
1649 SViewPortList::const_iterator iViewportList = sviewportList.begin();
1650 while (iViewportList != sviewportList.end())
1652 iViewportList->second->ClearCompositors();
1659 const SGroupMaterialMap groupmatmap = (*scene->GetMaterials());
1660 SGroupMaterialMap::const_iterator iGroupMaterialList = groupmatmap.begin();
1661 while (iGroupMaterialList != groupmatmap.end())
1664 const SMaterialMap matmap = (*iGroupMaterialList->second);
1665 SMaterialMap::const_iterator iMaterialList = matmap.begin();
1666 while (iMaterialList != matmap.end())
1669 OBJdelTH(m,
SO3MATERIAL, SCOL_PTR(iMaterialList->second));
1672 iGroupMaterialList++;
1676 const SGroupTextureMap grouptexmap = (*scene->GetTextures());
1677 SGroupTextureMap::const_iterator iGroupTextureList = grouptexmap.begin();
1678 while (iGroupTextureList != grouptexmap.end())
1681 const STextureMap texmap = (*iGroupTextureList->second);
1682 STextureMap::const_iterator iTextureList = texmap.begin();
1683 while (iTextureList != texmap.end())
1686 OBJdelTH(m,
SO3TEXTURE, SCOL_PTR(iTextureList->second));
1689 iGroupTextureList++;
1693 if (scene->GetPhysicsWorld())
1695 const SMaterialIDMap physicMatIdList = scene->GetPhysicsWorld()->listOfMaterialID;
1696 SMaterialIDMap::const_iterator iMaterialIDList = physicMatIdList.begin();
1697 while (iMaterialIDList != physicMatIdList.end())
1705 const SAnimMap seqAnimCopy = scene->GetAnimations();
1706 SAnimMap::const_iterator iSeqAnim = seqAnimCopy.begin();
1707 while (iSeqAnim != seqAnimCopy.end())
1709 OBJdelTH(m,
SO3ANIM, SCOL_PTR(iSeqAnim->second));
1714 const SNodeMap nodeListCopy = scene->GetNodeList();
1715 SNodeMap::const_iterator iNodeList = nodeListCopy.begin();
1716 while (iNodeList != nodeListCopy.end())
1725 OBJdelTH(m,
SO3OBJTYPE, SCOL_PTR(iNodeList->second));
1730 const STerrainMap terrainListCopy = scene->GetTerrainList();
1731 STerrainMap::const_iterator iTerrainList = terrainListCopy.begin();
1732 while (iTerrainList != terrainListCopy.end())
1738 if (scene->GetPhysicsWorld())
1740 const PhysicContraintList jointList = scene->GetPhysicsWorld()->GetPhysicContraintList();
1741 PhysicContraintList::const_iterator jointIt;
1742 for (jointIt = jointList.begin(); jointIt != jointList.end(); ++jointIt)
1748 scene->GetPhysicsWorld()->listOfMaterialID.clear();
1749 scene->GetPhysicsWorld()->listOfPhysicsMaterialPair.clear();
1754 scene->clearOgreScene();
1755 MMset(m, 0, ITOM(1));
1777 MMechostr(MSKDEBUG,
"SO3SceneSetSkyBox\n");
1780 int drawFirst = MMpull(m);
1781 int enabled = MMpull(m);
1782 int group = MMpull(m);
1783 int orient = MTOP(MMpull(m));
1784 float dist = MTOF(MMpull(m));
1785 int mat = MMpull(m);
1786 int s = MMget(m, 0);
1787 if ((s == NIL) || (mat == NIL))
1793 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1800 SMaterial * material = MMgetPointer<SMaterial*>(m, MTOP(mat));
1803 MMechostr(MSKDEBUG,
"material==NULL\n");
1808 bool isEnable =
false;
1809 if (MTOI(enabled) == 1)
1812 bool isDrawFirst =
false;
1813 if (MTOI(drawFirst) == 1)
1816 std::string groupResource(Ogre::RGN_DEFAULT);
1818 Ogre::Quaternion quat;
1820 quat = Ogre::Quaternion::IDENTITY;
1823 quat.x = MTOF(MMfetch(m, orient, 0));
1824 quat.y = MTOF(MMfetch(m, orient, 1));
1825 quat.z = MTOF(MMfetch(m, orient, 2));
1826 quat.w = MTOF(MMfetch(m, orient, 3));
1830 if (material->getOgreMaterialPointer())
1833 if (scene->skyBoxMat)
1835 scene->O3MaterialManager->remove(scene->skyBoxMat->getName());
1836 scene->O3MaterialManager->unload(scene->skyBoxMat->getName());
1840 Ogre::MaterialPtr mCurrentMaterialPointer = material->getOgreMaterialPointer()->clone(scene->GetName() +
"mSkyBoxMaterial_" + material->getOgreMaterialPointer()->getName(), groupResource);
1841 mCurrentMaterialPointer->setLightingEnabled(
false);
1843 scene->O3SceneManager->setSkyBox(isEnable, mCurrentMaterialPointer->getName(), dist, isDrawFirst, quat, groupResource);
1844 scene->skyBoxDrawFirst = isDrawFirst;
1846 scene->hasSkyBox =
true;
1847 scene->skyBoxMat = mCurrentMaterialPointer;
1849 MMset(m, 0, ITOM(1));
1852 catch (Ogre::Exception &e)
1854 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.what());
1873 MMechostr(MSKDEBUG,
"SO3SceneSetSkyBoxEnable\n");
1876 int enabled = MMpull(m);
1877 int s = MMget(m, 0);
1884 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1891 if (!scene->skyBoxMat)
1899 if (scene->hasSkyBox)
1901 if (scene->O3SceneManager->getSkyBoxNode() != 0)
1903 if (MTOI(enabled) != 1)
1905 scene->O3SceneManager->getSkyBoxNode()->setVisible(
false);
1906 scene->O3SceneManager->setSkyBox(
false,
"");
1907 if (scene->skyBoxMat)
1909 scene->O3MaterialManager->remove(scene->skyBoxMat->getName());
1910 scene->O3MaterialManager->unload(scene->skyBoxMat->getName());
1915 scene->O3SceneManager->getSkyBoxNode()->setVisible(
true);
1916 scene->O3SceneManager->setSkyBox(
true, scene->skyBoxMat->getName());
1918 MMset(m, 0, ITOM(1));
1923 catch (Ogre::Exception &e)
1925 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.what());
1949 MMechostr(MSKDEBUG,
"SO3SceneGetSkyBoxParameters\n");
1952 int s = MMget(m, 0);
1959 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1966 std::string groupResource(Ogre::RGN_DEFAULT);
1970 if (scene->hasSkyBox)
1974 SMaterial* curMat = scene->GetMaterial(groupResource, scene->skyBoxMat->getName().c_str());
1975 int mat = OBJfindTH(m,
SO3MATERIAL, SCOL_PTR(curMat));
1977 mat = MMfetch(m, mat, OFFOBJMAG);
1980 float d = scene->O3SceneManager->getSkyBoxGenParameters().skyBoxDistance;
1983 Ogre::Quaternion orient;
1984 orient = scene->O3SceneManager->getSkyBoxNode()->getOrientation();
1985 int rot = MMmalloc(m, 4, TYPETAB);
1991 MMstore(m, rot, 0, FTOM(orient.x));
1992 MMstore(m, rot, 1, FTOM(orient.y));
1993 MMstore(m, rot, 2, FTOM(orient.z));
1994 MMstore(m, rot, 3, FTOM(orient.w));
1995 MMpush(m, PTOM(rot));
1997 int booleenEnable = 0;
1998 if (scene->O3SceneManager->isSkyBoxEnabled())
2000 MMpush(m, ITOM(booleenEnable));
2002 int booleenDrawFirst = 0;
2003 if (scene->skyBoxDrawFirst)
2004 booleenDrawFirst = 1;
2005 MMpush(m, ITOM(booleenDrawFirst));
2008 int tuple = MMmalloc(m, 5, TYPETAB);
2014 MMstore(m, tuple, 4, MMpull(m));
2015 MMstore(m, tuple, 3, MMpull(m));
2016 MMstore(m, tuple, 2, MMpull(m));
2017 MMstore(m, tuple, 1, MMpull(m));
2018 MMstore(m, tuple, 0, MMpull(m));
2019 MMset(m, 0, PTOM(tuple));
2028 catch (Ogre::Exception &e)
2030 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.what());
2059 MMechostr(MSKDEBUG,
"SO3SceneSetSkyDome\n");
2062 int drawFirst = MMpull(m);
2063 int enabled = MMpull(m);
2064 int group = MMpull(m);
2065 int yKeep = MTOI(MMpull(m));
2066 int ySeg = MTOI(MMpull(m));
2067 int xSeg = MTOI(MMpull(m));
2068 float tiling = MTOF(MMpull(m));
2069 float curvature = MTOF(MMpull(m));
2070 int orient = MTOP(MMpull(m));
2071 float dist = MTOF(MMpull(m));
2072 int mat = MMpull(m);
2073 int s = MMget(m, 0);
2074 if ((s == NIL) || (mat == NIL))
2080 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
2087 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
2090 MMechostr(MSKDEBUG,
"SO3SceneSetSkyDome : material NULL\n");
2095 std::string groupResource(Ogre::RGN_DEFAULT);
2097 bool isEnable =
false;
2098 if (MTOI(enabled) == 1)
2101 bool isDrawFirst =
false;
2102 if (MTOI(drawFirst) == 1)
2105 Ogre::Quaternion quat;
2107 quat = Ogre::Quaternion::IDENTITY;
2110 quat.x = MTOF(MMfetch(m, orient, 0));
2111 quat.y = MTOF(MMfetch(m, orient, 1));
2112 quat.z = MTOF(MMfetch(m, orient, 2));
2113 quat.w = MTOF(MMfetch(m, orient, 3));
2117 if (material->getOgreMaterialPointer())
2120 if (scene->skyDomeMat)
2122 scene->O3MaterialManager->remove(scene->skyDomeMat->getName());
2123 scene->O3MaterialManager->unload(scene->skyDomeMat->getName());
2127 Ogre::MaterialPtr mCurrentMaterialPointer = material->getOgreMaterialPointer()->clone(scene->GetName() +
"mSkyDomeMaterial_" + material->getOgreMaterialPointer()->getName(), groupResource);
2128 mCurrentMaterialPointer->setLightingEnabled(
false);
2129 scene->skyDomeDrawFirst = isDrawFirst;
2130 scene->hasSkyDome =
true;
2131 scene->skyDomeMat = mCurrentMaterialPointer;
2132 scene->O3SceneManager->setSkyDome(isEnable, mCurrentMaterialPointer->getName(), curvature, tiling, dist, isDrawFirst, quat, xSeg, ySeg, yKeep, groupResource);
2135 MMset(m, 0, ITOM(1));
2138 catch (Ogre::Exception &e)
2140 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.what());
2159 MMechostr(MSKDEBUG,
"SO3SceneSetSkyDomeEnable\n");
2162 int enabled = MMpull(m);
2163 int s = MMget(m, 0);
2170 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
2179 if (scene->hasSkyDome)
2181 if (scene->O3SceneManager->getSkyDomeNode() != 0)
2183 if (MTOI(enabled) != 1)
2185 scene->O3SceneManager->getSkyDomeNode()->setVisible(
false);
2186 scene->O3SceneManager->setSkyDome(
false,
"");
2187 if (scene->skyDomeMat)
2189 scene->O3MaterialManager->remove(scene->skyDomeMat->getName());
2190 scene->O3MaterialManager->unload(scene->skyDomeMat->getName());
2195 scene->O3SceneManager->getSkyDomeNode()->setVisible(
true);
2196 scene->O3SceneManager->setSkyDome(
true, scene->skyDomeMat->getName(), scene->O3SceneManager->getSkyDomeGenParameters().skyDomeCurvature, scene->O3SceneManager->getSkyDomeGenParameters().skyDomeTiling, scene->O3SceneManager->getSkyDomeGenParameters().skyDomeDistance);
2199 MMset(m, 0, ITOM(1));
2203 catch (Ogre::Exception &e)
2205 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.what());
2233 MMechostr(MSKDEBUG,
"SO3SceneGetSkyDomeParameters\n");
2236 int s = MMget(m, 0);
2243 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
2250 std::string groupResource(Ogre::RGN_DEFAULT);
2254 if (scene->hasSkyDome)
2258 SMaterial * curMat = scene->GetMaterial(groupResource, scene->skyDomeMat->getName().c_str());
2259 int mat = OBJfindTH(m,
SO3MATERIAL, SCOL_PTR(curMat));
2261 mat = MMfetch(m, mat, OFFOBJMAG);
2264 float curvature = scene->O3SceneManager->getSkyDomeGenParameters().skyDomeCurvature;
2265 MMpush(m, FTOM(curvature));
2267 float tilling = scene->O3SceneManager->getSkyDomeGenParameters().skyDomeTiling;
2268 MMpush(m, FTOM(tilling));
2270 float d = scene->O3SceneManager->getSkyDomeGenParameters().skyDomeDistance;
2273 int xSeg = scene->O3SceneManager->getSkyDomeGenParameters().skyDomeXSegments;
2274 MMpush(m, ITOM(xSeg));
2276 int ySeg = scene->O3SceneManager->getSkyDomeGenParameters().skyDomeYSegments;
2277 MMpush(m, ITOM(ySeg));
2279 int keep = scene->O3SceneManager->getSkyDomeGenParameters().skyDomeYSegments_keep;
2280 MMpush(m, ITOM(keep));
2282 Ogre::Quaternion orient;
2283 orient = scene->O3SceneManager->getSkyDomeNode()->getOrientation();
2284 int rot = MMmalloc(m, 4, TYPETAB);
2290 MMstore(m, rot, 0, FTOM(orient.x));
2291 MMstore(m, rot, 1, FTOM(orient.y));
2292 MMstore(m, rot, 2, FTOM(orient.z));
2293 MMstore(m, rot, 3, FTOM(orient.w));
2294 MMpush(m, PTOM(rot));
2296 int booleenEnable = 0;
2297 if (scene->O3SceneManager->isSkyDomeEnabled())
2299 MMpush(m, ITOM(booleenEnable));
2301 int booleenDrawFirst = 0;
2302 if (scene->skyDomeDrawFirst)
2303 booleenDrawFirst = 1;
2304 MMpush(m, ITOM(booleenDrawFirst));
2307 int tuple = MMmalloc(m, 10, TYPETAB);
2313 MMstore(m, tuple, 9, MMpull(m));
2314 MMstore(m, tuple, 8, MMpull(m));
2315 MMstore(m, tuple, 7, MMpull(m));
2316 MMstore(m, tuple, 6, MMpull(m));
2317 MMstore(m, tuple, 5, MMpull(m));
2318 MMstore(m, tuple, 4, MMpull(m));
2319 MMstore(m, tuple, 3, MMpull(m));
2320 MMstore(m, tuple, 2, MMpull(m));
2321 MMstore(m, tuple, 1, MMpull(m));
2322 MMstore(m, tuple, 0, MMpull(m));
2323 MMset(m, 0, PTOM(tuple));
2333 catch (Ogre::Exception &e)
2335 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.what());
2364 MMechostr(MSKDEBUG,
"SO3SceneSetSkyPlane\n");
2367 int drawFirst = MMpull(m);
2368 int enabled = MMpull(m);
2369 int group = MMpull(m);
2370 int ySeg = MTOI(MMpull(m));
2371 int xSeg = MTOI(MMpull(m));
2372 float bow = MTOF(MMpull(m));
2373 float tiling = MTOF(MMpull(m));
2374 float scale = MTOF(MMpull(m));
2375 int vec = MTOP(MMpull(m));
2376 float d = MTOF(MMpull(m));
2377 int mat = MMpull(m);
2378 int s = MMget(m, 0);
2379 if ((s == NIL) || (mat == NIL))
2385 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
2392 SMaterial* material = MMgetPointer<SMaterial*>(m, MTOP(mat));
2395 MMechostr(MSKDEBUG,
"material==NULL\n");
2400 std::string groupResource(Ogre::RGN_DEFAULT);
2402 bool isEnable =
false;
2403 if (MTOI(enabled) == 1)
2406 bool isDrawFirst =
false;
2407 if (MTOI(drawFirst) == 1)
2412 if (material->getOgreMaterialPointer())
2415 if (scene->skyPlaneMat)
2417 scene->O3MaterialManager->remove(scene->skyPlaneMat->getName());
2418 scene->O3MaterialManager->unload(scene->skyPlaneMat->getName());
2422 Ogre::MaterialPtr mCurrentMaterialPointer = material->getOgreMaterialPointer()->clone(scene->GetName() +
"mSkyPlaneMaterial_" + material->getOgreMaterialPointer()->getName(), groupResource);
2423 mCurrentMaterialPointer->setLightingEnabled(
false);
2426 Ogre::Vector3 vecteur;
2429 vecteur.NEGATIVE_UNIT_Y;
2433 vecteur.x = MTOF(MMfetch(m, vec, 0));
2434 vecteur.y = MTOF(MMfetch(m, vec, 1));
2435 vecteur.z = MTOF(MMfetch(m, vec, 2));
2438 plane.normal = vecteur;
2440 scene->O3SceneManager->setSkyPlane(isEnable, plane, mCurrentMaterialPointer->getName(), scale, tiling, isDrawFirst, bow, xSeg, ySeg, groupResource);
2442 scene->skyPlaneDrawFirst = isDrawFirst;
2443 scene->hasSkyPlane =
true;
2444 scene->skyPlaneMat = mCurrentMaterialPointer;
2445 scene->skyPlane = plane;
2448 MMset(m, 0, ITOM(1));
2451 catch (Ogre::Exception &e)
2453 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.what());
2472 MMechostr(MSKDEBUG,
"SO3SceneSetSkyPlaneEnable\n");
2476 int enabled = MMpull(m);
2477 int s = MMget(m, 0);
2484 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
2493 if (scene->hasSkyPlane)
2495 if (scene->O3SceneManager->getSkyPlaneNode() != 0)
2497 if (MTOI(enabled) != 1)
2499 scene->O3SceneManager->getSkyPlaneNode()->setVisible(
false);
2500 scene->O3SceneManager->setSkyPlane(
false, scene->skyPlane,
"");
2501 if (scene->skyPlaneMat)
2503 scene->O3MaterialManager->remove(scene->skyPlaneMat->getName());
2504 scene->O3MaterialManager->unload(scene->skyPlaneMat->getName());
2509 scene->O3SceneManager->getSkyPlaneNode()->setVisible(
true);
2510 scene->O3SceneManager->setSkyPlane(
true, scene->skyPlane, scene->skyPlaneMat->getName());
2512 MMset(m, 0, ITOM(1));
2517 catch (Ogre::Exception &e)
2519 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.what());
2547 MMechostr(MSKDEBUG,
"SO3SceneGetSkyPlaneParameters\n");
2550 int s = MMget(m, 0);
2557 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
2566 std::string groupResource(Ogre::RGN_DEFAULT);
2570 if (scene->hasSkyPlane)
2574 SMaterial* curMat = scene->GetMaterial(groupResource, scene->skyPlaneMat->getName().c_str());
2577 float bow = scene->O3SceneManager->getSkyPlaneGenParameters().skyPlaneBow;
2578 MMpush(m, FTOM(bow));
2580 float scale = scene->O3SceneManager->getSkyPlaneGenParameters().skyPlaneScale;
2581 MMpush(m, FTOM(scale));
2583 float tiling = scene->O3SceneManager->getSkyPlaneGenParameters().skyPlaneTiling;
2584 MMpush(m, FTOM(tiling));
2586 int xSeg = scene->O3SceneManager->getSkyPlaneGenParameters().skyPlaneXSegments;
2587 MMpush(m, ITOM(xSeg));
2589 int ySeg = scene->O3SceneManager->getSkyPlaneGenParameters().skyPlaneYSegments;
2590 MMpush(m, ITOM(ySeg));
2592 float d = scene->skyPlane.d;
2596 vec = scene->skyPlane.normal;
2597 int vecteur = MMmalloc(m, 3, TYPETAB);
2603 MMstore(m, vecteur, 0, FTOM(vec.x));
2604 MMstore(m, vecteur, 1, FTOM(vec.y));
2605 MMstore(m, vecteur, 2, FTOM(vec.z));
2606 MMpush(m, PTOM(vecteur));
2608 int booleenEnable = 0;
2609 if (scene->O3SceneManager->isSkyPlaneEnabled())
2611 MMpush(m, ITOM(booleenEnable));
2613 int booleenDrawFirst = 0;
2614 if (scene->skyBoxDrawFirst)
2615 booleenDrawFirst = 1;
2616 MMpush(m, ITOM(booleenDrawFirst));
2619 int tuple = MMmalloc(m, 10, TYPETAB);
2625 MMstore(m, tuple, 9, MMpull(m));
2626 MMstore(m, tuple, 8, MMpull(m));
2627 MMstore(m, tuple, 7, MMpull(m));
2628 MMstore(m, tuple, 6, MMpull(m));
2629 MMstore(m, tuple, 5, MMpull(m));
2630 MMstore(m, tuple, 4, MMpull(m));
2631 MMstore(m, tuple, 3, MMpull(m));
2632 MMstore(m, tuple, 2, MMpull(m));
2633 MMstore(m, tuple, 1, MMpull(m));
2634 MMstore(m, tuple, 0, MMpull(m));
2635 MMpush(m, PTOM(tuple));
2645 catch (Ogre::Exception &e)
2647 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.what());
2666 MMechostr(MSKDEBUG,
"SO3SceneSetAmbientLight\n");
2669 int ambient = MTOI(MMpull(m));
2670 int s = MMget(m, 0);
2671 if ((s == NIL) || (ambient == NIL))
2676 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
2682 float r, g, b, a = 0.0;
2683 r = ((ambient >> 23) & 0x000000ff) / CONST_COLOR;
2684 g = ((ambient >> 15) & 0x000000ff) / CONST_COLOR;
2685 b = ((ambient >> 7) & 0x000000ff) / CONST_COLOR;
2686 a = ((ambient)& 0x0000007E) / CONST_COLOR_ALPHA;
2687 Ogre::ColourValue ambientColor;
2692 scene->SetAmbientLight(ambientColor);
2693 MMset(m, 0, ITOM(1));
2709 MMechostr(MSKDEBUG,
"SO3SceneGetAmbientLight\n");
2712 int s = MMget(m, 0);
2718 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
2725 Ogre::ColourValue color = scene->GetAmbientLight();
2726 int a =
static_cast <int> (color.a*CONST_COLOR_ALPHA);
2727 int b =
static_cast <int> (color.b*CONST_COLOR);
2728 int g =
static_cast <int> (color.g*CONST_COLOR);
2729 int r =
static_cast <int> (color.r*CONST_COLOR);
2731 int val = (a & 0x0000007E) + ((b & 0x000000ff) << 7) + ((g & 0x000000ff) << 15) + ((r & 0x000000ff) << 23);
2733 MMset(m, 0, ITOM(val));
2749 MMechostr(MSKDEBUG,
"SO3SceneGetFogColor\n");
2752 int s = MMget(m, 0);
2758 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
2765 int a =
static_cast <int> (scene->O3SceneManager->getFogColour().a*CONST_COLOR_ALPHA);
2766 int b =
static_cast <int> (scene->O3SceneManager->getFogColour().b*CONST_COLOR);
2767 int g =
static_cast <int> (scene->O3SceneManager->getFogColour().g*CONST_COLOR);
2768 int r =
static_cast <int> (scene->O3SceneManager->getFogColour().r*CONST_COLOR);
2770 int val = (a & 0x0000007E) + ((b & 0x000000ff) << 7) + ((g & 0x000000ff) << 15) + ((r & 0x000000ff) << 23);
2772 MMset(m, 0, ITOM(val));
2794 MMechostr(MSKDEBUG,
"SO3SceneGetFogMode\n");
2797 int s = MMget(m, 0);
2803 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
2810 int val = (int)scene->O3SceneManager->getFogMode();
2812 MMset(m, 0, ITOM(val));
2828 MMechostr(MSKDEBUG,
"SO3SceneGetFogDensity\n");
2831 int s = MMget(m, 0);
2837 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
2844 float val = scene->O3SceneManager->getFogDensity();
2846 MMset(m, 0, FTOM(val));
2862 MMechostr(MSKDEBUG,
"SO3SceneGetFogStart\n");
2865 int s = MMget(m, 0);
2871 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
2878 float val = scene->O3SceneManager->getFogStart();
2880 MMset(m, 0, FTOM(val));
2896 MMechostr(MSKDEBUG,
"SO3SceneGetFogEnd\n");
2899 int s = MMget(m, 0);
2905 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
2912 float val = scene->O3SceneManager->getFogEnd();
2914 MMset(m, 0, FTOM(val));
2941 MMechostr(MSKDEBUG,
"SO3SceneSetFog\n");
2944 int linE = MMpull(m);
2945 int linS = MMpull(m);
2946 int expo = MMpull(m);
2947 int color = MTOI(MMpull(m));
2948 int mode = MTOI(MMpull(m));
2949 int s = MMget(m, 0);
2950 if ((s == NIL) || (color == NIL) || (expo == NIL) || (linS == NIL) || (linE == NIL) || (mode == NIL))
2955 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
2962 float r, g, b, a = 0.0;
2964 r = ((color >> 23) & 0x000000ff) / CONST_COLOR;
2965 g = ((color >> 15) & 0x000000ff) / CONST_COLOR;
2966 b = ((color >> 7) & 0x000000ff) / CONST_COLOR;
2967 a = ((color)& 0x0000007E) / CONST_COLOR_ALPHA;
2969 Ogre::ColourValue diffuseColor;
2985 scene->O3SceneManager->setFog((Ogre::FogMode)mode, diffuseColor, (Ogre::Real)fExpo, (Ogre::Real)fLinS, (Ogre::Real)fLinE);
2987 MMset(m, 0, ITOM(1));
3004 MMechostr(MSKDEBUG,
"SO3SceneGetNode\n");
3007 int name = MMpull(m);
3008 int s = MMget(m, 0);
3009 if ((name == NIL) || (s == NIL))
3014 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
3022 curNode = scene->GetNode(
string(MMstartstr(m, MTOP(name))));
3023 if (curNode == NULL)
3028 int so3obj = OBJfindTH(m,
SO3OBJTYPE, SCOL_PTR(curNode));
3030 so3obj = MMfetch(m, so3obj, OFFOBJMAG);
3031 MMset(m, 0, so3obj);
3048 MMechostr(MSKDEBUG,
"SO3SceneGetObject\n");
3051 int name = MMpull(m);
3052 int s = MMget(m, 0);
3053 if ((name == NIL) || (s == NIL))
3059 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
3067 string tmpName(MMstartstr(m, MTOP(name)));
3070 if (tmpName == scene->GetRootNode()->GetName())
3071 curNode = scene->GetRootNode();
3073 curNode = scene->GetNode(tmpName);
3077 MMechostr(MSKDEBUG,
"SO3SceneGetObject : Node is NULL : %s \n", tmpName.c_str());
3082 int c = OBJfindTH(m,
SO3OBJTYPE, SCOL_PTR(curNode));
3084 c = MMfetch(m, c, OFFOBJMAG);
3103 MMechostr(MSKDEBUG,
"SO3SceneNodeCreate\n");
3106 int name = MMpull(m);
3107 int s = MMget(m, 0);
3114 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
3122 std::string tmpNodeName(MMstartstr(m, MTOP(name)));
3126 node = scene->CreateNode(tmpNodeName);
3130 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
3134 catch (Ogre::Exception &e)
3136 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
3159 MMechostr(MSKDEBUG,
"SO3SceneParseMaterialsFromGroup\n");
3162 int group = MMpull(m);
3170 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
3177 std::string groupResource(Ogre::RGN_DEFAULT);
3179 groupResource = MMstartstr(m, MTOP(group));
3181 if (groupResource.substr(0, 4) !=
"SO3/")
3182 groupResource = scene->GetName() + groupResource;
3184 const SMaterialMap* groupMaterials = scene->GetMaterials(groupResource);
3185 if (groupMaterials == 0)
3187 MMechostr(MSKDEBUG,
"SO3SceneParseMaterialsFromGroup: resource group \"%s\" not found!\n", groupResource.c_str());
3193 unsigned int count = 0;
3195 SMaterialMap::const_iterator i = groupMaterials->begin();
3196 while (i != groupMaterials->end())
3198 std::string matName = i->second->GetName();
3199 if (matName.find(std::string(SO3_INTERNAL_RESOURCE_GROUP)) != 0 && matName.find(std::string(Ogre::RGN_DEFAULT)) != 0)
3210 for (
unsigned int j = 0; j < count; j++)
3212 if (MMpush(m, 2 * 2))
3214 if (
int k = MBdeftab(m))
3234 MMechostr(MSKDEBUG,
"SO3SceneParseCompositorsFromGroup\n");
3237 int group = MMpull(m);
3245 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
3252 std::string groupResource(Ogre::RGN_DEFAULT);
3254 groupResource = MMstartstr(m, MTOP(group));
3256 if (groupResource.substr(0, 4) !=
"SO3/")
3257 groupResource = scene->GetName() + groupResource;
3259 Ogre::CompositorManager::ResourceMapIterator it = Ogre::CompositorManager::getSingleton().getResourceIterator();
3262 std::set<string> myStr;
3263 while (it.hasMoreElements())
3265 Ogre::CompositorPtr curComp = Ogre::static_pointer_cast<Ogre::Compositor>(it.getNext());
3266 std::string compName = curComp->getName();
3267 if ((compName.find(std::string(SO3_INTERNAL_RESOURCE_GROUP)) != 0) && (compName.find(std::string(Ogre::RGN_DEFAULT)) != 0) && (curComp->getGroup() == groupResource))
3269 myStr.insert(curComp->getName());
3273 std::set<string>::iterator iMyStr = myStr.begin();
3274 while (iMyStr != myStr.end())
3276 if (k = Mpushstrbloc(m, (
char*)(*iMyStr).c_str()))
3285 for (
unsigned int i = 0; i < myStr.size(); i++)
3287 if (MMpush(m, 2 * 2))
3289 if (k = MBdeftab(m))
3308 MMechostr(MSKDEBUG,
"SO3SceneParseSchemeFromGroup\n");
3311 int group = MMpull(m);
3319 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
3326 std::string groupResource(Ogre::RGN_DEFAULT);
3328 groupResource = MMstartstr(m, MTOP(group));
3330 if (groupResource.substr(0, 4) !=
"SO3/")
3331 groupResource = scene->GetName() + groupResource;
3333 Ogre::MaterialManager::ResourceMapIterator it = scene->O3MaterialManager->getResourceIterator();
3336 std::set<string> myStr;
3337 while (it.hasMoreElements())
3339 Ogre::MaterialPtr curMat = Ogre::static_pointer_cast<Ogre::Material>(it.getNext());
3340 if (curMat->getGroup() == groupResource)
3342 for (
int i = 0; i < curMat->getNumTechniques(); i++)
3344 std::string schemeName = curMat->getTechnique(i)->getSchemeName();
3345 if (schemeName ==
"Default")
3348 if (schemeName.find(std::string(SO3_INTERNAL_RESOURCE_GROUP)) != 0)
3350 if (schemeName.find(
"ShaderGenerator") != std::string::npos)
3351 schemeName = schemeName.erase(0, 15);
3352 myStr.insert(schemeName);
3358 auto strit = myStr.find(
"DefaultScheme");
3359 if (strit == myStr.end())
3360 myStr.insert(
"DefaultScheme");
3362 std::set<string>::iterator iSchemeList = myStr.begin();
3363 while (iSchemeList != myStr.end())
3365 if (k = Mpushstrbloc(m, (
char*)(*iSchemeList).c_str()))
3374 for (
unsigned int i = 0; i < myStr.size(); i++)
3376 if (MMpush(m, 2 * 2))
3378 if (k = MBdeftab(m))
3397 MMechostr(MSKDEBUG,
"SO3SceneParseParticleSystemsFromGroup\n");
3400 int group = MMpull(m);
3408 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
3415 std::string groupResource(Ogre::RGN_DEFAULT);
3417 groupResource = MMstartstr(m, MTOP(group));
3419 if (groupResource.substr(0, 4) !=
"SO3/")
3420 groupResource = scene->GetName() + groupResource;
3422 Ogre::ParticleSystemManager::ParticleSystemTemplateIterator it = Ogre::ParticleSystemManager::getSingletonPtr()->getTemplateIterator();
3425 std::set<string> myStr;
3426 while (it.hasMoreElements())
3428 Ogre::ParticleSystem * curPS = it.getNext();
3429 if (curPS->getResourceGroupName() == groupResource)
3431 myStr.insert(curPS->getName());
3435 std::set<string>::iterator iMyStr = myStr.begin();
3436 while (iMyStr != myStr.end())
3438 if (k = Mpushstrbloc(m, (
char*)(*iMyStr).c_str()))
3446 for (
unsigned int i = 0; i < myStr.size(); i++)
3448 if (MMpush(m, 2 * 2))
3450 if (k = MBdeftab(m))
3470 MMechostr(MSKDEBUG,
"SO3SceneGetMaterial\n");
3473 int name = MMpull(m);
3474 int group = MMpull(m);
3475 int s = MMget(m, 0);
3476 if ((name == NIL) || (s == NIL))
3482 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
3489 std::string groupResource(Ogre::RGN_DEFAULT);
3491 groupResource = MMstartstr(m, MTOP(group));
3493 if (groupResource.substr(0, 4) !=
"SO3/")
3494 groupResource = scene->GetName() + groupResource;
3496 SMaterial* tmpMat = scene->GetMaterial(groupResource, MMstartstr(m, MTOP(name)));
3522 MMechostr(MSKDEBUG,
"SO3SceneGetTexture\n");
3525 int name = MMpull(m);
3526 int group = MMpull(m);
3527 int s = MMget(m, 0);
3528 if ((name == NIL) || (s == NIL))
3533 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
3543 std::string groupResource(Ogre::RGN_DEFAULT);
3545 groupResource = MMstartstr(m, MTOP(group));
3547 if (groupResource.substr(0, 4) !=
"SO3/")
3548 groupResource = scene->GetName() + groupResource;
3550 STexture* texture = scene->GetTexture(groupResource, MMstartstr(m, MTOP(name)));
3551 if (texture != NULL)
3553 int tx = OBJfindTH(m,
SO3TEXTURE, SCOL_PTR(texture));
3555 tx = MMfetch(m, tx, OFFOBJMAG);
3561 std::string tmpTextureName(MMstartstr(m, MTOP(name)));
3563 STexture* newTex = scene->CreateTexture(groupResource, tmpTextureName, std::string(
""));
3591 MMechostr(MSKDEBUG,
"SO3PlaneCreate\n");
3594 int puv = MMpull(m);
3595 int pseg = MMpull(m);
3596 int psize = MMpull(m);
3597 int name = MMpull(m);
3598 int group = MMpull(m);
3600 if ((name == NIL) || (s == NIL) || (psize == NIL))
3606 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
3613 std::string groupResource(Ogre::RGN_DEFAULT);
3615 groupResource = MMstartstr(m, MTOP(group));
3617 groupResource = scene->GetName() + groupResource;
3619 std::string planeName = MMstartstr(m, MTOP(name));
3621 SPointFloat uv(1.0f, 1.0f);
3624 uv.x = MTOF(MMfetch(m, MTOP(puv), 0));
3625 uv.y = MTOF(MMfetch(m, MTOP(puv), 1));
3628 SPointInt seg(1, 1);
3631 seg.x = MTOI(MMfetch(m, MTOP(pseg), 0));
3632 seg.y = MTOI(MMfetch(m, MTOP(pseg), 1));
3636 sizev.x = MTOF(MMfetch(m, MTOP(psize), 0));
3637 sizev.y = MTOF(MMfetch(m, MTOP(psize), 1));
3639 SEntity* newEntity = 0;
3642 newEntity = scene->CreatePlane(groupResource, planeName, sizev, seg, uv);
3646 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
3650 catch (Ogre::Exception &e)
3652 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
3676 MMechostr(MSKDEBUG,
"SO3SphereCreate\n");
3679 int iseg = MMpull(m);
3680 int irings = MMpull(m);
3681 int iradius = MMpull(m);
3682 int name = MMpull(m);
3683 int group = MMpull(m);
3685 if ((name == NIL) || (s == NIL))
3691 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
3698 std::string groupResource(Ogre::RGN_DEFAULT);
3700 groupResource = MMstartstr(m, MTOP(group));
3702 groupResource = scene->GetName() + groupResource;
3704 std::string objName = MMstartstr(m, MTOP(name));
3706 float radius = 1.0f;
3708 radius = MTOF(iradius);
3712 rings = MTOI(irings);
3718 SEntity* newEntity = 0;
3721 newEntity = scene->CreateSphere(groupResource, objName, radius, rings, seg);
3725 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
3729 catch (Ogre::Exception &e)
3731 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
3758 int iseg = MMpull(m);
3759 int iheight = MMpull(m);
3760 int iradius = MMpull(m);
3761 int name = MMpull(m);
3762 int group = MMpull(m);
3764 if ((name == NIL) || (s == NIL))
3770 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
3777 std::string groupResource(Ogre::RGN_DEFAULT);
3779 groupResource = MMstartstr(m, MTOP(group));
3781 groupResource = scene->GetName() + groupResource;
3783 std::string objName = MMstartstr(m, MTOP(name));
3785 float radius = 1.0f;
3787 radius = MTOF(iradius);
3791 height = MTOF(iheight);
3797 SEntity* newEntity = 0;
3800 newEntity = scene->CreateCone(groupResource, objName, radius, height, seg);
3804 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
3808 catch (Ogre::Exception &e)
3810 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
3834 MMechostr(MSKDEBUG,
"SO3OctahedronCreate\n");
3837 int iup = MMpull(m);
3838 int ibottom = MMpull(m);
3839 int ibase = MMpull(m);
3840 int name = MMpull(m);
3841 int group = MMpull(m);
3843 if ((name == NIL) || (s == NIL))
3849 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
3856 std::string groupResource(Ogre::RGN_DEFAULT);
3858 groupResource = MMstartstr(m, MTOP(group));
3860 groupResource = scene->GetName() + groupResource;
3862 std::string objName = MMstartstr(m, MTOP(name));
3868 float bottom = 1.0f;
3870 bottom = MTOF(ibottom);
3876 SEntity* newEntity = 0;
3879 newEntity = scene->CreateOctahedron(groupResource, objName, base, bottom, up);
3883 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
3887 catch (Ogre::Exception &e)
3889 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.
what());
3909 MMechostr(MSKDEBUG,
"SO3SceneGetAnimation\n");
3912 int name = MMpull(m);
3913 int s = MMget(m, 0);
3914 if ((name == NIL) || (s == NIL))
3920 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
3927 std::string animationName(MMstartstr(m, MTOP(name)));
3928 SAnim* curAnim = scene->GetAnimation(animationName);
3931 MMechostr(MSKDEBUG,
"Animation not found!\n");
3936 int a = OBJfindTH(m,
SO3ANIM, SCOL_PTR(curAnim));
3938 a = MMfetch(m, a, OFFOBJMAG);
3955 MMechostr(MSKDEBUG,
"SO3SceneGetAnimations\n");
3965 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
3974 const SAnimMap animationListCopy = scene->GetAnimations();
3975 SAnimMap::const_iterator iAnimations = animationListCopy.begin();
3976 while (iAnimations != animationListCopy.end())
3978 int a = OBJfindTH(m,
SO3ANIM, SCOL_PTR(iAnimations->second));
3981 a = MMfetch(m, a, OFFOBJMAG);
3993 for (
int j = 0; j < icount; j++)
3995 if (MMpush(m, 2 * 2))
3998 if (
int k = MBdeftab(m))
4016 MMechostr(MSKDEBUG,
"SO3SceneGetNumAnimations\n");
4019 int s = MMget(m, 0);
4026 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
4033 MMset(m, 0, ITOM(scene->GetNumAnimations()));
4049 MMechostr(MSKDEBUG,
"SO3SceneSetMaterialsPointSize\n");
4052 int isize = MMpull(m);
4053 int s = MMget(m, 0);
4060 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
4069 nsize = MTOF(isize);
4071 scene->SetMaterialsPointSize(nsize);
4090 MMechostr(MSKDEBUG,
"SO3CbScenePreRender\n");
4093 int k = OBJaddreflex(m,
SO3SCENETYPE, SO3_SCENE_PRE_RENDER_EVENT);
4096 MMechostr(MSKDEBUG,
"SO3CbScenePreRender : ok!\n");
4115 MMechostr(MSKDEBUG,
"SO3CbScenePreRenderPhysic\n");
4118 int k = OBJaddreflex(m,
SO3SCENETYPE, SO3_SCENE_PRE_RENDER_PHYSIC_EVENT);
4121 MMechostr(MSKDEBUG,
"SO3CbScenePreRenderPhysic : ok!\n");
4141 MMechostr(MSKDEBUG,
"SO3CbScenePreRender2\n");
4144 int k = OBJaddreflex(m,
SO3SCENETYPE, SO3_SCENE_PRE_RENDER_EVENT2);
4147 MMechostr(MSKDEBUG,
"SO3CbScenePreRender2 : ok!\n");
4166 MMechostr(MSKDEBUG,
"SO3CbScenePostRender\n");
4169 int k = OBJaddreflex(m,
SO3SCENETYPE, SO3_SCENE_POST_RENDER_EVENT);
4172 MMechostr(MSKDEBUG,
"SO3CbScenePostRender : ok!\n");
4180 MMechostr(MSKDEBUG,
"getScenePreRenderEvent\n");
4184 if (!(k = OBJbeginreflex(m,
SO3SCENETYPE,
id, SO3_SCENE_PRE_RENDER_EVENT)))
4186 MMpush(m, ITOM(
static_cast<int>(
param)));
4188 k = OBJcallreflex(m, 1);
4196 MMechostr(MSKDEBUG,
"getScenePreRenderEvent2\n");
4201 if (!(k = OBJbeginreflex(m,
SO3SCENETYPE,
id, SO3_SCENE_PRE_RENDER_EVENT2)))
4203 MMpush(m, ITOM(
static_cast<int>(
param)));
4205 k = OBJcallreflex(m, 1);
4213 MMechostr(MSKDEBUG,
"getScenePostRenderEvent\n");
4218 if (!(k = OBJbeginreflex(m,
SO3SCENETYPE,
id, SO3_SCENE_POST_RENDER_EVENT)))
4220 MMpush(m, ITOM(
static_cast<int>(
param)));
4222 k = OBJcallreflex(m, 1);
4230 MMechostr(MSKDEBUG,
"getScenePreRenderPhysicEvent\n");
4235 if (!(k = OBJbeginreflex(m,
SO3SCENETYPE,
id, SO3_SCENE_PRE_RENDER_PHYSIC_EVENT)))
4237 MMpush(m, ITOM(
static_cast<int>(
param)));
4239 k = OBJcallreflex(m, 1);
4248 MMechostr(MSKDEBUG,
"getObjectLoadedEvent\n");
4252 SEntity* newEntity = (SEntity*)
id;
4255 if (!newEntity || obj == NIL)
4261 if (!(k = OBJbeginreflex(m,
SO3OBJTYPE,
id, SO3_OBJECT_LOADED_EVENT)))
4263 k = OBJcallreflex(m, 0);
4270 {
"SO3CONVERTER_SPLIT_LARGE_MESHES", TYPVAR,
"I", SCOL_TYPTYPE(so3Converter_SplitLargeMeshes)},
4271 {
"SO3CONVERTER_GEN_SMOOTH_NORMALS", TYPVAR,
"I", SCOL_TYPTYPE(so3Converter_GenSmoothNormals)},
4272 {
"SO3CONVERTER_OPTIMIZE_MESHES", TYPVAR,
"I", SCOL_TYPTYPE(so3Converter_OptimizeMeshes)},
4273 {
"SO3CONVERTER_OPTIMIZE_SCENEGRAPH", TYPVAR,
"I", SCOL_TYPTYPE(so3Converter_OptimizeGraph) },
4274 {
"SO3CONVERTER_ROTATE_X", TYPVAR,
"I", SCOL_TYPTYPE(so3Converter_RotateX) },
4275 {
"SO3CONVERTER_GEN_LOD", TYPVAR,
"I", SCOL_TYPTYPE(so3Converter_GenerateLod) },
4276 {
"SO3CONVERTER_OPTIMIZE_TEXTURES", TYPVAR,
"I", SCOL_TYPTYPE(so3Converter_OptimizeTextures)},
4277 {
"SO3CONVERTER_OPTIMIZE_TEXTURES_VERYLOW",TYPVAR,
"I", SCOL_TYPTYPE(so3Converter_OptimizeTextures_VeryLow)},
4278 {
"SO3CONVERTER_OPTIMIZE_TEXTURES_LOW", TYPVAR,
"I", SCOL_TYPTYPE(so3Converter_OptimizeTextures_Low)},
4279 {
"SO3CONVERTER_OPTIMIZE_TEXTURES_MEDIUM", TYPVAR,
"I", SCOL_TYPTYPE(so3Converter_OptimizeTextures_Medium)},
4280 {
"SO3CONVERTER_OPTIMIZE_TEXTURES_HIGH", TYPVAR,
"I", SCOL_TYPTYPE(so3Converter_OptimizeTextures_High)},
4281 {
"SO3CONVERTER_OPTIMIZE_TEXTURES_VERYHIGH",TYPVAR,
"I", SCOL_TYPTYPE(so3Converter_OptimizeTextures_VeryHigh)},
4285 {
"SO3SceneCloneEntity", 3,
"fun [SO3_SCENE S SO3_OBJECT] SO3_OBJECT",
SO3SceneCloneEntity },
4289 {
"SO3SceneCloneAnimTrack", 4,
"fun [SO3_SCENE SO3_OBJECT SO3_ANIM SO3_ANIMTRACK] SO3_ANIMTRACK",
SO3SceneCloneAnimTrack },
4291 {
"SO3SceneCreate", 2,
"fun [Chn S] SO3_SCENE",
SO3SceneCreate },
4294 {
"SO3SceneSetSkyBox", 7,
"fun [SO3_SCENE SO3_MATERIAL F [F F F F] S I I] I",
SO3SceneSetSkyBox },
4297 {
"SO3SceneSetSkyDome", 12,
"fun [SO3_SCENE SO3_MATERIAL F [F F F F] F F I I I S I I] I",
SO3SceneSetSkyDome },
4300 {
"SO3SceneSetSkyPlane", 12,
"fun [SO3_SCENE SO3_MATERIAL F [F F F] F F F I I S I I] I",
SO3SceneSetSkyPlane },
4310 {
"SO3SceneSetFog", 6,
"fun [SO3_SCENE I I F F F] I",
SO3SceneSetFog },
4311 {
"SO3SceneGetNode", 2,
"fun [SO3_SCENE S] SO3_OBJECT",
SO3SceneGetNode },
4320 {
"SO3PlaneCreate", 6,
"fun [SO3_SCENE S S [F F] [I I] [F F]] SO3_OBJECT",
SO3PlaneCreate },
4321 {
"SO3SphereCreate", 6,
"fun [SO3_SCENE S S F I I] SO3_OBJECT",
SO3SphereCreate },
4322 {
"SO3ConeCreate", 6,
"fun [SO3_SCENE S S F F I] SO3_OBJECT",
SO3ConeCreate },
4323 {
"SO3OctahedronCreate", 6,
"fun [SO3_SCENE S S F F F] SO3_OBJECT",
SO3OctahedronCreate },
4324 {
"SO3CbScenePreRender", 3,
"fun [SO3_SCENE fun [SO3_SCENE u0 I] u1 u0] SO3_SCENE",
SO3CbScenePreRender },
4326 {
"SO3CbScenePreRender2", 3,
"fun [SO3_SCENE fun [SO3_SCENE u0 I] u1 u0] SO3_SCENE",
SO3CbScenePreRender2 },
4327 {
"SO3CbScenePostRender", 3,
"fun [SO3_SCENE fun [SO3_SCENE u0 I] u1 u0] SO3_SCENE",
SO3CbScenePostRender },
4332 {
"SO3SceneLoadFile", 5,
"fun [SO3_SCENE S P SO3_OBJECT I] I",
SO3SceneLoadFile },
4334 {
"SO3SceneLoadFileEx", 6,
"fun [SO3_SCENE S P SO3_OBJECT I F] I",
SO3SceneLoadFileEx },
int getScenePostRenderEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
int SCENE_POST_RENDER_EVENT
int getScenePreRenderEvent2(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
int getScenePreRenderEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
int SCENE_PRE_RENDER_EVENT2
int SCOLloadScene(mmachine m, cbmachine w)
Load the SO3Engine Viewport function.
int getScenePreRenderPhysicEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
int SCENE_PRE_RENDER_PHYSIC_EVENT
int SCENE_PRE_RENDER_EVENT
main include
NativeDefinition natSO3Scene[]
int createEntinyAnimationsScol(mmachine m, SEntity *entity)
SRoot * scolRoot
Shared data.
int getObjectLoadedEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
MMechostr(MSKDEBUG, " > Start loading Plugin SO3Engine dll\n")
SCOL_EXPORT int cbmachine w
SCOL_EXPORT void SCOL_PTR_TYPE param
int createAnimTrack(mmachine m, SAnimTrack *curAnimTrack, SAnim *curAnim)
int SO3PHYSICSMATERIALTYPE
int createTexture(mmachine m, STexture *curTexture, SScene *curScene)
int createAnim(mmachine m, SAnim *curAnim, SNode *curNode)
int createOrRetrieveScolMaterialAndSendToVM(mmachine m, SScene *scene, SMaterial *mat)
int createObject(mmachine m, SNode *curNode, SScene *curScene)
int createBone(mmachine m, SNode *curNode, SScene *curScene, SNode *curFather)
static std::string cleanString(std::string str, bool toLower=true, bool clASCII=true, bool clSpaces=true, bool bUID=true)
Clean a string.
Base class for SO3 custom exception.
const char * what() const
int SO3SceneCreateAnimationSequence(mmachine m)
SO3SceneCreateAnimationSequence : Create a Scene Animation sequence.
int SO3SceneConvertFileEx(mmachine m)
SO3SceneConvertFileEx : Convert a file.
int SO3SceneLoadResourceMaterial(mmachine m)
SO3SceneLoadResourceMaterial :Load Resource Material in Scene Deprecated
int SO3SceneGetSkyPlaneParameters(mmachine m)
SO3SceneGetSkyPlaneParameters : function to get the sky plane parameters.
int SO3SceneGetObject(mmachine m)
SO3SceneGetObject : return a scene object by its name.
int SO3SceneGetFogEnd(mmachine m)
SO3SceneGetFogEnd : function to get the fog end of the scene.
int SO3SphereCreate(mmachine m)
SO3SphereCreate : create a sphere as a SO3_OBJECT.
int SO3SceneClear(mmachine m)
SO3SceneClear : clear a scene.
int SO3SceneSetSkyBox(mmachine m)
SO3SceneSetSkyBox : function to set a sky box for a scene.
int SO3OctahedronCreate(mmachine m)
SO3OctahedronCreate : create an octahedron as a SO3_OBJECT.
int SO3CbScenePreRender2(mmachine m)
SO3CbScenePreRender2 : defines callback for pre render event, but after the animations and physics up...
int SO3SceneGetFogMode(mmachine m)
SO3SceneGetFogColor : function to get the fog mode of the scene.
int SO3SceneLoadFile(mmachine m)
SO3SceneLoadFile : create an Entity as a new SO3_Object.
int SO3SceneSetSkyPlane(mmachine m)
SO3SceneSetSkyPlane : function to set a sky plane for a scene.
int SO3SceneGetFogDensity(mmachine m)
SO3SceneGetFogDensity : function to get the fog density of the scene.
int SO3SceneGetAnimation(mmachine m)
SO3SceneGetAnimation : return an animation by its name.
int SO3PlaneCreate(mmachine m)
SO3PlaneCreate : create a plane as a SO3_OBJECT.
int SO3SceneCreate(mmachine m)
SO3SceneCreate : Create a new scene.
int SO3SceneGetTexture(mmachine m)
SO3SceneGetTexture : Return a texture by its name.
int SO3SceneParseMaterialsFromGroup(mmachine m)
SO3SceneParseMaterialsFromGroup : Return the list of materials from a group name.
int SO3SceneGetAmbientLight(mmachine m)
SO3SceneGetAmbientLight : function to get the ambient light of the scene.
int SO3SceneParseParticleSystemsFromGroup(mmachine m)
SO3SceneParseParticleSystemsFromGroup : Return the list of particle systems from a group name.
int SO3SceneParseCompositorsFromGroup(mmachine m)
SO3SceneParseCompositorsFromGroup : Return the list of compositors from a group name.
int SO3SceneLoadResource(mmachine m)
SO3SceneLoadResource : Load a resource in Scene.
int SO3SceneNodeCreate(mmachine m)
SO3SceneNodeCreate : Create a new node.
int SO3SceneGetNumAnimations(mmachine m)
SO3SceneGetNumAnimations : return an animation by its name.
int SO3SceneGetSkyDomeParameters(mmachine m)
SO3SceneGetSkyDomeParameters : function to get the sky dome parameters.
int SO3SceneSetAmbientLight(mmachine m)
SO3SceneSetAmbientLight : function to defines ambient light of the scene.
int SO3SceneGetAnimations(mmachine m)
SO3SceneGetAnimations : Return the list of animations on a scene.
int SO3ConeCreate(mmachine m)
SO3ConeCreate : create a cone as a SO3_OBJECT.
int SO3CbScenePreRenderPhysic(mmachine m)
SO3CbScenePreRenderPhysic : defines callback for pre render event, but after the animations and befor...
int SO3SceneLoadFileEx(mmachine m)
SO3SceneLoadFileEx : create an Entity as a new SO3_Object.
int SO3SceneCloneAnimation(mmachine m)
SO3SceneCloneAnimation : Clone a SO3_ANIM in Scene.
int SO3SceneCloneAnimTrack(mmachine m)
SO3SceneCloneAnimTrack : Clone a SO3_ANIMTRACK in Scene on a given SO3_ANIM DEPRECATED FUNCTION Proto...
int SO3SceneLoadEntity(mmachine m)
SO3SceneLoadEntity : create an Entity as a new SO3_Object.
int SO3CbScenePostRender(mmachine m)
SO3CbScenePostRender : defines callback for post render event.
int SO3SceneGetFogStart(mmachine m)
SO3SceneGetFogStart : function to get the fog start of the scene.
int SO3SceneSetFog(mmachine m)
SO3SceneSetFog : function to defines fog properties of the scene.
int SO3SceneSetMaterialsPointSize(mmachine m)
SO3SceneSetMaterialsPointSize : Set all scene materials point cloud size.
int SO3SceneGetMaterial(mmachine m)
SO3SceneGetMaterial : Return a material by its name.
int SO3SceneGetFogColor(mmachine m)
SO3SceneGetFogColor : function to get the fog color of the scene.
int SO3SceneCloneEntity(mmachine m)
SO3SceneCloneEntity : clone an Entity as a new SO3_Object.
int SO3SceneConvertFile(mmachine m)
SO3SceneConvertFile : Convert a file.
int SO3SceneSetSkyDomeEnable(mmachine m)
SO3SceneSetSkyDomeEnable : function to defines visiblity state for a sky dome.
int SO3SceneLoadEntityInBackground(mmachine m)
SO3SceneLoadEntityInBackground : create an Entity as a new SO3_Object.
int SO3SceneSetSkyDome(mmachine m)
SO3SceneSetSkyDome : function to set a sky dome for a scene.
int SO3SceneUnloadResource(mmachine m)
SO3SceneUnloadResource : Unload a resource from Scene TODO!
int SO3CbScenePreRender(mmachine m)
SO3CbScenePreRender : defines callback for pre render event.
int SO3SceneSetSkyBoxEnable(mmachine m)
SO3SceneSetSkyBox : function to defines visiblity state for a sky box.
int SO3SceneDelete(mmachine m)
SO3SceneDelete : destroy a scene.
int SO3SceneParseSchemeFromGroup(mmachine m)
SO3SceneParseSchemeFromGroup : Return the list of material scheme from a group name.
int SO3SceneGetNode(mmachine m)
SO3SceneGetNode : return a scene node by its name.
int SO3SceneLoadEntityByResourceName(mmachine m)
SO3SceneLoadEntityByResourceName : create an Entity as a new SO3_Object.
int SO3SceneSetSkyPlaneEnable(mmachine m)
SO3SceneSetSkyPlaneEnable : function to defines visiblity state for a sky plane.
int SO3SceneGetSkyBoxParameters(mmachine m)
SO3SceneGetSkyBoxParameters : function to get the sky box parameters.
STBI_EXTERN unsigned long flags