home *** CD-ROM | disk | FTP | other *** search
- class VRCObject extends VRCBase implements Runnable {
- public String Name = new String();
- // $FF: renamed from: id int
- public int field_0;
- private boolean active;
- private boolean KeepRunning;
- public float[] fPosVal = new float[3];
- public float[] fTranVal = new float[3];
- public float[] fRotVal = new float[6];
- public int[] rgb = new int[3];
- private static String VRML = new String("VRML");
- public String sCoord = new String();
-
- public VRCObject(String sName, int iActiveWnd) {
- super.ActiveHWND = iActiveWnd;
- this.Name = sName;
- this.getPtr();
- }
-
- public VRCObject() {
- this.active = true;
- }
-
- public void run() {
- this.KeepRunning = true;
-
- while(this.KeepRunning) {
- }
-
- }
-
- public void setName(String sName) {
- this.Name = sName;
- this.getPtr();
- }
-
- public int getPtr() {
- char[] szName = new char[20];
- this.Name.getChars(0, this.Name.length(), szName, 0);
- this.field_0 = ((VRCBase)this).VRCObjectGetPtr(super.ActiveHWND, szName);
- if (this.field_0 > 0) {
- this.active = true;
- }
-
- return this.field_0;
- }
-
- public int Init(int iObj, int iWind) {
- this.field_0 = iObj;
- super.ActiveHWND = iWind;
- char[] szName = new char[20];
- ((VRCBase)this).Java_VRCGetName(this.field_0, szName);
- this.Name = new String(szName);
- return 1;
- }
-
- public void deactivate() {
- this.active = false;
- this.KeepRunning = false;
- }
-
- public void destroy() {
- this.active = false;
- this.KeepRunning = false;
- }
-
- public void setColor(int[] lrgb) {
- if (this.active) {
- ((VRCBase)this).Java_VRCObjectSetColor(super.ActiveHWND, this.field_0, VRCBase.VRC_ATTR_COLOR, lrgb);
- }
-
- this.getColor();
- }
-
- public void getColor() {
- if (this.active) {
- ((VRCBase)this).Java_VRCObjectGetColor(super.ActiveHWND, this.field_0, VRCBase.VRC_ATTR_COLOR, this.rgb);
- }
-
- }
-
- public void convertToVRMLPosCoords(float[] fPosTemp) {
- this.fPosVal[0] = fPosTemp[0];
- this.fPosVal[1] = fPosTemp[2];
- this.fPosVal[2] = -fPosTemp[1];
- }
-
- public void convertFromVRMLPosCoords(float[] fPosTemp) {
- fPosTemp[0] = this.fPosVal[0];
- fPosTemp[1] = -this.fPosVal[2];
- fPosTemp[2] = this.fPosVal[1];
- }
-
- public void convertFromVRMLRotCoords(float[] fRotTemp) {
- fRotTemp[0] = this.fRotVal[0];
- fRotTemp[1] = -this.fRotVal[2];
- fRotTemp[2] = this.fRotVal[1];
- fRotTemp[3] = this.fRotVal[3];
- fRotTemp[4] = this.fRotVal[4];
- fRotTemp[5] = -this.fRotVal[5];
- }
-
- public void convertToVRMLRotCoords(float[] fRotTemp) {
- this.fRotVal[0] = fRotTemp[0];
- this.fRotVal[1] = fRotTemp[2];
- this.fRotVal[2] = -fRotTemp[1];
- this.fRotVal[3] = fRotTemp[3];
- this.fRotVal[4] = fRotTemp[4];
- this.fRotVal[5] = -fRotTemp[5];
- }
-
- public void convertFromRelVRMLRotCoords(float[] fRotTemp) {
- fRotTemp[0] = this.fRotVal[0];
- fRotTemp[1] = -this.fRotVal[2];
- fRotTemp[2] = this.fRotVal[1];
- fRotTemp[3] = this.fRotVal[3];
- fRotTemp[4] = -this.fRotVal[5];
- fRotTemp[5] = this.fRotVal[4];
- }
-
- public void getPosition() {
- float[] fPosTemp = new float[3];
- if (this.active) {
- ((VRCBase)this).Java_VRCObjectGetPosition(super.ActiveHWND, this.field_0, VRCBase.VRC_ATTR_POSITION, fPosTemp);
- }
-
- this.convertToVRMLPosCoords(fPosTemp);
- }
-
- public void getRotation() {
- float[] fRotTemp = new float[6];
- if (this.active) {
- ((VRCBase)this).Java_VRCObjectGetRotation(super.ActiveHWND, this.field_0, VRCBase.VRC_ATTR_ROTATION, fRotTemp);
- }
-
- this.convertToVRMLRotCoords(fRotTemp);
- }
-
- public void getPositionRel(int l, int m) {
- float[] fPosTemp = new float[3];
- if (this.active) {
- ((VRCBase)this).Java_VRCObjectGetPositionRel(l, m, fPosTemp);
- }
-
- this.convertToVRMLPosCoords(fPosTemp);
- }
-
- public void RotateRel(float[] fRotTemp) {
- float[] fRotTemp1 = new float[6];
- fRotTemp1[0] = fRotTemp[0];
- fRotTemp1[1] = fRotTemp[1];
- fRotTemp1[2] = fRotTemp[2];
- fRotTemp1[3] = fRotTemp[3];
- fRotTemp1[4] = fRotTemp[4];
- fRotTemp1[5] = fRotTemp[5];
- this.fRotVal[0] = fRotTemp1[0];
- this.fRotVal[1] = fRotTemp1[1];
- this.fRotVal[2] = fRotTemp1[2];
- this.fRotVal[3] = fRotTemp1[3];
- this.fRotVal[4] = fRotTemp1[4];
- this.fRotVal[5] = fRotTemp1[5];
- this.convertFromRelVRMLRotCoords(fRotTemp1);
- if (this.active) {
- ((VRCBase)this).Java_VRCObjectRotateRel2(super.ActiveHWND, this.field_0, fRotTemp1);
- }
-
- }
-
- public void Rotate(int x, int y, int z, int delta_x, int delta_y) {
- if (this.active) {
- ((VRCBase)this).VRCObjectRotateRel2D(super.ActiveHWND, this.field_0, delta_x, delta_y, x, y, z);
- }
-
- if (this.active) {
- ((VRCBase)this).VRCObjectRotateRel2D(super.ActiveHWND, this.field_0, 0, 0, 1, 1, 1);
- }
-
- }
-
- public void Spin(float[] fRotTemp) {
- float[] fRotTemp1 = new float[6];
- fRotTemp1[0] = fRotTemp[0];
- fRotTemp1[1] = fRotTemp[1];
- fRotTemp1[2] = fRotTemp[2];
- fRotTemp1[3] = fRotTemp[3];
- fRotTemp1[4] = fRotTemp[4];
- fRotTemp1[5] = fRotTemp[5];
- this.fRotVal[0] = fRotTemp1[0];
- this.fRotVal[1] = fRotTemp1[1];
- this.fRotVal[2] = fRotTemp1[2];
- this.fRotVal[3] = fRotTemp1[3];
- this.fRotVal[4] = fRotTemp1[4];
- this.fRotVal[5] = fRotTemp1[5];
- this.convertFromRelVRMLRotCoords(fRotTemp1);
- if (this.active) {
- ((VRCBase)this).Java_VRCObjectRotateRel(super.ActiveHWND, this.field_0, fRotTemp);
- }
-
- }
-
- public void Translate(float[] fPosTemp) {
- float[] fPosTemp1 = new float[3];
- fPosTemp1[0] = fPosTemp[0];
- fPosTemp1[1] = fPosTemp[1];
- fPosTemp1[2] = fPosTemp[2];
- this.fPosVal[0] = fPosTemp[0];
- this.fPosVal[1] = fPosTemp[1];
- this.fPosVal[2] = fPosTemp[2];
- this.convertFromVRMLPosCoords(fPosTemp);
- if (this.active) {
- ((VRCBase)this).Java_VRCObjectTranslate(super.ActiveHWND, this.field_0, fPosTemp);
- }
-
- }
-
- public void TranslateRel(float[] fPosTemp) {
- float[] fPosTemp1 = new float[3];
- fPosTemp1[0] = fPosTemp[0];
- fPosTemp1[1] = fPosTemp[1];
- fPosTemp1[2] = fPosTemp[2];
- this.fPosVal[0] = fPosTemp[0];
- this.fPosVal[1] = fPosTemp[1];
- this.fPosVal[2] = fPosTemp[2];
- this.convertFromVRMLPosCoords(fPosTemp1);
- if (this.active) {
- ((VRCBase)this).Java_VRCObjectTranslateRel(super.ActiveHWND, this.field_0, fPosTemp1);
- }
-
- }
- }
-