Exemplo n.º 1
0
    private void DisplayBPMBlock() //Take Block from Bin and Place it Above The Bin to show what is currently playing
    {
        BeatBlockMass = RigidBody.GetMass();
        CurPos        = RigidBody.GetPosition();
        RigidBody.SetMass(0.0f);
        float  XDisplayPos = 1.0f;
        float  YDisplayPos = 0.7f;
        float  ZDisplayPos = 2.2f;
        Vector DisplayPos  = new Vector(XDisplayPos, YDisplayPos, ZDisplayPos);

        RigidBody.SetPosition(DisplayPos);
        RigidBody.SetOrientation(RotQuat);
        RigidBody.SetMass(BeatBlockMass);
    }
Exemplo n.º 2
0
    private void ReturnBeatBlock()  //Returns playing beat block from Display above Bin to 1st Floor Rack
    {
        //Take Block from Bin and Return it to Beat Box Staging Area
        BeatBlockMass = RigidBody.GetMass();
        CurPos        = RigidBody.GetPosition();
        RigidBody.SetMass(0.0f);
        //     float floorZPosition = 0.0f;
        //     switch (newFloor)
        //     {
        //         case "1":
        //             floorZPosition = ZWarehousePos - 3.0f;
        //             break;
        //         case "2":
        //             floorZPosition = ZWarehousePos - 6.0f;
        //             break;
        //         case "3":
        //             floorZPosition = ZWarehousePos - 9.0f;
        //             break;
        //         case "4":
        //             floorZPosition = ZWarehousePos - 12.0f;
        //             break;
        //         case "5":
        //             floorZPosition = ZWarehousePos - 15.0f;
        //             break;
        //         case "6":
        //             floorZPosition = ZWarehousePos - 18.0f;
        //             break;
        //         case "7":
        //             floorZPosition = ZWarehousePos - 21.0f;
        //             break;
        //         case "8":
        //             floorZPosition = ZWarehousePos - 24.0f;
        //             break;
        //         case "9":
        //             floorZPosition = ZWarehousePos - 27.0f;
        //             break;
        //         default:
        //             ScenePrivate.Chat.MessageAllUsers("Not a valid floor in Sample Warehouse");
        //             break;
        //     }
        RigidBody.SetPosition(CurPos - OffsetPos);
        //Take Block from Bin and Return it to Beat Box Staging Area
        //CurPos = RigidBody.GetPosition();
        Vector WarehousePos = new Vector(XWarehousePos, YWarehousePos, ZWarehousePos);

        RigidBody.SetPosition(WarehousePos);
        RigidBody.SetOrientation(RotQuat);
        RigidBody.SetMass(BeatBlockMass);
        hitDetected = false;
    }
    private void ReturnBeatBlock()
    {
        //Take Block from Bin and Return it to Beat Box Staging Area
        BeatBlockMass = RigidBody.GetMass();
        CurPos        = RigidBody.GetPosition();
        RigidBody.SetMass(0.0f);
        RigidBody.SetPosition(CurPos - OffsetPos);
        //Take Block from Bin and Return it to Beat Box Staging Area
        CurPos = RigidBody.GetPosition();
        Vector WarehousePos = new Vector(XWarehousePos, YWarehousePos, ZWarehousePos);

        RigidBody.SetPosition(WarehousePos);
        RigidBody.SetOrientation(RotQuat);
        RigidBody.SetMass(BeatBlockMass);
    }
Exemplo n.º 4
0
    private void getStartedRaver(ScriptEventData gotRaverStarted)
    {
        if (gotRaverStarted.Data == null)
        {
            return;
        }
        SendStartedRaver sendStartedRaver = gotRaverStarted.Data.AsInterface <SendStartedRaver>();

        if (sendStartedRaver == null)
        {
            Log.Write(LogLevel.Error, Script.ID.ToString(), "Unable to create interface, check logs for missing member(s)");
            return;
        }
        //Log.Write("sendStartedRaver.SetRaverStart[0] : " + sendStartedRaver.SetRaverStart[0]);
        //Log.Write("OnOrOffBlock: " + OnOrOffBlock);
        if (sendStartedRaver.SetRaverStart[0] == "on")
        {
            if (OnOrOffBlock == "off")
            {
                //move off block below stage
                RigidBody.SetMass(0.0f);
                RigidBody.SetPosition(HideOffPos);
                RigidBody.SetMass(SignMass);
            }
            else if (OnOrOffBlock == "on")
            {
                //move on block above start volume
                Wait(TimeSpan.FromSeconds(0.1));
                RigidBody.SetMass(0.0f);
                RigidBody.SetPosition(DisplayPos);
                RigidBody.SetMass(SignMass);
            }
        }
        else if (sendStartedRaver.SetRaverStart[0] == "off")
        {
            if (OnOrOffBlock == "on")
            {
                //move on block below stage
                Wait(TimeSpan.FromSeconds(0.1));
                RigidBody.SetMass(0.0f);
                RigidBody.SetPosition(HideOnPos);
                RigidBody.SetMass(SignMass);
            }
            else if (OnOrOffBlock == "off")
            {
                //move off block above start volume
                RigidBody.SetMass(0.0f);
                RigidBody.SetPosition(DisplayPos);
                RigidBody.SetMass(SignMass);
            }
        }
    }
