I am new in CS and CEL;
I have used 3ds max to build a simple world which includes two sectors and a portal, and i have used portal to connect the two sectors so the actor can go through from one sector to another by portal . Now I want to change this portal to mirror using C++, but I don't know how to do it ? Can you help me ?!
And in Cel's tutorial "walktut", if i want to get " iportal" interface how can i do ? Which function can i use?
Thank you very much!!
To set up in a mirror in C++ you can use iPortal->SetMirror() function. Check the API documentation for more information.
To get the reference to an iPortal you first have to find the portal. Portals are mesh objects like any other and they have names. So you can do iEngine->FindMeshObject() to find the mesh that represents the portal container. That will give you a mesh that contains the portals. Usually such a mesh contains only one portal (that depends on how the level is constructed). So you can do:
iMeshWrapper* portal_mesh = engine->FindMeshObject("portal_mesh_name");
csRef<iPortalContainer> portal_container = scfQueryInterface<iPortalContainer> (portal_mesh->GetMeshObject ());
// Assuming we only have one portal we get the one with index 0:
iPortal* portal = portal_container->GetPortal (0);
Hope this helps,