[Opensim-users] Change axis point

Americo Damasceno adamascj at gmail.com
Tue Nov 10 10:48:34 UTC 2009


You don't need to change any axis to do  a pivoting door. You need to create
two parts of the door. The first will have only the dimensions to be the
"axis".The second will be the "real" door. Linking this one with the first,
you can add this script to the object:

 integer open;
 rotation rotActual ;
 rotation rot ;
 vector iniPos;

 default{

 state_entry(){

   iniPos=llGetPos();

   if(iniPos.y<140){ // y of the door closed
     open = 0;
   }
  else open=1;

 }
 touch_start(integer i){
   if(open==0){

   rotActual = llGetRot();
   rot = llEuler2Rot(<0,0,-90>*DEG_TO_RAD);
   llSetRot(rotActual*rot);
   llSetPos(llGetPos());
   open=1;
   iniPos=llGetPos();

 }
  else{

  rotActual = llGetRot();
   rot = llEuler2Rot(<0,0, 90>*DEG_TO_RAD);
  llSetRot(rotActual*rot);
   llSetPos(llGetPos());
  open=0;
  iniPos=llGetPos();
   //llOwnerSay((string)iniPos.y);
  }
 }
}

You can see this solution working on my sim at  http://200.207.267.61:9000,
using the userID: Guest One, pw:123456
There are some other scripts there.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-users/attachments/20091110/c4dd67ad/attachment.html>


More information about the Opensim-users mailing list