Presumably two corresponding portals are not actually linked to each other;
each of their warp transforms just happens to point to the other's
position. So it is possible to connect a portal to a position where there
is no corresponding portal, to create a "one-way" portal, or to have a
corresponding portal point somewhere else entirely, for all sorts of
confusing game mechanics. :)

I don't know, but I would try something like this:

portal1->SetWarp(csMatrix3(), movable1->GetFullPosition(),
movable2->GetFullPosition());
portal2->SetWarp(csMatrix3(), movable2->GetFullPosition(),
movable1->GetFullPosition());

And if the portals are differently oriented to each other:

csMatrix3 portal1toportal2 (movable2->GetFullTransform()->GetO2T() *
movable1->GetFullTransform()->GetT2O());
csMatrix3 portal2toportal1 (portal1toportal2.GetInverse());
portal1->SetWarp(portal1toportal2, movable1->GetFullPosition(),
movable2->GetFullPosition());
portal2->SetWarp(portal2toportal1, movable2->GetFullPosition(),
movable1->GetFullPosition());

Let us know when you get a "hall of mirrors" effect working. :)


On 18 August 2012 15:53, Austin Bonander <[email protected]> wrote:

> In continuation from my _Portal_ game discussion, I'd like to ask an
> actually relevant question now:
>
> Can someone give me an example of how to connect two portals at runtime?
> In this case, the portals would already be created in their own sectors,
> and would only need to be connected to each other. All I can find is
> iPortal :: SetSector (iSector* s). But that only points it to another
> sector...? How are two specific portals connected then?
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Crystal-main mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/crystal-main
> Unsubscribe: mailto:[email protected]
> ?subject=unsubscribe
>
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: 
mailto:[email protected]?subject=unsubscribe

Reply via email to