Exemplo n.º 5
0
 public override void Init()
 {
     if (RigidBody == null)
     {
         if (!ObjectPrivate.TryGetFirstComponent(out RigidBody))
         {
             return;
         }
     }
     lightPositionOffset = new Sansar.Vector(0, 0, 2);
     startRot            = RigidBody.GetOrientation();
     //we want this to float
     RigidBody.SetMass(0);
     //the default light when you add it is off by -90 degrees
     lightOnObjectDirection = Quaternion.FromEulerAngles(new Sansar.Vector(0, 0, (float)(Math.PI / -2.0), 0));
     StartCoroutine(UpdateLoop);
 }
Exemplo n.º 6
0
    private void GetChatCommand(ChatData Data)
    {
        string DataCmd = Data.Message;

        //Log.Write("DataCmd: " + DataCmd);
        if (SubscribeToScriptEvent("SendScreenPos", getScreenPos).Active)
        {
            Log.Write("Subscription Was Active from getChatCommmand");
        }
        else
        {
            Log.Write("Subscription Was NOT Active from getChatCommmand");
        }
        if ((DataCmd.Substring(0, 1) == "/") && (DataCmd.Length > 1))
        {
            string testSlide = DataCmd.Substring(0, 2);  //it was a slide command
            Log.Write("testSlide: " + testSlide);
            if ((testSlide == "/0") || (testSlide == "/1") || (testSlide == "/2") || (testSlide == "/3") || (testSlide == "/4") || (testSlide == "/5") || (testSlide == "/6") || (testSlide == "/7") || (testSlide == "/8") || (testSlide == "/9"))
            {
                int from = DataCmd.IndexOf("/", StringComparison.CurrentCulture);
                Log.Write("from: " + from);
                //Log.Write("length: " + DataCmd.Length);
                string test = DataCmd.Substring(from + 1, DataCmd.Length - 1);
                Log.Write("test: " + test);
                if (test == SlideNumber)
                {
                    //Take Block from Bin and Return it to Beat Box Staging Area
                    //RigidBody.SetMotionType(RigidBodyMotionType.MotionTypeDynamic);
                    Wait(TimeSpan.FromMilliseconds(200));
                    //Log.Write("Slide: " + SlideNumber + "  Moving to Screen");
                    //SlideMass = RigidBody.GetMass();
                    CurPos = RigidBody.GetPosition();
                    //Log.Write("Slide: " + SlideNumber + "  CurPos: " + CurPos);
                    //RigidBody.SetMass(0.0f);
                    //Log.Write("Slide: " + SlideNumber + "  ScreenPos: " + ScreenPos);
                    RigidBody.SetPosition(ScreenPos);

                    //Take Block from Bin and Return it to Beat Box Staging Area
                    RigidBody.SetOrientation(ScreenQuat);
                    //Log.Write("Slide: " + SlideNumber + "  ScreenRot: " + ScreenQuat);

                    Wait(TimeSpan.FromMilliseconds(200));
                    //RigidBody.SetMotionType(RigidBodyMotionType.MotionTypeStatic);
                    //RigidBody.SetMass(SlideMass);
                }
                else if ((testSlide == "/0") || (testSlide == "/1") || (testSlide == "/2") || (testSlide == "/3") || (testSlide == "/4") || (testSlide == "/5") || (testSlide == "/6") || (testSlide == "/7") || (testSlide == "/8") || (testSlide == "/9"))
                {
                    Log.Write("Slide: " + SlideNumber + "  Moving to Storage");
                    //RigidBody.SetMotionType(RigidBodyMotionType.MotionTypeDynamic);
                    Wait(TimeSpan.FromMilliseconds(200));
                    //CurPos = RigidBody.GetPosition();
                    RigidBody.SetMass(0.0f);
                    //Take Block from Bin and Return it to Beat Box Staging Area
                    //CurPos = RigidBody.GetPosition();
                    RigidBody.SetPosition(CurPos);
                    //CurQuat = Quaternion.FromEulerAngles(CurRot).Normalized();
                    RigidBody.SetOrientation(CurQuat);

                    //Wait(TimeSpan.FromMilliseconds(200));
                    //RigidBody.SetMotionType(RigidBodyMotionType.MotionTypeStatic);
                    RigidBody.SetMass(SlideMass);
                }
            }
        }
    }