About Store Forum Documentation Contact
Donations:
206$/mo



Post Reply 
Open a door
Author Message
DoerrSt Offline
Member

Post: #1
Open a door
Hi,

I am trying to programmatically open a door. I saw there is an object in the engine but the specific tutorial referred here in the board looks removed in Esenthel 2.0.

So I tried to do this at my own but in all tries I had the final rotation looks different (perhaps of different framerates?).

First I verfied that the door is open with:

Quote: Matrix m = T.matrix();
m.orn().rotateY(80);
T.matrix(m);

Now I tried this in the update()-Function:

Code:
if(isMoving)
      {
        float ti = 1*Time.ad();    
        Matrix m = T.matrix();      
        m.orn().rotateY(ti);
        T.matrix(m);
        cY+=Abs(ti);
         if(cY>=80) isMoving=false;
      }

I would expect that cY is 80 if the door has the correct rotation. But it continues to rotate much, much longer. The value where the door is open is here cY ~ 1.50 (a bit too far)

Does anyone has an idea what's wrong here - a sample code is highly appreciated? And does the tutorial for doors exist and I just didn't find it?

Thanks,



Stefan
02-16-2014 01:04 AM
Find all posts by this user Quote this message in a reply
xzessmedia Offline
Member

Post: #2
RE: Open a door
hi,

you will save yourself much time if you spent those few bucks for the tutorials you are interested in..
i know most stuff you are looking for is described inside the ineisis code.

maybe you are trying it for learing purpose, but you can simply use
Code:
// manipulate
   virtual void open  (); // open   door
   virtual void close (); // close  door
   virtual void toggle(); // toggle door
..if you didn't know.

another question would be if you are trying it with a custom door mesh or the distributed one.
02-16-2014 04:12 AM
Find all posts by this user Quote this message in a reply
DoerrSt Offline
Member

Post: #3
RE: Open a door
Hi,

I bought yesterday the rpg 2 to have an tutorial after I saw a compile error in door.cpp posted here. So I expected the rpg includes the code I need. Unfortunately the only door in the rpg beams you to the dungeon and the doors of the buildings don't open at all..

Perhaps I will buy the ineisis code later today.

I want to try this with a custom door model.
02-16-2014 09:21 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #4
RE: Open a door
Hi, the angle units are in Radians.
02-18-2014 12:44 AM
Find all posts by this user Quote this message in a reply
DoerrSt Offline
Member

Post: #5
RE: Open a door
Thanks. Bought two demo projects now (RPG & Ineisis) and everything is now more clear to me. Both projects are really a valuable source to learn how to handle the engine.
02-18-2014 07:34 PM
Find all posts by this user Quote this message in a reply
Post Reply