home *** CD-ROM | disk | FTP | other *** search
- import vrml.Event;
- import vrml.field.ConstSFBool;
- import vrml.field.ConstSFString;
- import vrml.field.ConstSFTime;
- import vrml.field.MFColor;
- import vrml.field.SFBool;
- import vrml.field.SFColor;
- import vrml.field.SFInt32;
- import vrml.field.SFNode;
- import vrml.field.SFRotation;
- import vrml.field.SFTime;
- import vrml.field.SFVec3f;
- import vrml.node.Script;
- import vs.Vscp;
-
- public class circus extends Script {
- // $FF: renamed from: X int
- static int field_0;
- // $FF: renamed from: Y int
- static int field_1 = 1;
- // $FF: renamed from: Z int
- static int field_2 = 2;
- static int DEGREE = 3;
- // $FF: renamed from: R int
- static int field_3;
- // $FF: renamed from: G int
- static int field_4 = 1;
- // $FF: renamed from: B int
- static int field_5 = 2;
- float Radian = (180F / (float)Math.PI);
- SFNode WorldNode;
- SFBool WorldTimer;
- MFColor WorldSkyCol;
- SFInt32 WorldLightSwitch;
- SFRotation AirShipRot;
- SFColor FerrisRideCol;
- SFVec3f FerrisRidePos;
- SFVec3f FerrisExitPos;
- SFVec3f FerrisWheelPos;
- SFRotation FerrisWheelRot;
- SFVec3f GondolaFloorPos;
- SFVec3f GondolaFencePos;
- SFTime GondolaSound_start;
- SFTime GondolaSound_stop;
- SFRotation[] GondolaRot = new SFRotation[10];
- SFVec3f[] GondolaPos = new SFVec3f[10];
- SFBool GondolaViewBind;
- SFRotation GondolaViewRot;
- SFRotation ParadeStageRot;
- SFVec3f ParadeSoundPos;
- SFTime ParadeSound_start;
- SFTime ParadeSound_stop;
- SFBool Piero1Sw;
- SFTime Piero1StartTime;
- SFTime Piero1StopTime;
- SFVec3f Piero1Pos;
- SFRotation Piero1Rot;
- SFVec3f AccordionPos;
- SFVec3f Accordion1Pos;
- SFVec3f Accordion2Pos;
- SFRotation AccordionRot;
- SFBool Piero2Sw;
- SFTime Piero2StartTime;
- SFTime Piero2StopTime;
- SFVec3f Piero2Pos;
- SFRotation Piero2Rot;
- SFVec3f BarrelPos;
- SFRotation BarrelRot;
- SFBool Piero3Sw;
- SFTime Piero3StartTime;
- SFTime Piero3StopTime;
- SFVec3f Piero3Pos;
- SFRotation Piero3Rot;
- SFBool KumaSw;
- SFTime KumaStartTime;
- SFTime KumaStopTime;
- SFVec3f KumaPos;
- SFRotation KumaRot;
- SFBool KumaBicycleSw;
- SFBool AshikaSw;
- SFTime AshikaStartTime;
- SFTime AshikaStopTime;
- SFVec3f AshikaPos;
- SFRotation AshikaRot;
- SFBool AshikaBallSw;
- SFVec3f AshikaBallPos;
- SFRotation AshikaBallRot;
- SFTime AshikaSound_start;
- SFTime AshikaSound_stop;
- boolean WorldConstructorInvoked = false;
- int WorldSkyFlg;
- int ParadeFlg;
- int CurrentTime = 60;
- int EclipseCnt;
- int sunriseStartTime = 60;
- int sunriseMidStartTime = 70;
- int sunriseMidEndTime = 70;
- int sunriseEndTime = 120;
- int sunsetStartTime = 240;
- int sunsetMidStartTime = 250;
- int sunsetMidEndTime = 250;
- int sunsetEndTime = 300;
- float nightColorR = 0.1F;
- float nightColorG = 0.1F;
- float nightColorB = 0.35F;
- float sunriseColorR = 0.6F;
- float sunriseColorG = 0.1F;
- float sunriseColorB = 0.08F;
- float daylightColorR = 0.44F;
- float daylightColorG = 0.49F;
- float daylightColorB = 1.0F;
- float sunsetColorR = 0.6F;
- float sunsetColorG = 0.1F;
- float sunsetColorB = 0.08F;
- int IllumiNo;
- int IllumiCnt;
- float IllumiR = 1.0F;
- float IllumiG = 1.0F;
- float IllumiB = 1.0F;
- boolean FerrisRideColorSw = true;
- float FerrisWheelR = 22.5F;
- float FerrisWheelY = 28.5F;
- float FerrisRotateAngle;
- int RideGondolaNum;
- int RidePerson;
- int RideSeat;
- boolean Piero1MoveFlg = false;
- boolean Piero2MoveFlg = false;
- boolean Piero3MoveFlg = false;
- int Piero1Cnt;
- int Piero2Cnt;
- int Piero3Cnt;
- int Piero2Dir;
- float Piero2PosZ;
- float Piero2RotD;
- boolean AshikaMoveFlg = false;
- int AshikaCnt;
- int AshikaMode;
- float AshikaBallRotX;
- float AshikaBallRotZ;
- float[][] AshikaBallData1 = new float[][]{{38.4F, 0.4F}, {38.1F, 0.9F}, {37.8F, 1.25F}, {37.5F, 1.5F}, {37.2F, 1.6F}, {36.9F, 1.8F}, {36.6F, 1.9F}, {36.3F, 1.9F}, {36.0F, 1.8F}, {35.7F, 1.6F}};
- float[] AshikaBallData2 = new float[]{1.6F, 1.7F, 1.8F, 1.9F, 2.0F, 2.0F, 1.9F, 1.8F, 1.7F, 1.6F};
- boolean KumaMoveFlg = false;
- float KumaAng;
- int KumaCnt;
-
- public void initialize() {
- this.WorldNode = (SFNode)((Script)this).getField("WorldNode");
- this.WorldTimer = (SFBool)((Script)this).getEventOut("WorldTimer_enabled");
- this.WorldSkyCol = (MFColor)((Script)this).getEventOut("WorldSky_color");
- this.WorldLightSwitch = (SFInt32)((Script)this).getEventOut("WorldLight_switch");
- this.AirShipRot = (SFRotation)((Script)this).getEventOut("Airship_rotation");
- this.FerrisRideCol = (SFColor)((Script)this).getEventOut("FerrisRide_color");
- this.FerrisRidePos = (SFVec3f)((Script)this).getEventOut("FerrisRide_position");
- this.FerrisExitPos = (SFVec3f)((Script)this).getEventOut("FerrisExit_position");
- this.FerrisWheelPos = (SFVec3f)((Script)this).getEventOut("FerrisWheel_position");
- this.FerrisWheelRot = (SFRotation)((Script)this).getEventOut("FerrisWheel_rotation");
- this.GondolaFloorPos = (SFVec3f)((Script)this).getEventOut("GondolaFloor_position");
- this.GondolaFencePos = (SFVec3f)((Script)this).getEventOut("GondolaFence_position");
- this.GondolaSound_start = (SFTime)((Script)this).getEventOut("GondolaSound_start");
- this.GondolaSound_stop = (SFTime)((Script)this).getEventOut("GondolaSound_stop");
- this.GondolaViewBind = (SFBool)((Script)this).getEventOut("GondolaView_bind");
- this.GondolaViewRot = (SFRotation)((Script)this).getEventOut("GondolaView_rotation");
- this.ParadeStageRot = (SFRotation)((Script)this).getEventOut("ParadeStage_rotation");
- this.ParadeSoundPos = (SFVec3f)((Script)this).getEventOut("ParadeSound_position");
- this.ParadeSound_start = (SFTime)((Script)this).getEventOut("ParadeSound_start");
- this.ParadeSound_stop = (SFTime)((Script)this).getEventOut("ParadeSound_stop");
- this.Piero1Sw = (SFBool)((Script)this).getEventOut("Piero1_sw");
- this.Piero1StartTime = (SFTime)((Script)this).getEventOut("Piero1_start");
- this.Piero1StopTime = (SFTime)((Script)this).getEventOut("Piero1_stop");
- this.Piero1Pos = (SFVec3f)((Script)this).getEventOut("Piero1_position");
- this.Piero1Rot = (SFRotation)((Script)this).getEventOut("Piero1_rotation");
- this.AccordionPos = (SFVec3f)((Script)this).getEventOut("Piero1Accordion_position");
- this.Accordion1Pos = (SFVec3f)((Script)this).getEventOut("Piero1Accordion1_position");
- this.Accordion2Pos = (SFVec3f)((Script)this).getEventOut("Piero1Accordion2_position");
- this.AccordionRot = (SFRotation)((Script)this).getEventOut("Piero1Accordion_rotation");
- this.Piero2Sw = (SFBool)((Script)this).getEventOut("Piero2_sw");
- this.Piero2StartTime = (SFTime)((Script)this).getEventOut("Piero2_start");
- this.Piero2StopTime = (SFTime)((Script)this).getEventOut("Piero2_stop");
- this.Piero2Pos = (SFVec3f)((Script)this).getEventOut("Piero2_position");
- this.Piero2Rot = (SFRotation)((Script)this).getEventOut("Piero2_rotation");
- this.BarrelPos = (SFVec3f)((Script)this).getEventOut("Piero2Barrel_position");
- this.BarrelRot = (SFRotation)((Script)this).getEventOut("Piero2Barrel_rotation");
- this.Piero3Sw = (SFBool)((Script)this).getEventOut("Piero3_sw");
- this.Piero3StartTime = (SFTime)((Script)this).getEventOut("Piero3_start");
- this.Piero3StopTime = (SFTime)((Script)this).getEventOut("Piero3_stop");
- this.Piero3Pos = (SFVec3f)((Script)this).getEventOut("Piero3_position");
- this.Piero3Rot = (SFRotation)((Script)this).getEventOut("Piero3_rotation");
- this.KumaSw = (SFBool)((Script)this).getEventOut("Kuma_sw");
- this.KumaStartTime = (SFTime)((Script)this).getEventOut("Kuma_start");
- this.KumaStopTime = (SFTime)((Script)this).getEventOut("Kuma_stop");
- this.KumaPos = (SFVec3f)((Script)this).getEventOut("Kuma_position");
- this.KumaRot = (SFRotation)((Script)this).getEventOut("Kuma_rotation");
- this.KumaBicycleSw = (SFBool)((Script)this).getEventOut("Kuma_bicycle_sw");
- this.AshikaSw = (SFBool)((Script)this).getEventOut("Ashika_sw");
- this.AshikaStartTime = (SFTime)((Script)this).getEventOut("Ashika_start");
- this.AshikaStopTime = (SFTime)((Script)this).getEventOut("Ashika_stop");
- this.AshikaPos = (SFVec3f)((Script)this).getEventOut("Ashika_position");
- this.AshikaRot = (SFRotation)((Script)this).getEventOut("Ashika_rotation");
- this.AshikaBallSw = (SFBool)((Script)this).getEventOut("AshikaBall_sw");
- this.AshikaBallPos = (SFVec3f)((Script)this).getEventOut("AshikaBall_position");
- this.AshikaBallRot = (SFRotation)((Script)this).getEventOut("AshikaBall_rotation");
- this.AshikaSound_start = (SFTime)((Script)this).getEventOut("AshikaSound_start");
- this.AshikaSound_stop = (SFTime)((Script)this).getEventOut("AshikaSound_stop");
- }
-
- public void processEvent(Event var1) {
- String var2 = var1.getName();
- double var3 = var1.getTimeStamp();
- if (var2.equals("WorldMove")) {
- this.WorldMove((ConstSFTime)var1.getValue(), var3);
- } else if (var2.equals("WorldSync")) {
- this.WorldSync((ConstSFString)var1.getValue(), var3);
- } else if (var2.equals("ShareFerrisRotate")) {
- this.ShareFerrisRotate((ConstSFString)var1.getValue(), var3);
- } else if (var2.equals("ShareRidePerson")) {
- this.ShareRidePerson((ConstSFString)var1.getValue(), var3);
- } else if (var2.equals("ShareCurrentTime")) {
- this.ShareCurrentTime((ConstSFString)var1.getValue(), var3);
- } else if (var2.equals("FerrisRide")) {
- this.FerrisRide((ConstSFString)var1.getValue(), var3);
- } else if (var2.equals("EclipsePick")) {
- this.EclipsePick((ConstSFBool)var1.getValue(), var3);
- } else if (var2.equals("EclipsePickShare")) {
- this.EclipsePickShare((ConstSFString)var1.getValue(), var3);
- } else if (var2.equals("FerrisRidePick")) {
- this.FerrisRidePick((ConstSFBool)var1.getValue(), var3);
- } else if (var2.equals("FerrisExitPick")) {
- this.FerrisExitPick((ConstSFBool)var1.getValue(), var3);
- } else if (var2.equals("Piero1PickShare")) {
- this.Piero1PickShare((ConstSFString)var1.getValue(), var3);
- } else if (var2.equals("Piero1Pick")) {
- this.Piero1Pick((ConstSFBool)var1.getValue(), var3);
- } else if (var2.equals("Piero2PickShare")) {
- this.Piero2PickShare((ConstSFString)var1.getValue(), var3);
- } else if (var2.equals("Piero2Pick")) {
- this.Piero2Pick((ConstSFBool)var1.getValue(), var3);
- } else if (var2.equals("Piero3PickShare")) {
- this.Piero3PickShare((ConstSFString)var1.getValue(), var3);
- } else if (var2.equals("Piero3Pick")) {
- this.Piero3Pick((ConstSFBool)var1.getValue(), var3);
- } else if (var2.equals("AshikaPickShare")) {
- this.AshikaPickShare((ConstSFString)var1.getValue(), var3);
- } else if (var2.equals("AshikaPick")) {
- this.AshikaPick((ConstSFBool)var1.getValue(), var3);
- } else if (var2.equals("AshikaBallMove")) {
- this.AshikaBallMove((ConstSFTime)var1.getValue(), var3);
- } else if (var2.equals("AshikaBallPickShare")) {
- this.AshikaBallPickShare((ConstSFString)var1.getValue(), var3);
- } else if (var2.equals("AshikaBallPick")) {
- this.AshikaBallPick((ConstSFBool)var1.getValue(), var3);
- } else if (var2.equals("KumaPickShare")) {
- this.KumaPickShare((ConstSFString)var1.getValue(), var3);
- } else if (var2.equals("KumaPick")) {
- this.KumaPick((ConstSFBool)var1.getValue(), var3);
- } else {
- if (var2.equals("KumaBicycleMove")) {
- this.KumaBicycleMove((ConstSFTime)var1.getValue(), var3);
- }
-
- }
- }
-
- void world_constructor(double var1) {
- this.GondolaRot[0] = (SFRotation)((Script)this).getEventOut("Gondola0_rotation");
- this.GondolaRot[1] = (SFRotation)((Script)this).getEventOut("Gondola1_rotation");
- this.GondolaRot[2] = (SFRotation)((Script)this).getEventOut("Gondola2_rotation");
- this.GondolaRot[3] = (SFRotation)((Script)this).getEventOut("Gondola3_rotation");
- this.GondolaRot[4] = (SFRotation)((Script)this).getEventOut("Gondola4_rotation");
- this.GondolaRot[5] = (SFRotation)((Script)this).getEventOut("Gondola5_rotation");
- this.GondolaRot[6] = (SFRotation)((Script)this).getEventOut("Gondola6_rotation");
- this.GondolaRot[7] = (SFRotation)((Script)this).getEventOut("Gondola7_rotation");
- this.GondolaPos[0] = (SFVec3f)((Script)this).getEventOut("Gondola0_position");
- this.GondolaPos[1] = (SFVec3f)((Script)this).getEventOut("Gondola1_position");
- this.GondolaPos[2] = (SFVec3f)((Script)this).getEventOut("Gondola2_position");
- this.GondolaPos[3] = (SFVec3f)((Script)this).getEventOut("Gondola3_position");
- this.GondolaPos[4] = (SFVec3f)((Script)this).getEventOut("Gondola4_position");
- this.GondolaPos[5] = (SFVec3f)((Script)this).getEventOut("Gondola5_position");
- this.GondolaPos[6] = (SFVec3f)((Script)this).getEventOut("Gondola6_position");
- this.GondolaPos[7] = (SFVec3f)((Script)this).getEventOut("Gondola7_position");
- this.ShapePosInit();
- if (!Vscp.amIMaster()) {
- Vscp.sendApplSpecificMsgWithDist(this.WorldNode, "WorldSync", "dummy", 2);
- }
-
- }
-
- public void WorldSync(ConstSFString var1, double var2) {
- if (Vscp.amIMaster()) {
- String var4 = String.valueOf(this.FerrisRotateAngle);
- Vscp.sendApplSpecificMsgWithDist(this.WorldNode, "ShareFerrisRotate", var4, 4);
- var4 = String.valueOf(this.RidePerson);
- Vscp.sendApplSpecificMsgWithDist(this.WorldNode, "ShareRidePerson", var4, 4);
- var4 = String.valueOf(this.CurrentTime);
- Vscp.sendApplSpecificMsgWithDist(this.WorldNode, "ShareCurrentTime", var4, 4);
- }
-
- }
-
- public void ShareFerrisRotate(ConstSFString var1, double var2) {
- String var4 = var1.getValue();
- this.FerrisRotateAngle = Float.valueOf(var4);
- this.FerrisMove(var2);
- }
-
- public void ShareRidePerson(ConstSFString var1, double var2) {
- String var4 = var1.getValue();
- this.RidePerson = Integer.valueOf(var4);
- }
-
- public void ShareCurrentTime(ConstSFString var1, double var2) {
- String var4 = var1.getValue();
- this.CurrentTime = Integer.valueOf(var4);
- }
-
- public void WorldMove(ConstSFTime var1, double var2) {
- if (!this.WorldConstructorInvoked) {
- this.WorldTimer.setValue(false);
- this.world_constructor(var2);
- this.WorldConstructorInvoked = true;
- this.WorldTimer.setValue(true);
- }
-
- this.FerrisRideColor();
- if ((this.CurrentTime & 1) == 0) {
- this.FerrisMove(var2);
- }
-
- if ((this.CurrentTime & 3) == 2) {
- this.AirshipMove(var1, var2);
- if (Vscp.amIMaster()) {
- Vscp.sendApplSpecificMsgWithDist(this.WorldNode, "WorldSync", "dummy", 2);
- }
- }
-
- if (this.EclipseCnt > 0) {
- --this.EclipseCnt;
- if (this.EclipseCnt <= 0) {
- this.EclipseReset();
- }
- } else {
- this.ChangeBgColor(var1, var2);
- }
-
- if (this.CurrentTime == 90) {
- this.WorldLightSwitch.setValue(0);
- } else if (this.CurrentTime == 270) {
- this.WorldLightSwitch.setValue(1);
- this.ParadeInit(var2);
- this.ParadeFlg = 1;
- }
-
- if (this.ParadeFlg == 1) {
- if (this.CurrentTime > 270 && this.CurrentTime < 330) {
- this.ParadeMove(var1, var2);
- } else if (this.CurrentTime == 330) {
- this.ParadeEnd(var2);
- this.ParadeFlg = 0;
- }
- } else {
- if (this.Piero1MoveFlg) {
- this.Piero1Move();
- }
-
- if (this.Piero2MoveFlg) {
- this.Piero2Move();
- }
- }
-
- ++this.CurrentTime;
- if (this.CurrentTime >= 360) {
- this.CurrentTime = 0;
- if (Vscp.amIMaster()) {
- Vscp.sendApplSpecificMsgWithDist(this.WorldNode, "WorldSync", "dummy", 2);
- }
- }
-
- }
-
- void FerrisRideColor() {
- float[] var1 = new float[3];
- if (this.FerrisRideColorSw) {
- var1[field_3] = 1.0F;
- var1[field_4] = 0.0F;
- var1[field_5] = 0.0F;
- this.FerrisRideColorSw = false;
- } else {
- var1[field_3] = 0.0F;
- var1[field_4] = 1.0F;
- var1[field_5] = 0.0F;
- this.FerrisRideColorSw = true;
- }
-
- this.FerrisRideCol.setValue(var1);
- }
-
- public void EclipsePick(ConstSFBool var1, double var2) {
- if (!var1.getValue()) {
- Vscp.sendApplSpecificMsgWithDist(this.WorldNode, "EclipsePickShare", "", 2);
- this.EclipseStart();
- }
- }
-
- public void EclipsePickShare(ConstSFString var1, double var2) {
- if (Vscp.amIMaster()) {
- Vscp.sendApplSpecificMsgWithDist(this.WorldNode, "EclipsePickShare", "", 4);
- }
-
- this.EclipseStart();
- }
-
- public void EclipseStart() {
- float[][] var1 = new float[1][3];
- var1[0][field_3] = 0.0F;
- var1[0][field_4] = 0.0F;
- var1[0][field_5] = 0.0F;
- this.WorldSkyCol.setValue(var1);
- this.EclipseCnt = 10;
- }
-
- public void EclipseReset() {
- if (this.CurrentTime >= 90 && this.CurrentTime < 270) {
- this.WorldLightSwitch.setValue(0);
- } else {
- this.WorldLightSwitch.setValue(1);
- }
-
- this.EclipseCnt = 0;
- }
-
- public void ChangeBgColor(ConstSFTime var1, double var2) {
- float[][] var7 = new float[1][3];
- float var4;
- float var5;
- float var6;
- if (this.CurrentTime < this.sunriseStartTime) {
- ++this.WorldSkyFlg;
- var4 = this.nightColorR;
- var5 = this.nightColorG;
- var6 = this.nightColorB;
- } else if (this.CurrentTime < this.sunriseMidStartTime) {
- this.WorldSkyFlg = 0;
- var4 = this.calcColorElm(this.CurrentTime, this.sunriseStartTime, this.sunriseMidStartTime, this.nightColorR, this.sunriseColorR);
- var5 = this.calcColorElm(this.CurrentTime, this.sunriseStartTime, this.sunriseMidStartTime, this.nightColorG, this.sunriseColorG);
- var6 = this.calcColorElm(this.CurrentTime, this.sunriseStartTime, this.sunriseMidStartTime, this.nightColorB, this.sunriseColorB);
- } else if (this.CurrentTime < this.sunriseMidEndTime) {
- ++this.WorldSkyFlg;
- var4 = this.sunriseColorR;
- var5 = this.sunriseColorG;
- var6 = this.sunriseColorB;
- } else if (this.CurrentTime < this.sunriseEndTime) {
- this.WorldSkyFlg = 0;
- var4 = this.calcColorElm(this.CurrentTime, this.sunriseMidEndTime, this.sunriseEndTime, this.sunriseColorR, this.daylightColorR);
- var5 = this.calcColorElm(this.CurrentTime, this.sunriseMidEndTime, this.sunriseEndTime, this.sunriseColorG, this.daylightColorG);
- var6 = this.calcColorElm(this.CurrentTime, this.sunriseMidEndTime, this.sunriseEndTime, this.sunriseColorB, this.daylightColorB);
- } else if (this.CurrentTime < this.sunsetStartTime) {
- ++this.WorldSkyFlg;
- var4 = this.daylightColorR;
- var5 = this.daylightColorG;
- var6 = this.daylightColorB;
- } else if (this.CurrentTime < this.sunsetMidStartTime) {
- this.WorldSkyFlg = 0;
- var4 = this.calcColorElm(this.CurrentTime, this.sunsetStartTime, this.sunsetMidStartTime, this.daylightColorR, this.sunsetColorR);
- var5 = this.calcColorElm(this.CurrentTime, this.sunsetStartTime, this.sunsetMidStartTime, this.daylightColorG, this.sunsetColorG);
- var6 = this.calcColorElm(this.CurrentTime, this.sunsetStartTime, this.sunsetMidStartTime, this.daylightColorB, this.sunsetColorB);
- } else if (this.CurrentTime < this.sunsetMidEndTime) {
- ++this.WorldSkyFlg;
- var4 = this.sunsetColorR;
- var5 = this.sunsetColorG;
- var6 = this.sunsetColorB;
- } else if (this.CurrentTime < this.sunsetEndTime) {
- this.WorldSkyFlg = 0;
- var4 = this.calcColorElm(this.CurrentTime, this.sunsetMidEndTime, this.sunsetEndTime, this.sunsetColorR, this.nightColorR);
- var5 = this.calcColorElm(this.CurrentTime, this.sunsetMidEndTime, this.sunsetEndTime, this.sunsetColorG, this.nightColorG);
- var6 = this.calcColorElm(this.CurrentTime, this.sunsetMidEndTime, this.sunsetEndTime, this.sunsetColorB, this.nightColorB);
- } else {
- ++this.WorldSkyFlg;
- var4 = this.nightColorR;
- var5 = this.nightColorG;
- var6 = this.nightColorB;
- }
-
- if (this.WorldSkyFlg <= 1) {
- var7[0][field_3] = var4;
- var7[0][field_4] = var5;
- var7[0][field_5] = var6;
- this.WorldSkyCol.setValue(var7);
- } else {
- this.WorldSkyFlg = 2;
- }
- }
-
- public float calcColorElm(int var1, int var2, int var3, float var4, float var5) {
- float var6 = (var4 * (float)(var3 - var1) + var5 * (float)(var1 - var2)) / (float)(var3 - var2);
- return var6;
- }
-
- public void ParadeInit(double var1) {
- float[] var3 = new float[3];
- float[] var4 = new float[4];
- double var9 = (double)60.0F;
- var3[field_0] = 15.0F;
- var3[field_1] = 2.5F;
- var3[field_2] = 0.0F;
- this.ParadeSoundPos.setValue(var3);
- var3[field_0] = 13.0F;
- var3[field_1] = 2.5F;
- var3[field_2] = 4.0F;
- this.Piero1Pos.setValue(var3);
- var3[field_0] = 13.0F;
- var3[field_1] = 2.5F;
- var3[field_2] = 4.0F;
- this.AccordionPos.setValue(var3);
- var3[field_0] = 14.3F;
- var3[field_1] = 2.9F;
- var3[field_2] = 2.0F;
- this.Piero2Pos.setValue(var3);
- var3[field_0] = 14.3F;
- var3[field_1] = 2.7F;
- var3[field_2] = 2.0F;
- this.BarrelPos.setValue(var3);
- var3[field_0] = 15.0F;
- var3[field_1] = 2.5F;
- var3[field_2] = 0.0F;
- this.Piero3Pos.setValue(var3);
- var3[field_0] = 14.3F;
- var3[field_1] = 2.0F;
- var3[field_2] = -2.0F;
- this.AshikaPos.setValue(var3);
- var3[field_0] = 13.0F;
- var3[field_1] = 2.5F;
- var3[field_2] = -4.0F;
- this.KumaPos.setValue(var3);
- var4[field_0] = 0.0F;
- var4[field_1] = 1.0F;
- var4[field_2] = 0.0F;
- var4[DEGREE] = -20.0F / this.Radian;
- this.Piero1Rot.setValue(var4);
- this.AccordionRot.setValue(var4);
- var4[DEGREE] = -10.0F / this.Radian;
- this.Piero2Rot.setValue(var4);
- this.BarrelRot.setValue(var4);
- var4[DEGREE] = 0.0F / this.Radian;
- this.Piero3Rot.setValue(var4);
- var4[DEGREE] = 10.0F / this.Radian;
- this.AshikaRot.setValue(var4);
- var4[DEGREE] = 25.0F / this.Radian;
- this.KumaRot.setValue(var4);
- double var5 = var1 + (double)1.0F;
- double var7 = var5 + var9;
- this.Piero1StartTime.setValue(var5);
- this.Piero1StopTime.setValue(var7);
- this.Piero2StartTime.setValue(var5);
- this.Piero2StopTime.setValue(var7);
- this.Piero3StartTime.setValue(var5);
- this.Piero3StopTime.setValue(var7);
- this.AshikaStartTime.setValue(var5);
- this.AshikaStopTime.setValue(var7);
- this.KumaStartTime.setValue(var5);
- this.KumaStopTime.setValue(var7);
- this.Piero1Sw.setValue(true);
- this.Piero2Sw.setValue(true);
- this.Piero3Sw.setValue(true);
- this.AshikaSw.setValue(true);
- this.KumaSw.setValue(true);
- this.ParadeSound_start.setValue(var1);
- }
-
- public void ParadeMove(ConstSFTime var1, double var2) {
- float[] var4 = new float[4];
- var4[field_0] = 0.0F;
- var4[field_1] = 1.0F;
- var4[field_2] = 0.0F;
- var4[DEGREE] = (float)(this.CurrentTime - 270) * -6.0F / this.Radian;
- this.ParadeStageRot.setValue(var4);
- var4[field_0] = 1.0F;
- var4[field_1] = 0.0F;
- var4[field_2] = 0.0F;
- var4[DEGREE] = 15.0F / this.Radian;
- this.BarrelRot.setValue(var4);
- }
-
- public void ParadeEnd(double var1) {
- float[] var3 = new float[4];
- var3[field_0] = 0.0F;
- var3[field_1] = 1.0F;
- var3[field_2] = 0.0F;
- var3[DEGREE] = 0.0F / this.Radian;
- this.ParadeStageRot.setValue(var3);
- this.Piero1Rot.setValue(var3);
- this.AccordionRot.setValue(var3);
- var3[DEGREE] = -10.0F / this.Radian;
- this.Piero2Rot.setValue(var3);
- this.BarrelRot.setValue(var3);
- var3[DEGREE] = -20.0F / this.Radian;
- this.Piero3Rot.setValue(var3);
- var3[DEGREE] = 0.0F / this.Radian;
- this.AshikaRot.setValue(var3);
- var3[DEGREE] = 0.0F / this.Radian;
- this.KumaRot.setValue(var3);
- this.InterpolatorPosInit();
- this.ParadeSound_stop.setValue(var1);
- }
-
- public void PeriodicIllumi(ConstSFTime var1, ConstSFTime var2) {
- ++this.IllumiNo;
- if (this.IllumiNo > 9) {
- this.IllumiNo = 0;
- ++this.IllumiCnt;
- if (this.IllumiCnt > 3) {
- this.IllumiCnt = 0;
- }
-
- if (this.IllumiCnt == 0) {
- this.IllumiR = 0.0F;
- this.IllumiG = 0.0F;
- this.IllumiB = 0.0F;
- return;
- }
-
- if (this.IllumiCnt == 1) {
- this.IllumiR = 1.0F;
- this.IllumiG = 1.0F;
- this.IllumiB = 1.0F;
- return;
- }
-
- if (this.IllumiCnt == 2) {
- this.IllumiR = 1.0F;
- this.IllumiG = 0.0F;
- this.IllumiB = 0.0F;
- return;
- }
-
- if (this.IllumiCnt == 3) {
- this.IllumiR = 0.3F;
- this.IllumiG = 1.0F;
- this.IllumiB = 0.1F;
- }
- }
-
- }
-
- public void AirshipMove(ConstSFTime var1, double var2) {
- float[] var4 = new float[4];
- var4[field_0] = 0.0F;
- var4[field_1] = 1.0F;
- var4[field_2] = 0.0F;
- var4[DEGREE] = (float)this.CurrentTime / this.Radian;
- this.AirShipRot.setValue(var4);
- }
-
- public void InterpolatorPosInit() {
- float[] var1 = new float[3];
- this.Piero1PosInit();
- this.Piero2PosInit();
- this.Piero3PosInit();
- this.AshikaPosInit();
- this.KumaPosInit();
- var1[field_0] = 10.0F;
- var1[field_1] = 2.5F;
- var1[field_2] = 10.0F;
- this.AccordionPos.setValue(var1);
- this.Piero2Dir = 0;
- }
-
- public void ShapePosInit() {
- float[] var2 = new float[3];
- var2[field_0] = 0.0F;
- var2[field_1] = 28.5F;
- var2[field_2] = 0.0F;
- this.FerrisWheelPos.setValue(var2);
-
- for(int var1 = 0; var1 <= 7; ++var1) {
- float var3 = (float)var1 / 8.0F * 360.0F + 90.0F;
- float var4 = var3 / this.Radian;
- var2[field_0] = (float)Math.cos((double)var4) * this.FerrisWheelR;
- var2[field_1] = (float)Math.sin((double)var4) * this.FerrisWheelR;
- var2[field_2] = 0.0F;
- this.GondolaPos[var1].setValue(var2);
- }
-
- var2[field_0] = 0.0F;
- var2[field_1] = 3.5F;
- var2[field_2] = 3.0F;
- this.FerrisRidePos.setValue(var2);
- this.FerrisExitPosInit();
- this.InterpolatorPosInit();
- }
-
- float RotateToAngle(float var1) {
- float var2 = var1 / 72.0F * 360.0F;
- return var2;
- }
-
- public void FerrisMove(double var1) {
- float[] var9 = new float[3];
- float[] var10 = new float[4];
- ++this.FerrisRotateAngle;
- if (this.FerrisRotateAngle >= 72.0F) {
- this.FerrisRotateAngle = 0.0F;
- }
-
- float var11 = this.FerrisRotateAngle;
- int var4 = (int)(var11 % 9.0F);
- if (var4 == 0) {
- this.RidePerson = 0;
- }
-
- float var13 = this.RotateToAngle(var11);
- float var14 = var13 / this.Radian;
- var10[field_0] = 0.0F;
- var10[field_1] = 0.0F;
- var10[field_2] = 1.0F;
- var10[DEGREE] = -var14;
- this.FerrisWheelRot.setValue(var10);
- var10[field_0] = 0.0F;
- var10[field_1] = 0.0F;
- var10[field_2] = 1.0F;
- var10[DEGREE] = var14;
-
- for(int var5 = 0; var5 <= 7; ++var5) {
- this.GondolaRot[var5].setValue(var10);
- }
-
- if (this.RideGondolaNum > 0) {
- int var3 = this.RideGondolaNum - 1;
- float var12 = (float)var3 * 9.0F;
- if (var11 == var12) {
- this.FerrisExitReset(var1);
- return;
- }
-
- var13 = this.RotateToAngle(var11 - var12) + 90.0F;
- var14 = var13 / this.Radian;
- float var6 = (float)Math.cos((double)(-var14)) * this.FerrisWheelR;
- float var7 = (float)Math.sin((double)(-var14)) * this.FerrisWheelR + this.FerrisWheelY;
- float var8 = 0.0F;
- if (this.RideSeat == 1) {
- var9[field_0] = var6;
- var9[field_1] = var7 - 0.4F;
- var9[field_2] = var8 - 1.5F;
- this.FerrisExitPos.setValue(var9);
- var9[field_0] = var6;
- var9[field_1] = var7 - 2.5F;
- var9[field_2] = var8 + 1.0F;
- this.GondolaFloorPos.setValue(var9);
- var9[field_0] = 0.0F;
- var9[field_1] = 0.7F;
- var9[field_2] = 0.0F;
- this.GondolaFencePos.setValue(var9);
- return;
- }
-
- var9[field_0] = var6;
- var9[field_1] = var7 - 0.4F;
- var9[field_2] = var8 + 1.5F;
- this.FerrisExitPos.setValue(var9);
- var9[field_0] = var6;
- var9[field_1] = var7 - 2.5F;
- var9[field_2] = var8 - 1.0F;
- this.GondolaFloorPos.setValue(var9);
- var9[field_0] = 0.0F;
- var9[field_1] = 0.7F;
- var9[field_2] = 0.0F;
- this.GondolaFencePos.setValue(var9);
- }
-
- }
-
- public void FerrisRidePick(ConstSFBool var1, double var2) {
- float[] var6 = new float[4];
- if (!var1.getValue()) {
- if (this.RideGondolaNum <= 0) {
- if (this.RidePerson < 2) {
- float var5 = this.FerrisRotateAngle;
- int var4 = (int)(var5 / 9.0F);
- this.RideGondolaNum = var4 + 1;
- this.GondolaSound_start.setValue(var2);
- this.GondolaSound_stop.setValue((double)-1.0F);
- if (this.RidePerson == 0) {
- this.RideSeat = 1;
- this.RidePerson = 1;
- var6[field_0] = 0.0F;
- var6[field_1] = 1.0F;
- var6[field_2] = 0.0F;
- var6[DEGREE] = 0.0F;
- } else {
- this.RideSeat = 2;
- this.RidePerson = 2;
- var6[field_0] = 0.0F;
- var6[field_1] = 1.0F;
- var6[field_2] = 0.0F;
- var6[DEGREE] = 180.0F / this.Radian;
- }
-
- this.GondolaViewBind.setValue(true);
- String var7 = String.valueOf(this.RideSeat);
- Vscp.sendApplSpecificMsgWithDist(this.WorldNode, "FerrisRide", var7, 2);
- }
- }
- }
- }
-
- public void FerrisRide(ConstSFString var1, double var2) {
- if (Vscp.amIMaster()) {
- String var4 = var1.getValue();
- this.RidePerson = Integer.valueOf(var4);
- Vscp.sendApplSpecificMsgWithDist(this.WorldNode, "ShareRidePerson", var4, 4);
- }
-
- }
-
- public void FerrisExitPosInit() {
- float[] var1 = new float[3];
- var1[field_0] = 0.0F;
- var1[field_1] = 0.0F;
- var1[field_2] = 0.0F;
- this.FerrisExitPos.setValue(var1);
- var1[field_0] = 0.0F;
- var1[field_1] = 3.5F;
- var1[field_2] = -2.5F;
- this.GondolaFloorPos.setValue(var1);
- var1[field_0] = 0.0F;
- var1[field_1] = -1.0F;
- var1[field_2] = 0.0F;
- this.GondolaFencePos.setValue(var1);
- }
-
- public void FerrisExitReset(double var1) {
- this.RideGondolaNum = 0;
- this.RideSeat = 0;
- this.FerrisExitPosInit();
- this.GondolaSound_stop.setValue(var1);
- }
-
- public void FerrisExitPick(ConstSFBool var1, double var2) {
- if (!var1.getValue()) {
- this.FerrisExitReset(var2);
- }
- }
-
- public void Piero1PosInit() {
- float[] var1 = new float[3];
- var1[field_0] = 10.0F;
- var1[field_1] = 2.5F;
- var1[field_2] = 10.0F;
- this.Piero1Pos.setValue(var1);
- }
-
- public void Piero1Pick(ConstSFBool var1, double var2) {
- if (!var1.getValue()) {
- this.Piero1Start(var2);
- Vscp.sendApplSpecificMsgWithDist(this.WorldNode, "Piero1PickShare", "void", 4);
- }
- }
-
- public void Piero1PickShare(ConstSFString var1, double var2) {
- this.Piero1Start(var2);
- }
-
- public void Piero1Start(double var1) {
- this.Piero1StartTime.setValue(var1);
- double var3 = var1 + (double)8.0F;
- this.Piero1StopTime.setValue(var3);
- this.Piero1MoveFlg = true;
- this.Piero1Sw.setValue(true);
- }
-
- public void Piero1Move() {
- float[] var1 = new float[3];
- if (this.Piero1Cnt >= 8) {
- this.Piero1Sw.setValue(false);
- this.Piero1MoveFlg = false;
- this.Piero1Cnt = 0;
- } else {
- var1[field_0] = 0.0F;
- var1[field_1] = 0.0F;
- var1[field_2] = 0.0F;
- if ((this.Piero1Cnt & 1) == 0) {
- var1[field_0] = 0.03F;
- this.Accordion1Pos.setValue(var1);
- var1[field_0] = -0.03F;
- this.Accordion2Pos.setValue(var1);
- } else {
- var1[field_0] = -0.03F;
- this.Accordion1Pos.setValue(var1);
- var1[field_0] = 0.03F;
- this.Accordion2Pos.setValue(var1);
- }
-
- ++this.Piero1Cnt;
- }
- }
-
- public void Piero2PosInit() {
- float[] var1 = new float[3];
- var1[field_0] = -10.0F;
- var1[field_1] = 2.9F;
- var1[field_2] = 5.0F;
- this.Piero2Pos.setValue(var1);
- var1[field_0] = -10.0F;
- var1[field_1] = 2.7F;
- var1[field_2] = 5.0F;
- this.BarrelPos.setValue(var1);
- this.Piero2PosZ = 0.0F;
- }
-
- public void Piero2Pick(ConstSFBool var1, double var2) {
- if (!var1.getValue()) {
- this.Piero2Start(var2);
- Vscp.sendApplSpecificMsgWithDist(this.WorldNode, "Piero2PickShare", "void", 4);
- }
- }
-
- public void Piero2PickShare(ConstSFString var1, double var2) {
- this.Piero2Start(var2);
- }
-
- public void Piero2Start(double var1) {
- this.Piero2StartTime.setValue(var1);
- double var3 = var1 + (double)4.0F;
- this.Piero2StopTime.setValue(var3);
- this.Piero2Sw.setValue(true);
- this.Piero2MoveFlg = true;
- }
-
- public void Piero2Move() {
- float[] var1 = new float[3];
- float[] var2 = new float[4];
- if (this.Piero2Cnt >= 8) {
- this.Piero2Cnt = 0;
- if (this.Piero2Dir == 0) {
- this.Piero2Dir = 1;
- } else {
- this.Piero2Dir = 0;
- }
-
- this.Piero2MoveFlg = false;
- } else {
- if (this.Piero2Dir == 0) {
- this.Piero2PosZ += 0.1F;
- this.Piero2RotD += 15.0F;
- } else {
- this.Piero2PosZ -= 0.1F;
- this.Piero2RotD -= 15.0F;
- }
-
- var1[field_0] = -10.0F;
- var1[field_1] = 2.9F;
- var1[field_2] = 5.0F + this.Piero2PosZ;
- this.Piero2Pos.setValue(var1);
- var1[field_0] = -10.0F;
- var1[field_1] = 2.7F;
- var1[field_2] = 5.0F + this.Piero2PosZ;
- this.BarrelPos.setValue(var1);
- var2[field_0] = 1.0F;
- var2[field_1] = 0.0F;
- var2[field_2] = 0.0F;
- var2[DEGREE] = this.Piero2RotD / this.Radian;
- this.BarrelRot.setValue(var2);
- ++this.Piero2Cnt;
- }
- }
-
- public void Piero3PosInit() {
- float[] var1 = new float[3];
- var1[field_0] = -3.0F;
- var1[field_1] = 0.8F;
- var1[field_2] = -40.0F;
- this.Piero3Pos.setValue(var1);
- }
-
- public void Piero3Pick(ConstSFBool var1, double var2) {
- if (!var1.getValue()) {
- this.Piero3Start(var2);
- Vscp.sendApplSpecificMsgWithDist(this.WorldNode, "Piero3PickShare", "void", 4);
- }
- }
-
- public void Piero3PickShare(ConstSFString var1, double var2) {
- this.Piero3Start(var2);
- }
-
- public void Piero3Start(double var1) {
- this.Piero3StartTime.setValue(var1);
- double var3 = var1 + (double)4.0F;
- this.Piero3StopTime.setValue(var3);
- this.Piero3Sw.setValue(true);
- }
-
- public void KumaPosInit() {
- float[] var1 = new float[3];
- var1[field_0] = -30.0F;
- var1[field_1] = 0.2F;
- var1[field_2] = -30.0F;
- this.KumaPos.setValue(var1);
- }
-
- public void KumaPick(ConstSFBool var1, double var2) {
- if (!var1.getValue()) {
- this.KumaStart(var2);
- Vscp.sendApplSpecificMsgWithDist(this.WorldNode, "KumaPickShare", "void", 4);
- }
- }
-
- public void KumaPickShare(ConstSFString var1, double var2) {
- this.KumaStart(var2);
- }
-
- public void KumaStart(double var1) {
- if (this.ParadeFlg != 1) {
- if (this.KumaCnt > 0) {
- return;
- }
-
- this.KumaAng = 0.0F;
- this.KumaCnt = 0;
- this.KumaStartTime.setValue(var1);
- double var3 = var1 + (double)20.0F;
- this.KumaStopTime.setValue(var3);
- this.KumaSw.setValue(true);
- this.KumaBicycleSw.setValue(true);
- }
-
- }
-
- public void KumaBicycleMove(ConstSFTime var1, double var2) {
- float[] var4 = new float[3];
- float[] var5 = new float[4];
- float var7 = -30.0F;
- float var8 = 0.2F;
- float var9 = -30.0F;
- float var10 = 1.5F;
- if (this.ParadeFlg != 1) {
- if (this.KumaCnt < 18) {
- this.KumaAng += 20.0F;
- float var6 = this.KumaAng / this.Radian;
- var4[field_0] = (float)Math.cos((double)var6) * var10 + var7 - var10;
- var4[field_2] = (float)Math.sin((double)var6) * var10 + var9;
- var4[field_1] = var8;
- } else if (this.KumaCnt < 36) {
- this.KumaAng -= 20.0F;
- float var11 = (this.KumaAng + 180.0F) / this.Radian;
- var4[field_0] = (float)Math.cos((double)var11) * var10 + var7 + var10;
- var4[field_2] = (float)Math.sin((double)var11) * var10 + var9;
- var4[field_1] = var8;
- } else {
- this.KumaAng = 0.0F;
- this.KumaCnt = -1;
- var4[field_0] = var7;
- var4[field_2] = var9;
- var4[field_1] = var8;
- this.KumaBicycleSw.setValue(false);
- }
-
- var5[field_0] = 0.0F;
- var5[field_1] = 1.0F;
- var5[field_2] = 0.0F;
- var5[DEGREE] = -this.KumaAng / this.Radian;
- this.KumaRot.setValue(var5);
- this.KumaPos.setValue(var4);
- ++this.KumaCnt;
- }
-
- }
-
- public void AshikaPosInit() {
- float[] var1 = new float[3];
- var1[field_0] = -60.0F;
- var1[field_1] = 0.0F;
- var1[field_2] = 35.0F;
- this.AshikaPos.setValue(var1);
- }
-
- public void AshikaPick(ConstSFBool var1, double var2) {
- if (!var1.getValue()) {
- this.AshikaStart(var2);
- Vscp.sendApplSpecificMsgWithDist(this.WorldNode, "AshikaPickShare", "void", 4);
- }
- }
-
- public void AshikaPickShare(ConstSFString var1, double var2) {
- this.AshikaStart(var2);
- }
-
- public void AshikaStart(double var1) {
- this.AshikaStartTime.setValue(var1);
- double var3 = var1 + (double)1.0F;
- this.AshikaStopTime.setValue(var3);
- this.AshikaSw.setValue(true);
- }
-
- public void AshikaBallPick(ConstSFBool var1, double var2) {
- if (!var1.getValue()) {
- Vscp.sendApplSpecificMsgWithDist(this.WorldNode, "AshikaBallPickShare", "void", 4);
- this.AshikaBallStart(var2);
- }
- }
-
- public void AshikaBallPickShare(ConstSFString var1, double var2) {
- this.AshikaBallStart(var2);
- }
-
- public void AshikaBallStart(double var1) {
- if (this.ParadeFlg != 1) {
- this.AshikaBallSw.setValue(true);
- }
-
- }
-
- public void AshikaSound(double var1, boolean var3) {
- if (var3) {
- this.AshikaSound_start.setValue(var1);
- } else {
- this.AshikaSound_stop.setValue(var1);
- }
- }
-
- public void AshikaBallMove(ConstSFTime var1, double var2) {
- float[] var4 = new float[3];
- float[] var5 = new float[4];
- this.AshikaBallRotX -= 10.0F;
- this.AshikaBallRotZ += 20.0F;
- var5[field_0] = 1.0F;
- var5[field_1] = 0.0F;
- var5[field_2] = 0.0F;
- var5[DEGREE] = this.AshikaBallRotX / this.Radian;
- this.AshikaBallRot.setValue(var5);
- var5[field_0] = 0.0F;
- var5[field_1] = 0.0F;
- var5[field_2] = 1.0F;
- var5[DEGREE] = this.AshikaBallRotZ / this.Radian;
- this.AshikaBallRot.setValue(var5);
- this.AshikaStart(var2);
- ++this.AshikaCnt;
- if (this.AshikaMode == 0) {
- if (this.AshikaCnt > 10) {
- this.AshikaCnt = 0;
- ++this.AshikaMode;
- this.AshikaSound(var2, true);
- } else {
- int var8 = this.AshikaCnt - 1;
- var4[0] = -60.0F;
- var4[1] = this.AshikaBallData1[var8][1];
- var4[2] = this.AshikaBallData1[var8][0];
- this.AshikaBallPos.setValue(var4);
- }
- } else if (this.AshikaMode == 1) {
- if (this.AshikaCnt > 10) {
- this.AshikaCnt = 0;
- ++this.AshikaMode;
- this.AshikaSound(var2, true);
- this.AshikaSw.setValue(false);
- } else {
- int var7 = this.AshikaCnt - 1;
- var4[field_0] = -60.0F;
- var4[field_1] = this.AshikaBallData2[var7];
- var4[field_2] = 35.7F;
- this.AshikaBallPos.setValue(var4);
- }
- } else {
- if (this.AshikaMode == 2) {
- if (this.AshikaCnt == 0) {
- this.AshikaSound(var2, false);
- return;
- }
-
- if (this.AshikaCnt > 10) {
- this.AshikaBallSw.setValue(false);
- this.AshikaMode = 0;
- this.AshikaCnt = 0;
- return;
- }
-
- int var6 = 10 - this.AshikaCnt;
- var4[field_0] = -60.0F;
- var4[field_1] = this.AshikaBallData1[var6][1];
- var4[field_2] = this.AshikaBallData1[var6][0];
- this.AshikaBallPos.setValue(var4);
- }
-
- }
- }
- }
-