private void getScreenPos(ScriptEventData gotScreenPos) { Log.Write("SCREEN EVENT RECIEVED"); Log.Write("In getScreenPos"); if (gotScreenPos.Data == null) { return; } SendScreenPos sendScreenPos = gotScreenPos.Data.AsInterface <SendScreenPos>(); if (sendScreenPos == null) { Log.Write(LogLevel.Error, Script.ID.ToString(), "Unable to create interface, check logs for missing member(s)"); return; } XScreenPos = float.Parse(sendScreenPos.SetScreenPos[0]); Log.Write("XScreenPos: " + XScreenPos); YScreenPos = float.Parse(sendScreenPos.SetScreenPos[1]); ZScreenPos = float.Parse(sendScreenPos.SetScreenPos[2]); XScreenRot = float.Parse(sendScreenPos.SetScreenPos[3]); YScreenRot = float.Parse(sendScreenPos.SetScreenPos[4]); ZScreenRot = float.Parse(sendScreenPos.SetScreenPos[5]); ScreenPos = new Vector(XScreenPos, YScreenPos, ZScreenPos); Vector ScreenRot = new Vector(XScreenRot * pi / 180, YScreenRot * pi / 180, ZScreenRot * pi / 180); ScreenQuat = Quaternion.FromEulerAngles(ScreenRot).Normalized(); CurQuat = RigidBody.GetOrientation(); CurPos = RigidBody.GetPosition(); SlideMass = RigidBody.GetMass(); }
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); }
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; }
public override void Init() { if (RigidBody == null) { if (!ObjectPrivate.TryGetFirstComponent(out RigidBody)) { // Since object scripts are initialized when the scene loads, no one will actually see this message. ScenePrivate.Chat.MessageAllUsers("There is no RigidBodyComponent attached to this object."); return; } } SignMass = RigidBody.GetMass(); SubscribeToScriptEvent("RaverStarted", getStartedRaver); }
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); }