Source Code Cross Referenced for Joint.java in  » 6.0-JDK-Modules » java-3d » com » db » hanim » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » java 3d » com.db.hanim 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        /*
0002:         * Copyright (c) 2000-2001 Silvere Martin-Michiellot All Rights Reserved.
0003:         *
0004:         * Silvere Martin-Michiellot grants you ("Licensee") a non-exclusive,
0005:         * royalty free, license to use, but not to modify or redistribute this
0006:         * software in source and binary code form,
0007:         * provided that i) this copyright notice and license appear on all copies of
0008:         * the software; and ii) Licensee does not utilize the software in a manner
0009:         * which is disparaging to Silvere Martin-Michiellot.
0010:         *
0011:         * This software is provided "AS IS," without a warranty of any kind. ALL
0012:         * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
0013:         * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
0014:         * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. Silvere Martin-Michiellot
0015:         * AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES
0016:         * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
0017:         * OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
0018:         * Silvere Martin-Michiellot OR ITS LICENSORS BE LIABLE
0019:         * FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
0020:         * INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
0021:         * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
0022:         * OR INABILITY TO USE SOFTWARE, EVEN IF Silvere Martin-Michiellot HAS BEEN
0023:         * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. *
0024:         * This software is not designed or intended for use in on-line control of
0025:         * aircraft, air traffic, aircraft navigation or aircraft communications; or in
0026:         * the design, construction, operation or maintenance of any nuclear
0027:         * facility. Licensee represents and warrants that it will not use or
0028:         * redistribute the Software for such purposes.
0029:         *
0030:         * @Author: Silvere Martin-Michiellot for Digital Biosphere
0031:         * @Version: 1.1 (to stay in touch with h-anim)
0032:         *
0033:         */
0034:
0035:        package com.db.hanim;
0036:
0037:        import java.util.*;
0038:        import javax.vecmath.*;
0039:        import javax.media.j3d.*;
0040:
0041:        /**
0042:         * This class is to implement the H-Anim proposed Joint. It's implementation for Java3D has been mimicked on the VRML97 field description.
0043:         *
0044:         * We make a little amendment to H-Anim for uLimit and lLimit:
0045:         * H-Anim states that "the default values for each of these fields is [], which means that the joint is assumed to be unconstrained."
0046:         * However, this is problematic since we can't constrain Y axis (or Z axis) without setting a default value for the X axis
0047:         * (unless we use a hashtable, which sounds absurd in this context).
0048:         * Here, we propose that there should only be valid values between -2*PI and +2*PI.
0049:         * Any other value should be treated as if the joint was unconstrained on this axis.
0050:         *
0051:         * @author Silvere Martin-Michiellot
0052:         * @version 1.1
0053:         */
0054:
0055:        public class Joint extends Object {
0056:
0057:            public static final int HumanoidRoot = 0;
0058:            public static final int sacroiliac = 1;
0059:            public static final int l_hip = 2;
0060:            public static final int l_knee = 3;
0061:            public static final int l_ankle = 4;
0062:            public static final int l_subtalar = 5;
0063:            public static final int l_midtarsal = 6;
0064:            public static final int l_metatarsal = 7;
0065:            public static final int r_hip = 8;
0066:            public static final int r_knee = 9;
0067:            public static final int r_ankle = 10;
0068:            public static final int r_subtalar = 11;
0069:            public static final int r_midtarsal = 12;
0070:            public static final int r_metatarsal = 13;
0071:            public static final int vl5 = 14;
0072:            public static final int vl4 = 15;
0073:            public static final int vl3 = 16;
0074:            public static final int vl2 = 17;
0075:            public static final int vl1 = 18;
0076:            public static final int vt12 = 19;
0077:            public static final int vt11 = 20;
0078:            public static final int vt10 = 21;
0079:            public static final int vt9 = 22;
0080:            public static final int vt8 = 23;
0081:            public static final int vt7 = 24;
0082:            public static final int vt6 = 25;
0083:            public static final int vt5 = 26;
0084:            public static final int vt4 = 27;
0085:            public static final int vt3 = 28;
0086:            public static final int vt2 = 29;
0087:            public static final int vt1 = 30;
0088:            public static final int vc7 = 31;
0089:            public static final int vc6 = 32;
0090:            public static final int vc5 = 33;
0091:            public static final int vc4 = 34;
0092:            public static final int vc3 = 35;
0093:            public static final int vc2 = 36;
0094:            public static final int vc1 = 37;
0095:            public static final int skullbase = 38;
0096:            public static final int l_eyelid_joint = 39;
0097:            public static final int r_eyelid_joint = 40;
0098:            public static final int l_eyeball_joint = 41;
0099:            public static final int r_eyeball_joint = 42;
0100:            public static final int l_eyebrow_joint = 43;
0101:            public static final int r_eyebrow_joint = 44;
0102:            public static final int temporomandibular = 45;
0103:            public static final int l_sternoclavicular = 46;
0104:            public static final int l_acromioclavicular = 47;
0105:            public static final int l_shoulder = 48;
0106:            public static final int l_elbow = 49;
0107:            public static final int l_wrist = 50;
0108:            public static final int l_thumb1 = 51;
0109:            public static final int l_thumb2 = 52;
0110:            public static final int l_thumb3 = 53;
0111:            public static final int l_index0 = 54;
0112:            public static final int l_index1 = 55;
0113:            public static final int l_index2 = 56;
0114:            public static final int l_index3 = 57;
0115:            public static final int l_middle0 = 58;
0116:            public static final int l_middle1 = 59;
0117:            public static final int l_middle2 = 60;
0118:            public static final int l_middle3 = 61;
0119:            public static final int l_ring0 = 62;
0120:            public static final int l_ring1 = 63;
0121:            public static final int l_ring2 = 64;
0122:            public static final int l_ring3 = 65;
0123:            public static final int l_pinky0 = 66;
0124:            public static final int l_pinky1 = 67;
0125:            public static final int l_pinky2 = 68;
0126:            public static final int l_pinky3 = 69;
0127:            public static final int r_sternoclavicular = 70;
0128:            public static final int r_acromioclavicular = 71;
0129:            public static final int r_shoulder = 72;
0130:            public static final int r_elbow = 73;
0131:            public static final int r_wrist = 74;
0132:            public static final int r_thumb1 = 75;
0133:            public static final int r_thumb2 = 76;
0134:            public static final int r_thumb3 = 77;
0135:            public static final int r_index0 = 78;
0136:            public static final int r_index1 = 79;
0137:            public static final int r_index2 = 80;
0138:            public static final int r_index3 = 81;
0139:            public static final int r_middle0 = 82;
0140:            public static final int r_middle1 = 83;
0141:            public static final int r_middle2 = 84;
0142:            public static final int r_middle3 = 85;
0143:            public static final int r_ring0 = 86;
0144:            public static final int r_ring1 = 87;
0145:            public static final int r_ring2 = 88;
0146:            public static final int r_ring3 = 89;
0147:            public static final int r_pinky0 = 90;
0148:            public static final int r_pinky1 = 91;
0149:            public static final int r_pinky2 = 92;
0150:            public static final int r_pinky3 = 93;
0151:            public static final int NonStandard = 94;
0152:
0153:            public static final double unconstrained = Double.MAX_VALUE;
0154:            //we should consider using Double.NaN;
0155:
0156:            protected String jointName;
0157:            protected HashSet children;
0158:            protected Segment segment;
0159:            protected Transform3D transform3D;
0160:            /**
0161:             * @deprecated since 1.0, use getTransform() or setTransform()
0162:             */
0163:            protected Point3d center;
0164:            protected AxisAngle4d limitOrientation;
0165:            protected Double[] lLimit;
0166:            //here, we make a little amendment to h-anim:
0167:            //h-anim states that "the default values for each of these fields is [], which means that the joint is assumed to be unconstrained."
0168:            //however, this is problematic since we can't constrain Y axis (or Z axis) without setting a default value for the X axis
0169:            //(unless we use a hashtable, which sounds absurd in this context)
0170:            //here, we propose that there should only be valid values between -2*PI and +2*PI
0171:            //any other value should be treated as if the joint was unconstrained on this axis.
0172:            //Double is better than Float :-)
0173:            protected Double[] uLimit;
0174:            //see lLimit above
0175:            //Double is better than Float :-)
0176:            protected Double[] stiffness;
0177:
0178:            //Double is better than Float :-)
0179:
0180:            /**
0181:             * Constructs a new Joint
0182:             * @param jointName the name of the Joint that describes in a human readable manner the Joint
0183:             */
0184:            public Joint(String jointName) {
0185:
0186:                super ();
0187:                this .setName(jointName);
0188:                children = new HashSet();
0189:                transform3D = new Transform3D();
0190:                center = new Point3d();
0191:                limitOrientation = new AxisAngle4d();
0192:                lLimit = new Double[3];
0193:                lLimit[0] = new Double(Joint.unconstrained);
0194:                lLimit[1] = new Double(Joint.unconstrained);
0195:                lLimit[2] = new Double(Joint.unconstrained);
0196:                uLimit = new Double[3];
0197:                uLimit[0] = new Double(Joint.unconstrained);
0198:                uLimit[1] = new Double(Joint.unconstrained);
0199:                uLimit[2] = new Double(Joint.unconstrained);
0200:                stiffness = new Double[3];
0201:                stiffness[0] = new Double(0);
0202:                stiffness[1] = new Double(0);
0203:                stiffness[2] = new Double(0);
0204:                segment = null;
0205:
0206:            }
0207:
0208:            /**
0209:             * Gets the Joint name that describes in a human readable manner the Joint
0210:             * @return the String name of this Joint
0211:             */
0212:            public String getName() {
0213:
0214:                return this .jointName;
0215:
0216:            }
0217:
0218:            /**
0219:             * Sets the Joint name that describes in a human readable manner the Joint
0220:             * @param jointName the name of this Joint
0221:             */
0222:            public void setName(String jointName) {
0223:
0224:                this .jointName = jointName;
0225:
0226:            }
0227:
0228:            /**
0229:             * Gets the Transform3D used for this Joint.
0230:             * @param transform3D the Transform3D of this Joint
0231:             */
0232:            //java3D like call (not a function)...
0233:            public void getTransform(Transform3D transform3D) {
0234:
0235:                transform3D.set(this .transform3D);
0236:
0237:            }
0238:
0239:            /**
0240:             * Sets the Transform3D used for this Joint.
0241:             * @param transform3D the Transform3D of this Joint
0242:             */
0243:            public void setTransform(Transform3D jointTransform) {
0244:
0245:                this .transform3D = jointTransform;
0246:
0247:            }
0248:
0249:            /**
0250:             * Gets the AxisAngle4d used as LimitOrientation
0251:             * @return the AxisAngle4d defining the LimitOrientation for this Joint
0252:             */
0253:            public AxisAngle4d getLimitOrientation() {
0254:
0255:                return this .limitOrientation;
0256:
0257:            }
0258:
0259:            /**
0260:             * Sets the AxisAngle4d used as LimitOrientation
0261:             * @param AxisAngle4d the AxisAngle4d used as used as LimitOrientation for this Joint
0262:             */
0263:            public void setLimitOrientation(AxisAngle4d limitOrientation) {
0264:
0265:                this .limitOrientation = limitOrientation;
0266:
0267:            }
0268:
0269:            /**
0270:             * Gets the array of Double used as lower limit
0271:             * @return the array of Double that is the lower limit for this Joint
0272:             */
0273:            public Double[] getLLimit() {
0274:
0275:                return this .lLimit;
0276:
0277:            }
0278:
0279:            /**
0280:             * Sets the array of Double used as lower limit
0281:             * @param the 3 element array of Double that is the lower limit for this Joint
0282:             */
0283:            public void setLLimit(Double[] lLimit) {
0284:
0285:                if (lLimit.length == 3) {
0286:                    this .lLimit = lLimit;
0287:                } else {
0288:                    throw new java.lang.IllegalArgumentException(
0289:                            "LLimit has a 3 element argument according to our amendment to the h-anim specification.");
0290:                }
0291:
0292:            }
0293:
0294:            /**
0295:             * Gets the array of Double used as upper limit
0296:             * @return the array of Double that is the upper limit for this Joint
0297:             */
0298:            public Double[] getULimit() {
0299:
0300:                return this .uLimit;
0301:
0302:            }
0303:
0304:            /**
0305:             * Sets the array of Double used as upper limit
0306:             * @return the 3 element array of Double that is the upper limit for this Joint
0307:             */
0308:            public void setULimit(Double[] uLimit) {
0309:
0310:                if (uLimit.length == 3) {
0311:                    this .uLimit = uLimit;
0312:                } else {
0313:                    throw new java.lang.IllegalArgumentException(
0314:                            "ULimit has a 3 element argument according to our amendment to the h-anim specification.");
0315:                }
0316:
0317:            }
0318:
0319:            /**
0320:             * Sets the array of Double used as stiffness
0321:             * @return the array of Double that is the stiffness for this Joint
0322:             */
0323:            public Double[] getStiffness() {
0324:
0325:                return this .stiffness;
0326:
0327:            }
0328:
0329:            /**
0330:             * Sets the array of Double used as stiffness
0331:             * @return the 3 element array of Double that is the stiffness for this Joint
0332:             */
0333:            public void setStiffness(Double[] stiffness) {
0334:
0335:                if (stiffness.length == 3) {
0336:                    this .stiffness = stiffness;
0337:                } else {
0338:                    throw new java.lang.IllegalArgumentException(
0339:                            "Stiffness has a 3 element argument according to h-anim specification.");
0340:                }
0341:
0342:            }
0343:
0344:            //following transformations kept for better compatibility with H-Anim spec.
0345:
0346:            /**
0347:             * Gets the Point3d that defines the overall center offset postion of the Joint
0348:             * @param point3D the Point3D to put the center into for this Joint
0349:             * @see com.db.hanim.Joint#setCenter(Point3d)
0350:             * @deprecated since 1.0, use getTransform() or setTransform()
0351:             */
0352:            public void getCenter(Point3d point3d) {
0353:                //see setCenter for information about center
0354:
0355:                point3d.set(this .center);
0356:
0357:            }
0358:
0359:            /**
0360:             * Gets the Point3d that defines the overall center offset default value proposed by H-Anim for this Joint.
0361:             * @param point3D the Point3D to put the center into for this Joint
0362:             * @see com.db.hanim.Joint#useDefaultCenter()
0363:             */
0364:            public void getDefaultCenter(Point3d point3d) {
0365:                //see setCenter for information about center
0366:
0367:                switch (Joint.getJointIdentifierNumber(this .getName())) {
0368:                case Joint.HumanoidRoot:
0369:                    point3d.set(0.0000, 0.8240, 0.0277);
0370:                    break;
0371:                case Joint.sacroiliac:
0372:                    point3d.set(0.0000, 0.9149, 0.0016);
0373:                    break;
0374:                case Joint.l_hip:
0375:                    point3d.set(0.0961, 0.9124, -0.0001);
0376:                    break;
0377:                case Joint.l_knee:
0378:                    point3d.set(0.1040, 0.4867, 0.0308);
0379:                    break;
0380:                case Joint.l_ankle:
0381:                    point3d.set(0.1101, 0.0656, -0.0736);
0382:                    break;
0383:                case Joint.l_subtalar:
0384:                    point3d.set(0.1086, 0.0001, -0.0368);
0385:                    break;
0386:                case Joint.l_midtarsal:
0387:                    point3d.set(0.1086, 0.0001, 0.0368);
0388:                    break;
0389:                case Joint.l_metatarsal:
0390:                    point3d.set(0.1086, 0.0000, 0.0762);
0391:                    break;
0392:                case Joint.r_hip:
0393:                    point3d.set(-0.0950, 0.9171, 0.0029);
0394:                    break;
0395:                case Joint.r_knee:
0396:                    point3d.set(-0.0867, 0.4913, 0.0318);
0397:                    break;
0398:                case Joint.r_ankle:
0399:                    point3d.set(-0.0801, 0.0712, -0.0766);
0400:                    break;
0401:                case Joint.r_subtalar:
0402:                    point3d.set(-0.0801, 0.0000, -0.0368);
0403:                    break;
0404:                case Joint.r_midtarsal:
0405:                    point3d.set(-0.0801, 0.0000, 0.0368);
0406:                    break;
0407:                case Joint.r_metatarsal:
0408:                    point3d.set(-0.0801, 0.0039, 0.0732);
0409:                    break;
0410:                case Joint.vl5:
0411:                    point3d.set(0.0028, 1.0568, -0.0776);
0412:                    break;
0413:                case Joint.vl4:
0414:                    point3d.set(0.0035, 1.0925, -0.0787);
0415:                    break;
0416:                case Joint.vl3:
0417:                    point3d.set(0.0041, 1.1276, -0.0796);
0418:                    break;
0419:                case Joint.vl2:
0420:                    point3d.set(0.0045, 1.1546, -0.0800);
0421:                    break;
0422:                case Joint.vl1:
0423:                    point3d.set(0.0048, 1.1912, -0.0805);
0424:                    break;
0425:                case Joint.vt12:
0426:                    point3d.set(0.0051, 1.2278, -0.0808);
0427:                    break;
0428:                case Joint.vt11:
0429:                    point3d.set(0.0053, 1.2679, -0.0810);
0430:                    break;
0431:                case Joint.vt10:
0432:                    point3d.set(0.0056, 1.2848, -0.0822);
0433:                    break;
0434:                case Joint.vt9:
0435:                    point3d.set(0.0057, 1.3126, -0.0838);
0436:                    break;
0437:                case Joint.vt8:
0438:                    point3d.set(0.0057, 1.3382, -0.0845);
0439:                    break;
0440:                case Joint.vt7:
0441:                    point3d.set(0.0058, 1.3625, -0.0833);
0442:                    break;
0443:                case Joint.vt6:
0444:                    point3d.set(0.0059, 1.3866, -0.0800);
0445:                    break;
0446:                case Joint.vt5:
0447:                    point3d.set(0.0060, 1.4102, -0.0745);
0448:                    break;
0449:                case Joint.vt4:
0450:                    point3d.set(0.0061, 1.4320, -0.0675);
0451:                    break;
0452:                case Joint.vt3:
0453:                    point3d.set(0.0062, 1.4583, -0.0570);
0454:                    break;
0455:                case Joint.vt2:
0456:                    point3d.set(0.0063, 1.4761, -0.0484);
0457:                    break;
0458:                case Joint.vt1:
0459:                    point3d.set(0.0065, 1.4951, -0.0387);
0460:                    break;
0461:                case Joint.vc7:
0462:                    point3d.set(0.0066, 1.5132, -0.0301);
0463:                    break;
0464:                case Joint.vc6:
0465:                    point3d.set(0.0066, 1.5357, -0.0143);
0466:                    break;
0467:                case Joint.vc5:
0468:                    point3d.set(0.0066, 1.5520, -0.0082);
0469:                    break;
0470:                case Joint.vc4:
0471:                    point3d.set(0.0066, 1.5662, -0.0084);
0472:                    break;
0473:                case Joint.vc3:
0474:                    point3d.set(0.0066, 1.5800, -0.0103);
0475:                    break;
0476:                case Joint.vc2:
0477:                    point3d.set(0.0066, 1.5928, -0.0103);
0478:                    break;
0479:                case Joint.vc1:
0480:                    point3d.set(0.0066, 1.6144, -0.0034);
0481:                    break;
0482:                case Joint.skullbase:
0483:                    point3d.set(0.0044, 1.6209, 0.0236);
0484:                    break;
0485:                case Joint.l_eyelid_joint:
0486:                    //Not set by h-anim spec.
0487:                    break;
0488:                case Joint.r_eyelid_joint:
0489:                    //Not set by h-anim spec.
0490:                    break;
0491:                case Joint.l_eyeball_joint:
0492:                    point3d.set(0.0336, 1.6332, 0.0502);
0493:                    break;
0494:                case Joint.r_eyeball_joint:
0495:                    point3d.set(-0.0236, 1.6331, 0.0510);
0496:                    break;
0497:                case Joint.l_eyebrow_joint:
0498:                    //Not set by h-anim spec.
0499:                    break;
0500:                case Joint.r_eyebrow_joint:
0501:                    //Not set by h-anim spec.
0502:                    break;
0503:                case Joint.temporomandibular:
0504:                    //Not set by h-anim spec.
0505:                    break;
0506:                case Joint.l_sternoclavicular:
0507:                    point3d.set(0.0820, 1.4488, -0.0353);
0508:                    break;
0509:                case Joint.l_acromioclavicular:
0510:                    point3d.set(0.0962, 1.4269, -0.0424);
0511:                    break;
0512:                case Joint.l_shoulder:
0513:                    point3d.set(0.2029, 1.4376, -0.0387);
0514:                    break;
0515:                case Joint.l_elbow:
0516:                    point3d.set(0.2014, 1.1357, -0.0682);
0517:                    break;
0518:                case Joint.l_wrist:
0519:                    point3d.set(0.1984, 0.8663, -0.0583);
0520:                    break;
0521:                case Joint.l_thumb1:
0522:                    point3d.set(0.1924, 0.8472, -0.0534);
0523:                    break;
0524:                case Joint.l_thumb2:
0525:                    point3d.set(0.1951, 0.8226, 0.0246);
0526:                    break;
0527:                case Joint.l_thumb3:
0528:                    point3d.set(0.1955, 0.8159, 0.0464);
0529:                    break;
0530:                case Joint.l_index0:
0531:                    point3d.set(0.1983, 0.8024, -0.0280);
0532:                    break;
0533:                case Joint.l_index1:
0534:                    point3d.set(0.1983, 0.7815, -0.0280);
0535:                    break;
0536:                case Joint.l_index2:
0537:                    point3d.set(0.2017, 0.7363, -0.0248);
0538:                    break;
0539:                case Joint.l_index3:
0540:                    point3d.set(0.2028, 0.7139, -0.0236);
0541:                    break;
0542:                case Joint.l_middle0:
0543:                    point3d.set(0.1987, 0.8029, -0.0530);
0544:                    break;
0545:                case Joint.l_middle1:
0546:                    point3d.set(0.1987, 0.7818, -0.0530);
0547:                    break;
0548:                case Joint.l_middle2:
0549:                    point3d.set(0.2013, 0.7273, -0.0503);
0550:                    break;
0551:                case Joint.l_middle3:
0552:                    point3d.set(0.2026, 0.7011, -0.0494);
0553:                    break;
0554:                case Joint.l_ring0:
0555:                    point3d.set(0.1956, 0.8019, -0.0794);
0556:                    break;
0557:                case Joint.l_ring1:
0558:                    point3d.set(0.1956, 0.7815, -0.0794);
0559:                    break;
0560:                case Joint.l_ring2:
0561:                    point3d.set(0.1973, 0.7287, -0.0777);
0562:                    break;
0563:                case Joint.l_ring3:
0564:                    point3d.set(0.1983, 0.7045, -0.0767);
0565:                    break;
0566:                case Joint.l_pinky0:
0567:                    point3d.set(0.1925, 0.8066, -0.1036);
0568:                    break;
0569:                case Joint.l_pinky1:
0570:                    point3d.set(0.1925, 0.7866, -0.1036);
0571:                    break;
0572:                case Joint.l_pinky2:
0573:                    point3d.set(0.1938, 0.7452, -0.1024);
0574:                    break;
0575:                case Joint.l_pinky3:
0576:                    point3d.set(0.1948, 0.7277, -0.1017);
0577:                    break;
0578:                case Joint.r_sternoclavicular:
0579:                    point3d.set(-0.0694, 1.4600, -0.0330);
0580:                    break;
0581:                case Joint.r_acromioclavicular:
0582:                    point3d.set(-0.0836, 1.4281, -0.0401);
0583:                    break;
0584:                case Joint.r_shoulder:
0585:                    point3d.set(-0.1907, 1.4407, -0.0325);
0586:                    break;
0587:                case Joint.r_elbow:
0588:                    point3d.set(-0.1949, 1.1388, -0.0620);
0589:                    break;
0590:                case Joint.r_wrist:
0591:                    point3d.set(-0.1959, 0.8694, -0.0521);
0592:                    break;
0593:                case Joint.r_thumb1:
0594:                    point3d.set(-0.1899, 0.8502, -0.0473);
0595:                    break;
0596:                case Joint.r_thumb2:
0597:                    point3d.set(-0.1874, 0.8256, 0.0306);
0598:                    break;
0599:                case Joint.r_thumb3:
0600:                    point3d.set(-0.1864, 0.8190, 0.0506);
0601:                    break;
0602:                case Joint.r_index0:
0603:                    point3d.set(-0.1961, 0.8055, -0.0218);
0604:                    break;
0605:                case Joint.r_index1:
0606:                    point3d.set(-0.1961, 0.7846, -0.0218);
0607:                    break;
0608:                case Joint.r_index2:
0609:                    point3d.set(-0.1954, 0.7393, -0.0185);
0610:                    break;
0611:                case Joint.r_index3:
0612:                    point3d.set(-0.1945, 0.7169, -0.0173);
0613:                    break;
0614:                case Joint.r_middle0:
0615:                    point3d.set(-0.1972, 0.8060, -0.0468);
0616:                    break;
0617:                case Joint.r_middle1:
0618:                    point3d.set(-0.1972, 0.7849, -0.0468);
0619:                    break;
0620:                case Joint.r_middle2:
0621:                    point3d.set(-0.1950, 0.7304, -0.0441);
0622:                    break;
0623:                case Joint.r_middle3:
0624:                    point3d.set(-0.1939, 0.7042, -0.0432);
0625:                    break;
0626:                case Joint.r_ring0:
0627:                    point3d.set(-0.1951, 0.8049, -0.0732);
0628:                    break;
0629:                case Joint.r_ring1:
0630:                    point3d.set(-0.1951, 0.7845, -0.0732);
0631:                    break;
0632:                case Joint.r_ring2:
0633:                    point3d.set(-0.1920, 0.7318, -0.0716);
0634:                    break;
0635:                case Joint.r_ring3:
0636:                    point3d.set(-0.1908, 0.7077, -0.0706);
0637:                    break;
0638:                case Joint.r_pinky0:
0639:                    point3d.set(-0.1926, 0.8096, -0.0975);
0640:                    break;
0641:                case Joint.r_pinky1:
0642:                    point3d.set(-0.1926, 0.7896, -0.0975);
0643:                    break;
0644:                case Joint.r_pinky2:
0645:                    point3d.set(-0.1902, 0.7483, -0.0963);
0646:                    break;
0647:                case Joint.r_pinky3:
0648:                    point3d.set(-0.1908, 0.7540, -0.0960);
0649:                    break;
0650:                default:
0651:                    //No default value
0652:                    break;
0653:                }
0654:
0655:            }
0656:
0657:            /**
0658:             * Sets the offset center for the Joint.
0659:             * According to VRML97 spec,
0660:             * Given a 3-dimensional point P and Transform node,
0661:             * P is transformed into point P' in its parent's coordinate system
0662:             * by a series of intermediate transformations.
0663:             * In matrix transformation notation, where C (center), SR (scaleOrientation),
0664:             * T (translation), R (rotation), and S (scale) are the equivalent transformation matrices,
0665:             * then P' = T × C × R × SR × S × -SR × -C × P
0666:             * unfortunately, Java3D doesn't defines all these fields and works "only" with 4x4 matrix
0667:             * a 4x4 matrix allows to perform translations, rotations, and scaling and shear effects.
0668:             * but no offset centering that we have to simulate
0669:             * @param point3d the Point3d to put the offset center into for this Joint
0670:             * @see com.db.hanim.Joint#setTransform(Transform3D)
0671:             * @deprecated since 1.0, use getTransform() or setTransform()
0672:             */
0673:            public void setCenter(Point3d point3d) {
0674:                //according to VRML97 spec,
0675:                //Given a 3-dimensional point P and Transform node,
0676:                //P is transformed into point P' in its parent's coordinate system
0677:                //by a series of intermediate transformations.
0678:                //In matrix transformation notation, where C (center), SR (scaleOrientation),
0679:                //T (translation), R (rotation), and S (scale) are the equivalent transformation matrices,
0680:                //then P' = T × C × R × SR × S × -SR × -C × P
0681:
0682:                //unfortunately, Java3D doesn't defines all these fields and works "only" with 4x4 matrix
0683:                //a 4x4 matrix allows to perform translations, rotations, and scaling and shear effects.
0684:                //but no offset centering that we have to simulate
0685:
0686:                this .center = point3d;
0687:
0688:            }
0689:
0690:            /**
0691:             * Adds a child to this Joint.
0692:             * @param joint the Joint to be added to the hierarchy as a child of this Joint
0693:             * @exception IllegalArgumentException if this joint is an official Joint and the Joint to be added is a non standard Joint or if both Joints are official but joint is not an official child of this Joint.
0694:             * @see com.db.hanim.Joint#addJoint(Joint)
0695:             */
0696:            public void addChild(Joint joint) {
0697:
0698:                this .addJoint(joint);
0699:
0700:            }
0701:
0702:            /**
0703:             * Removes a child from this Joint.
0704:             * @param joint the Joint to be removed from the children list of this Joint
0705:             * @see com.db.hanim.Joint#removeJoint(String)
0706:             */
0707:            public void removeChild(Joint joint) {
0708:
0709:                this .removeJoint(joint);
0710:
0711:            }
0712:
0713:            //end of transformations kept for h-anim
0714:
0715:            /**
0716:             * Retrieves all children of this Joint
0717:             * @return the hashtable of all direct children of this Joint
0718:             */
0719:            public HashSet getChildren() {
0720:
0721:                return this .children;
0722:
0723:            }
0724:
0725:            /**
0726:             * Adds joint to the children list of this Joint. Identical to com.db.hanim.Joint#addChild(Joint)
0727:             * @param joint the Joint to be added from the children list of this Joint.
0728:             * @exception IllegalArgumentException if this joint is an official Joint and the Joint to be added is a non standard Joint or if both Joints are official but joint is not an official child of this Joint.
0729:             */
0730:            public void addJoint(Joint joint) {
0731:
0732:                HAnimJointTree hAnimJointTree;
0733:
0734:                if (Joint.getJointIdentifierNumber(this .getName()) != Joint.NonStandard) {
0735:                    if (Joint.getJointIdentifierNumber(joint.getName()) != Joint.NonStandard) {
0736:
0737:                        hAnimJointTree = new HAnimJointTree();
0738:
0739:                        if (hAnimJointTree.checkChild(this , joint)) {
0740:                            children.add(joint);
0741:                        } else {
0742:                            throw new java.lang.IllegalArgumentException(
0743:                                    "Child joint is not a child of this joint according to h-anim specification.");
0744:                        }
0745:
0746:                    } else {
0747:                        children.add(joint);
0748:                    }
0749:
0750:                } else {
0751:
0752:                    if (Joint.getJointIdentifierNumber(joint.getName()) != Joint.NonStandard) {
0753:                        throw new java.lang.IllegalArgumentException(
0754:                                "A standard joint cannot be the child of a non-standard joint.");
0755:                    } else {
0756:                        children.add(joint);
0757:                    }
0758:
0759:                }
0760:
0761:            }
0762:
0763:            /**
0764:             * Removes the Joint from the children list of this Joint. Identical to com.db.hanim.Joint#removeChild()
0765:             * @param joint the Joint to be removed from the children list of this Joint.
0766:             */
0767:            public void removeJoint(Joint joint) {
0768:
0769:                children.remove(joint);
0770:
0771:            }
0772:
0773:            /**
0774:             * Retrieves the Segment corresponding to this Joint
0775:             * @return the Segment that goes with this Joint
0776:             */
0777:            public Segment getSegment() {
0778:
0779:                return this .segment;
0780:
0781:            }
0782:
0783:            /**
0784:             * Sets the corresponding Segment of this Joint.
0785:             * @param segment the Segment to be associated with this Joint
0786:             * @exception IllegalArgumentException if joint is an official Joint and segment is not the corresponding Segment.
0787:             */
0788:            public void setSegment(Segment segment) {
0789:
0790:                if (Joint.getJointIdentifierNumber(this .getName()) != Joint.NonStandard) {
0791:                    if (Segment.getSegmentIdentifierName(
0792:                            this .getCorrespondingSegmentIdentifier()).equals(
0793:                            segment.getName())) {
0794:                        segment.setJoint(this );
0795:                        this .segment = segment;
0796:                    } else {
0797:                        throw new java.lang.IllegalArgumentException(
0798:                                "Child segment is not the child of this joint according to h-anim specification.");
0799:                    }
0800:                } else {
0801:                    segment.setJoint(this );
0802:                    this .segment = segment;
0803:                }
0804:
0805:            }
0806:
0807:            /**
0808:             * Gets the static identifier of the Segment that corresponds to this Joint. If no Segmemt is found matching the argument (the Joint isnot an official Joint) then the identifier Segment.NonStandard is returned
0809:             * @return the static identifier for the Segment that corresponds.
0810:             */
0811:            public int getCorrespondingSegmentIdentifier() {
0812:
0813:                //in fact numbers correspond between joints constants and Segment contants
0814:                //so we could replace this whole code by
0815:                //return this.getJointIdentifierNumber(this.getName());
0816:
0817:                switch (this .getJointIdentifierNumber(this .getName())) {
0818:                case Joint.HumanoidRoot:
0819:                    return Segment.sacrum;
0820:                case Joint.sacroiliac:
0821:                    return Segment.pelvis;
0822:                case Joint.l_hip:
0823:                    return Segment.l_thigh;
0824:                case Joint.l_knee:
0825:                    return Segment.l_calf;
0826:                case Joint.l_ankle:
0827:                    return Segment.l_hindfoot;
0828:                case Joint.l_subtalar:
0829:                    return Segment.l_midproximal;
0830:                case Joint.l_midtarsal:
0831:                    return Segment.l_middistal;
0832:                case Joint.l_metatarsal:
0833:                    return Segment.l_forefoot;
0834:                case Joint.r_hip:
0835:                    return Segment.r_thigh;
0836:                case Joint.r_knee:
0837:                    return Segment.r_calf;
0838:                case Joint.r_ankle:
0839:                    return Segment.r_hindfoot;
0840:                case Joint.r_subtalar:
0841:                    return Segment.r_midproximal;
0842:                case Joint.r_midtarsal:
0843:                    return Segment.r_middistal;
0844:                case Joint.r_metatarsal:
0845:                    return Segment.r_forefoot;
0846:                case Joint.vl5:
0847:                    return Segment.l5;
0848:                case Joint.vl4:
0849:                    return Segment.l4;
0850:                case Joint.vl3:
0851:                    return Segment.l3;
0852:                case Joint.vl2:
0853:                    return Segment.l2;
0854:                case Joint.vl1:
0855:                    return Segment.l1;
0856:                case Joint.vt12:
0857:                    return Segment.t12;
0858:                case Joint.vt11:
0859:                    return Segment.t11;
0860:                case Joint.vt10:
0861:                    return Segment.t10;
0862:                case Joint.vt9:
0863:                    return Segment.t9;
0864:                case Joint.vt8:
0865:                    return Segment.t8;
0866:                case Joint.vt7:
0867:                    return Segment.t7;
0868:                case Joint.vt6:
0869:                    return Segment.t6;
0870:                case Joint.vt5:
0871:                    return Segment.t5;
0872:                case Joint.vt4:
0873:                    return Segment.t4;
0874:                case Joint.vt3:
0875:                    return Segment.t3;
0876:                case Joint.vt2:
0877:                    return Segment.t2;
0878:                case Joint.vt1:
0879:                    return Segment.t1;
0880:                case Joint.vc7:
0881:                    return Segment.c7;
0882:                case Joint.vc6:
0883:                    return Segment.c6;
0884:                case Joint.vc5:
0885:                    return Segment.c5;
0886:                case Joint.vc4:
0887:                    return Segment.c4;
0888:                case Joint.vc3:
0889:                    return Segment.c3;
0890:                case Joint.vc2:
0891:                    return Segment.c2;
0892:                case Joint.vc1:
0893:                    return Segment.c1;
0894:                case Joint.skullbase:
0895:                    return Segment.skull;
0896:                case Joint.l_eyelid_joint:
0897:                    return Segment.l_eyelid;
0898:                case Joint.r_eyelid_joint:
0899:                    return Segment.r_eyelid;
0900:                case Joint.l_eyeball_joint:
0901:                    return Segment.l_eyeball;
0902:                case Joint.r_eyeball_joint:
0903:                    return Segment.r_eyeball;
0904:                case Joint.l_eyebrow_joint:
0905:                    return Segment.l_eyebrow;
0906:                case Joint.r_eyebrow_joint:
0907:                    return Segment.r_eyebrow;
0908:                case Joint.temporomandibular:
0909:                    return Segment.jaw;
0910:                case Joint.l_sternoclavicular:
0911:                    return Segment.l_clavicle;
0912:                case Joint.l_acromioclavicular:
0913:                    return Segment.l_scapula;
0914:                case Joint.l_shoulder:
0915:                    return Segment.l_upperarm;
0916:                case Joint.l_elbow:
0917:                    return Segment.l_forearm;
0918:                case Joint.l_wrist:
0919:                    return Segment.l_hand;
0920:                case Joint.l_thumb1:
0921:                    return Segment.l_thumb_metacarpal;
0922:                case Joint.l_thumb2:
0923:                    return Segment.l_thumb_proximal;
0924:                case Joint.l_thumb3:
0925:                    return Segment.l_thumb_distal;
0926:                case Joint.l_index0:
0927:                    return Segment.l_index_metacarpal;
0928:                case Joint.l_index1:
0929:                    return Segment.l_index_proximal;
0930:                case Joint.l_index2:
0931:                    return Segment.l_index_middle;
0932:                case Joint.l_index3:
0933:                    return Segment.l_index_distal;
0934:                case Joint.l_middle0:
0935:                    return Segment.l_middle_metacarpal;
0936:                case Joint.l_middle1:
0937:                    return Segment.l_middle_proximal;
0938:                case Joint.l_middle2:
0939:                    return Segment.l_middle_middle;
0940:                case Joint.l_middle3:
0941:                    return Segment.l_middle_distal;
0942:                case Joint.l_ring0:
0943:                    return Segment.l_ring_metacarpal;
0944:                case Joint.l_ring1:
0945:                    return Segment.l_ring_proximal;
0946:                case Joint.l_ring2:
0947:                    return Segment.l_ring_middle;
0948:                case Joint.l_ring3:
0949:                    return Segment.l_ring_distal;
0950:                case Joint.l_pinky0:
0951:                    return Segment.l_pinky_metacarpal;
0952:                case Joint.l_pinky1:
0953:                    return Segment.l_pinky_proximal;
0954:                case Joint.l_pinky2:
0955:                    return Segment.l_pinky_middle;
0956:                case Joint.l_pinky3:
0957:                    return Segment.l_pinky_distal;
0958:                case Joint.r_sternoclavicular:
0959:                    return Segment.r_clavicle;
0960:                case Joint.r_acromioclavicular:
0961:                    return Segment.r_scapula;
0962:                case Joint.r_shoulder:
0963:                    return Segment.r_upperarm;
0964:                case Joint.r_elbow:
0965:                    return Segment.r_forearm;
0966:                case Joint.r_wrist:
0967:                    return Segment.r_hand;
0968:                case Joint.r_thumb1:
0969:                    return Segment.r_thumb_metacarpal;
0970:                case Joint.r_thumb2:
0971:                    return Segment.r_thumb_proximal;
0972:                case Joint.r_thumb3:
0973:                    return Segment.r_thumb_distal;
0974:                case Joint.r_index0:
0975:                    return Segment.r_index_metacarpal;
0976:                case Joint.r_index1:
0977:                    return Segment.r_index_proximal;
0978:                case Joint.r_index2:
0979:                    return Segment.r_index_middle;
0980:                case Joint.r_index3:
0981:                    return Segment.r_index_distal;
0982:                case Joint.r_middle0:
0983:                    return Segment.r_middle_metacarpal;
0984:                case Joint.r_middle1:
0985:                    return Segment.r_middle_proximal;
0986:                case Joint.r_middle2:
0987:                    return Segment.r_middle_middle;
0988:                case Joint.r_middle3:
0989:                    return Segment.r_middle_distal;
0990:                case Joint.r_ring0:
0991:                    return Segment.r_ring_metacarpal;
0992:                case Joint.r_ring1:
0993:                    return Segment.r_ring_proximal;
0994:                case Joint.r_ring2:
0995:                    return Segment.r_ring_middle;
0996:                case Joint.r_ring3:
0997:                    return Segment.r_ring_distal;
0998:                case Joint.r_pinky0:
0999:                    return Segment.r_pinky_metacarpal;
1000:                case Joint.r_pinky1:
1001:                    return Segment.r_pinky_proximal;
1002:                case Joint.r_pinky2:
1003:                    return Segment.r_pinky_middle;
1004:                case Joint.r_pinky3:
1005:                    return Segment.r_pinky_distal;
1006:                default:
1007:                    return Segment.NonStandard;
1008:                }
1009:
1010:            }
1011:
1012:            /**
1013:             * Gets the official Segment name of the Segment that corresponds to this Joint. If no Segmemt is found matching the argument (the Joint is not an official Joint) then an empty String is returned
1014:             * @return the name for the Segment that corresponds.
1015:             */
1016:            public String getCorrespondingSegmentName() {
1017:                //returns the corresponding segment name if one exists
1018:
1019:                return Segment.getSegmentIdentifierName(this 
1020:                        .getCorrespondingSegmentIdentifier());
1021:
1022:            }
1023:
1024:            /**
1025:             * Builds up a new Segment using the official Segment that corresponds to that Joint. Use getSegment() to get the resulting Segment is it can be built.
1026:             */
1027:            public void useCorrespondingSegment() {
1028:                //builds corresponding segment is one exists else null pointer exception
1029:
1030:                this .setSegment(this .getCorrespondingSegment());
1031:
1032:            }
1033:
1034:            /**
1035:             * Builds up a new Segment using the official Segment that corresponds to that Joint. Does not assign the Segment to this Joint.
1036:             * @return the Segment that corresponds to that Joint.
1037:             */
1038:            public Segment getCorrespondingSegment() {
1039:                //returns a new segment if one exists
1040:
1041:                String name;
1042:                Segment segment;
1043:
1044:                segment = null;
1045:
1046:                name = this .getCorrespondingSegmentName();
1047:                if (name != "") {
1048:                    segment = new Segment(name);
1049:                }
1050:
1051:                return segment;
1052:
1053:            }
1054:
1055:            /**
1056:             * Sets the translation used for this Joint to the default value OF THE CENTER proposed by H-Anim. This is to smooth up transition to Java3D. Note that only the translation component of the Transform3D that is set.
1057:             */
1058:            public void useDefaultCenterAsTranslation() {
1059:
1060:                Point3d point3d;
1061:
1062:                //could be more efficient if we did the operation directly but class would get bigger
1063:                point3d = new Point3d();
1064:                this .getDefaultCenter(point3d);
1065:                this .transform3D.setTranslation(new Vector3d(point3d.x,
1066:                        point3d.y, point3d.z));
1067:
1068:            }
1069:
1070:            /**
1071:             * Sets the default center used for this Joint to the default value proposed by H-Anim.
1072:             */
1073:            public void useDefaultCenter() {
1074:
1075:                Point3d point3d;
1076:
1077:                point3d = new Point3d();
1078:                this .getDefaultCenter(point3d);
1079:                this .setCenter(point3d);
1080:
1081:            }
1082:
1083:            /**
1084:             * Gets the static identifier for the String name passed as argument. If no Joint is found matching the argument then the identifier Joint.NonStandard is returned
1085:             * @param String the name of the Joint to get the identifier from
1086:             * @return the static identifier for the Joint named jointName
1087:             * @see com.db.hanim.Joint#getJointIdentifierName(int)
1088:             */
1089:            public static int getJointIdentifierNumber(String jointName) {
1090:
1091:                if (jointName.equals("HumanoidRoot")) {
1092:                    return Joint.HumanoidRoot;
1093:                } else if (jointName.equals("sacroiliac")) {
1094:                    return Joint.sacroiliac;
1095:                } else if (jointName.equals("l_hip")) {
1096:                    return Joint.l_hip;
1097:                } else if (jointName.equals("l_knee")) {
1098:                    return Joint.l_knee;
1099:                } else if (jointName.equals("l_ankle")) {
1100:                    return Joint.l_ankle;
1101:                } else if (jointName.equals("l_subtalar")) {
1102:                    return Joint.l_subtalar;
1103:                } else if (jointName.equals("l_midtarsal")) {
1104:                    return Joint.l_midtarsal;
1105:                } else if (jointName.equals("l_metatarsal")) {
1106:                    return Joint.l_metatarsal;
1107:                } else if (jointName.equals("r_hip")) {
1108:                    return Joint.r_hip;
1109:                } else if (jointName.equals("r_knee")) {
1110:                    return Joint.r_knee;
1111:                } else if (jointName.equals("r_ankle")) {
1112:                    return Joint.r_ankle;
1113:                } else if (jointName.equals("r_subtalar")) {
1114:                    return Joint.r_subtalar;
1115:                } else if (jointName.equals("r_midtarsal")) {
1116:                    return Joint.r_midtarsal;
1117:                } else if (jointName.equals("r_metatarsal")) {
1118:                    return Joint.r_metatarsal;
1119:                } else if (jointName.equals("vl5")) {
1120:                    return Joint.vl5;
1121:                } else if (jointName.equals("vl4")) {
1122:                    return Joint.vl4;
1123:                } else if (jointName.equals("vl3")) {
1124:                    return Joint.vl3;
1125:                } else if (jointName.equals("vl2")) {
1126:                    return Joint.vl2;
1127:                } else if (jointName.equals("vl1")) {
1128:                    return Joint.vl1;
1129:                } else if (jointName.equals("vt12")) {
1130:                    return Joint.vt12;
1131:                } else if (jointName.equals("vt11")) {
1132:                    return Joint.vt11;
1133:                } else if (jointName.equals("vt10")) {
1134:                    return Joint.vt10;
1135:                } else if (jointName.equals("vt9")) {
1136:                    return Joint.vt9;
1137:                } else if (jointName.equals("vt8")) {
1138:                    return Joint.vt8;
1139:                } else if (jointName.equals("vt7")) {
1140:                    return Joint.vt7;
1141:                } else if (jointName.equals("vt6")) {
1142:                    return Joint.vt6;
1143:                } else if (jointName.equals("vt5")) {
1144:                    return Joint.vt5;
1145:                } else if (jointName.equals("vt4")) {
1146:                    return Joint.vt4;
1147:                } else if (jointName.equals("vt3")) {
1148:                    return Joint.vt3;
1149:                } else if (jointName.equals("vt2")) {
1150:                    return Joint.vt2;
1151:                } else if (jointName.equals("vt1")) {
1152:                    return Joint.vt1;
1153:                } else if (jointName.equals("vc7")) {
1154:                    return Joint.vc7;
1155:                } else if (jointName.equals("vc6")) {
1156:                    return Joint.vc6;
1157:                } else if (jointName.equals("vc5")) {
1158:                    return Joint.vc5;
1159:                } else if (jointName.equals("vc4")) {
1160:                    return Joint.vc4;
1161:                } else if (jointName.equals("vc3")) {
1162:                    return Joint.vc3;
1163:                } else if (jointName.equals("vc2")) {
1164:                    return Joint.vc2;
1165:                } else if (jointName.equals("vc1")) {
1166:                    return Joint.vc1;
1167:                } else if (jointName.equals("skullbase")) {
1168:                    return Joint.skullbase;
1169:                } else if (jointName.equals("l_eyelid_joint")) {
1170:                    return Joint.l_eyelid_joint;
1171:                } else if (jointName.equals("r_eyelid_joint")) {
1172:                    return Joint.r_eyelid_joint;
1173:                } else if (jointName.equals("l_eyeball_joint")) {
1174:                    return Joint.l_eyeball_joint;
1175:                } else if (jointName.equals("r_eyeball_joint")) {
1176:                    return Joint.r_eyeball_joint;
1177:                } else if (jointName.equals("l_eyebrow_joint")) {
1178:                    return Joint.l_eyebrow_joint;
1179:                } else if (jointName.equals("r_eyebrow_joint")) {
1180:                    return Joint.r_eyebrow_joint;
1181:                } else if (jointName.equals("temporomandibular")) {
1182:                    return Joint.temporomandibular;
1183:                } else if (jointName.equals("l_sternoclavicular")) {
1184:                    return Joint.l_sternoclavicular;
1185:                } else if (jointName.equals("l_acromioclavicular")) {
1186:                    return Joint.l_acromioclavicular;
1187:                } else if (jointName.equals("l_shoulder")) {
1188:                    return Joint.l_shoulder;
1189:                } else if (jointName.equals("l_elbow")) {
1190:                    return Joint.l_elbow;
1191:                } else if (jointName.equals("l_wrist")) {
1192:                    return Joint.l_wrist;
1193:                } else if (jointName.equals("l_thumb1")) {
1194:                    return Joint.l_thumb1;
1195:                } else if (jointName.equals("l_thumb2")) {
1196:                    return Joint.l_thumb2;
1197:                } else if (jointName.equals("l_thumb3")) {
1198:                    return Joint.l_thumb3;
1199:                } else if (jointName.equals("l_index0")) {
1200:                    return Joint.l_index0;
1201:                } else if (jointName.equals("l_index1")) {
1202:                    return Joint.l_index1;
1203:                } else if (jointName.equals("l_index2")) {
1204:                    return Joint.l_index2;
1205:                } else if (jointName.equals("l_index3")) {
1206:                    return Joint.l_index3;
1207:                } else if (jointName.equals("l_middle0")) {
1208:                    return Joint.l_middle0;
1209:                } else if (jointName.equals("l_middle1")) {
1210:                    return Joint.l_middle1;
1211:                } else if (jointName.equals("l_middle2")) {
1212:                    return Joint.l_middle2;
1213:                } else if (jointName.equals("l_middle3")) {
1214:                    return Joint.l_middle3;
1215:                } else if (jointName.equals("l_ring0")) {
1216:                    return Joint.l_ring0;
1217:                } else if (jointName.equals("l_ring1")) {
1218:                    return Joint.l_ring1;
1219:                } else if (jointName.equals("l_ring2")) {
1220:                    return Joint.l_ring2;
1221:                } else if (jointName.equals("l_ring3")) {
1222:                    return Joint.l_ring3;
1223:                } else if (jointName.equals("l_pinky0")) {
1224:                    return Joint.l_pinky0;
1225:                } else if (jointName.equals("l_pinky1")) {
1226:                    return Joint.l_pinky1;
1227:                } else if (jointName.equals("l_pinky2")) {
1228:                    return Joint.l_pinky2;
1229:                } else if (jointName.equals("l_pinky3")) {
1230:                    return Joint.l_pinky3;
1231:                } else if (jointName.equals("r_sternoclavicular")) {
1232:                    return Joint.r_sternoclavicular;
1233:                } else if (jointName.equals("r_acromioclavicular")) {
1234:                    return Joint.r_acromioclavicular;
1235:                } else if (jointName.equals("r_shoulder")) {
1236:                    return Joint.r_shoulder;
1237:                } else if (jointName.equals("r_elbow")) {
1238:                    return Joint.r_elbow;
1239:                } else if (jointName.equals("r_wrist")) {
1240:                    return Joint.r_wrist;
1241:                } else if (jointName.equals("r_thumb1")) {
1242:                    return Joint.r_thumb1;
1243:                } else if (jointName.equals("r_thumb2")) {
1244:                    return Joint.r_thumb2;
1245:                } else if (jointName.equals("r_thumb3")) {
1246:                    return Joint.r_thumb3;
1247:                } else if (jointName.equals("r_index0")) {
1248:                    return Joint.r_index0;
1249:                } else if (jointName.equals("r_index1")) {
1250:                    return Joint.r_index1;
1251:                } else if (jointName.equals("r_index2")) {
1252:                    return Joint.r_index2;
1253:                } else if (jointName.equals("r_index3")) {
1254:                    return Joint.r_index3;
1255:                } else if (jointName.equals("r_middle0")) {
1256:                    return Joint.r_middle0;
1257:                } else if (jointName.equals("r_middle1")) {
1258:                    return Joint.r_middle1;
1259:                } else if (jointName.equals("r_middle2")) {
1260:                    return Joint.r_middle2;
1261:                } else if (jointName.equals("r_middle3")) {
1262:                    return Joint.r_middle3;
1263:                } else if (jointName.equals("r_ring0")) {
1264:                    return Joint.r_ring0;
1265:                } else if (jointName.equals("r_ring1")) {
1266:                    return Joint.r_ring1;
1267:                } else if (jointName.equals("r_ring2")) {
1268:                    return Joint.r_ring2;
1269:                } else if (jointName.equals("r_ring3")) {
1270:                    return Joint.r_ring3;
1271:                } else if (jointName.equals("r_pinky0")) {
1272:                    return Joint.r_pinky0;
1273:                } else if (jointName.equals("r_pinky1")) {
1274:                    return Joint.r_pinky1;
1275:                } else if (jointName.equals("r_pinky2")) {
1276:                    return Joint.r_pinky2;
1277:                } else if (jointName.equals("r_pinky3")) {
1278:                    return Joint.r_pinky3;
1279:                } else
1280:                    return Joint.NonStandard;
1281:
1282:            }
1283:
1284:            /**
1285:             * Gets the official Joint name for the static identifier passed as argument. If no Joint is found matching the argument then a new empty String is returned.
1286:             * @param the static identifier for the Joint named jointName
1287:             * @return String the name of the Joint to get the identifier from
1288:             * @see com.db.hanim.Joint#getJointIdentifierNumber(String)
1289:             */
1290:            public static String getJointIdentifierName(int value) {
1291:
1292:                switch (value) {
1293:                case Joint.HumanoidRoot:
1294:                    return new String("HumanoidRoot");
1295:                case Joint.sacroiliac:
1296:                    return new String("sacroiliac");
1297:                case Joint.l_hip:
1298:                    return new String("l_hip");
1299:                case Joint.l_knee:
1300:                    return new String("l_knee");
1301:                case Joint.l_ankle:
1302:                    return new String("l_ankle");
1303:                case Joint.l_subtalar:
1304:                    return new String("l_subtalar");
1305:                case Joint.l_midtarsal:
1306:                    return new String("l_midtarsal");
1307:                case Joint.l_metatarsal:
1308:                    return new String("l_metatarsal");
1309:                case Joint.r_hip:
1310:                    return new String("r_hip");
1311:                case Joint.r_knee:
1312:                    return new String("r_knee");
1313:                case Joint.r_ankle:
1314:                    return new String("r_ankle");
1315:                case Joint.r_subtalar:
1316:                    return new String("r_subtalar");
1317:                case Joint.r_midtarsal:
1318:                    return new String("r_midtarsal");
1319:                case Joint.r_metatarsal:
1320:                    return new String("r_metatarsal");
1321:                case Joint.vl5:
1322:                    return new String("vl5");
1323:                case Joint.vl4:
1324:                    return new String("vl4");
1325:                case Joint.vl3:
1326:                    return new String("vl3");
1327:                case Joint.vl2:
1328:                    return new String("vl2");
1329:                case Joint.vl1:
1330:                    return new String("vl1");
1331:                case Joint.vt12:
1332:                    return new String("vt12");
1333:                case Joint.vt11:
1334:                    return new String("vt11");
1335:                case Joint.vt10:
1336:                    return new String("vt10");
1337:                case Joint.vt9:
1338:                    return new String("vt9");
1339:                case Joint.vt8:
1340:                    return new String("vt8");
1341:                case Joint.vt7:
1342:                    return new String("vt7");
1343:                case Joint.vt6:
1344:                    return new String("vt6");
1345:                case Joint.vt5:
1346:                    return new String("vt5");
1347:                case Joint.vt4:
1348:                    return new String("vt4");
1349:                case Joint.vt3:
1350:                    return new String("vt3");
1351:                case Joint.vt2:
1352:                    return new String("vt2");
1353:                case Joint.vt1:
1354:                    return new String("vt1");
1355:                case Joint.vc7:
1356:                    return new String("vc7");
1357:                case Joint.vc6:
1358:                    return new String("vc6");
1359:                case Joint.vc5:
1360:                    return new String("vc5");
1361:                case Joint.vc4:
1362:                    return new String("vc4");
1363:                case Joint.vc3:
1364:                    return new String("vc3");
1365:                case Joint.vc2:
1366:                    return new String("vc2");
1367:                case Joint.vc1:
1368:                    return new String("vc1");
1369:                case Joint.skullbase:
1370:                    return new String("skullbase");
1371:                case Joint.l_eyelid_joint:
1372:                    return new String("l_eyelid_joint");
1373:                case Joint.r_eyelid_joint:
1374:                    return new String("r_eyelid_joint");
1375:                case Joint.l_eyeball_joint:
1376:                    return new String("l_eyeball_joint");
1377:                case Joint.r_eyeball_joint:
1378:                    return new String("r_eyeball_joint");
1379:                case Joint.l_eyebrow_joint:
1380:                    return new String("l_eyebrow_joint");
1381:                case Joint.r_eyebrow_joint:
1382:                    return new String("r_eyebrow_joint");
1383:                case Joint.temporomandibular:
1384:                    return new String("temporomandibular");
1385:                case Joint.l_sternoclavicular:
1386:                    return new String("l_sternoclavicular");
1387:                case Joint.l_acromioclavicular:
1388:                    return new String("l_acromioclavicular");
1389:                case Joint.l_shoulder:
1390:                    return new String("l_shoulder");
1391:                case Joint.l_elbow:
1392:                    return new String("l_elbow");
1393:                case Joint.l_wrist:
1394:                    return new String("l_wrist");
1395:                case Joint.l_thumb1:
1396:                    return new String("l_thumb1");
1397:                case Joint.l_thumb2:
1398:                    return new String("l_thumb2");
1399:                case Joint.l_thumb3:
1400:                    return new String("l_thumb3");
1401:                case Joint.l_index0:
1402:                    return new String("l_index0");
1403:                case Joint.l_index1:
1404:                    return new String("l_index1");
1405:                case Joint.l_index2:
1406:                    return new String("l_index2");
1407:                case Joint.l_index3:
1408:                    return new String("l_index3");
1409:                case Joint.l_middle0:
1410:                    return new String("l_middle0");
1411:                case Joint.l_middle1:
1412:                    return new String("l_middle1");
1413:                case Joint.l_middle2:
1414:                    return new String("l_middle2");
1415:                case Joint.l_middle3:
1416:                    return new String("l_middle3");
1417:                case Joint.l_ring0:
1418:                    return new String("l_ring0");
1419:                case Joint.l_ring1:
1420:                    return new String("l_ring1");
1421:                case Joint.l_ring2:
1422:                    return new String("l_ring2");
1423:                case Joint.l_ring3:
1424:                    return new String("l_ring3");
1425:                case Joint.l_pinky0:
1426:                    return new String("l_pinky0");
1427:                case Joint.l_pinky1:
1428:                    return new String("l_pinky1");
1429:                case Joint.l_pinky2:
1430:                    return new String("l_pinky2");
1431:                case Joint.l_pinky3:
1432:                    return new String("l_pinky3");
1433:                case Joint.r_sternoclavicular:
1434:                    return new String("r_sternoclavicular");
1435:                case Joint.r_acromioclavicular:
1436:                    return new String("r_acromioclavicular");
1437:                case Joint.r_shoulder:
1438:                    return new String("r_shoulder");
1439:                case Joint.r_elbow:
1440:                    return new String("r_elbow");
1441:                case Joint.r_wrist:
1442:                    return new String("r_wrist");
1443:                case Joint.r_thumb1:
1444:                    return new String("r_thumb1");
1445:                case Joint.r_thumb2:
1446:                    return new String("r_thumb2");
1447:                case Joint.r_thumb3:
1448:                    return new String("r_thumb3");
1449:                case Joint.r_index0:
1450:                    return new String("r_index0");
1451:                case Joint.r_index1:
1452:                    return new String("r_index1");
1453:                case Joint.r_index2:
1454:                    return new String("r_index2");
1455:                case Joint.r_index3:
1456:                    return new String("r_index3");
1457:                case Joint.r_middle0:
1458:                    return new String("r_middle0");
1459:                case Joint.r_middle1:
1460:                    return new String("r_middle1");
1461:                case Joint.r_middle2:
1462:                    return new String("r_middle2");
1463:                case Joint.r_middle3:
1464:                    return new String("r_middle3");
1465:                case Joint.r_ring0:
1466:                    return new String("r_ring0");
1467:                case Joint.r_ring1:
1468:                    return new String("r_ring1");
1469:                case Joint.r_ring2:
1470:                    return new String("r_ring2");
1471:                case Joint.r_ring3:
1472:                    return new String("r_ring3");
1473:                case Joint.r_pinky0:
1474:                    return new String("r_pinky0");
1475:                case Joint.r_pinky1:
1476:                    return new String("r_pinky1");
1477:                case Joint.r_pinky2:
1478:                    return new String("r_pinky2");
1479:                case Joint.r_pinky3:
1480:                    return new String("r_pinky3");
1481:                default:
1482:                    return new String("");
1483:                }
1484:
1485:            }
1486:
1487:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.