Source Code Cross Referenced for Collision.java in  » 6.0-JDK-Modules » java-3d » org » jdesktop » j3d » loaders » vrml97 » impl » 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 » org.jdesktop.j3d.loaders.vrml97.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $RCSfile: Collision.java,v $
003:         *
004:         *      @(#)Collision.java 1.18 98/11/05 20:34:07
005:         *
006:         * Copyright (c) 1996-1998 Sun Microsystems, Inc. All Rights Reserved.
007:         *
008:         * Sun grants you ("Licensee") a non-exclusive, royalty free, license to use,
009:         * modify and redistribute this software in source and binary code form,
010:         * provided that i) this copyright notice and license appear on all copies of
011:         * the software; and ii) Licensee does not utilize the software in a manner
012:         * which is disparaging to Sun.
013:         *
014:         * This software is provided "AS IS," without a warranty of any kind. ALL
015:         * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
016:         * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
017:         * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE
018:         * LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
019:         * OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS
020:         * LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
021:         * INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
022:         * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
023:         * OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
024:         * POSSIBILITY OF SUCH DAMAGES.
025:         *
026:         * This software is not designed or intended for use in on-line control of
027:         * aircraft, air traffic, aircraft navigation or aircraft communications; or in
028:         * the design, construction, operation or maintenance of any nuclear
029:         * facility. Licensee represents and warrants that it will not use or
030:         * redistribute the Software for such purposes.
031:         *
032:         * $Revision: 1.2 $
033:         * $Date: 2005/02/03 23:06:52 $
034:         * $State: Exp $
035:         */
036:        /*
037:         *@Author:  Rick Goldberg
038:         *@Author:  Doug Gehringer
039:         */
040:        package org.jdesktop.j3d.loaders.vrml97.impl;
041:
042:        /**  Description of the Class */
043:        public class Collision extends Group {
044:            // eventIn MFNode addChildren from Group
045:            // eventIn MFNode removeChildren from Group
046:            // exposedField MFNode children [] from Group
047:            // field SFVec3f bboxCenter from Group
048:            // field SFVec3f bboxSize from Group
049:
050:            // exposedField
051:            SFBool collide;
052:
053:            // field
054:            SFNode proxy;// the proxy geometry for collision detection, not drawn
055:
056:            // eventOut
057:            SFTime collideTime;
058:
059:            javax.media.j3d.Group impl;
060:
061:            /**
062:             *Constructor for the Collision object
063:             *
064:             *@param  loader Description of the Parameter
065:             */
066:            public Collision(Loader loader) {
067:                super (loader);
068:
069:                // exposedField
070:                collide = new SFBool(true);
071:
072:                // need to turn detection on or off ( which means add or subtract
073:                // this proxy from the avatars collide list
074:                proxy = new SFNode(null);
075:
076:                // eventOut
077:                collideTime = new SFTime(0.0);
078:
079:                initCollisionFields();
080:            }
081:
082:            /**
083:             *Constructor for the Collision object
084:             *
085:             *@param  loader Description of the Parameter
086:             *@param  children Description of the Parameter
087:             *@param  bboxCenter Description of the Parameter
088:             *@param  bboxSize Description of the Parameter
089:             *@param  collide Description of the Parameter
090:             *@param  proxy Description of the Parameter
091:             */
092:            Collision(Loader loader, MFNode children, SFVec3f bboxCenter,
093:                    SFVec3f bboxSize, SFBool collide, SFNode proxy) {
094:                super (loader, children, bboxCenter, bboxSize);
095:                this .collide = collide;
096:                this .proxy = proxy;
097:
098:                collideTime = new SFTime(0.0);
099:
100:                initCollisionFields();
101:            }
102:
103:            /**  Description of the Method */
104:            void initImpl() {
105:                impl = new javax.media.j3d.Group();
106:                impl.setCapability(javax.media.j3d.Group.ALLOW_CHILDREN_READ);
107:                impl.setCapability(javax.media.j3d.Group.ALLOW_CHILDREN_WRITE);
108:                impl.setCapability(javax.media.j3d.Group.ALLOW_CHILDREN_EXTEND);
109:                impl
110:                        .setCapability(javax.media.j3d.Node.ALLOW_LOCAL_TO_VWORLD_READ);
111:                implNode = implGroup = impl;
112:                super .replaceChildren();// init the implGroup for clone()
113:                implReady = true;
114:            }
115:
116:            /**
117:             *  Description of the Method
118:             *
119:             *@param  eventInName Description of the Parameter
120:             *@param  time Description of the Parameter
121:             */
122:            public void notifyMethod(String eventInName, double time) {
123:                if (eventInName == "collide") {
124:                    //SFBool collideOn = (SFBool)FieldSpec.get(eventInName);
125:                    // if collideOn check avatars collide list if not there add to it
126:                    // otherwise remove it.
127:                    if (collide.getValue() == true) {
128:                        ;
129:                    } else {
130:                        ;
131:                    }
132:                } else {
133:                    super .notifyMethod(eventInName, time);
134:                }
135:            }
136:
137:            /**
138:             *  Gets the type attribute of the Collision object
139:             *
140:             *@return  The type value
141:             */
142:            public String getType() {
143:                return "Collision";
144:            }
145:
146:            /**  Description of the Method */
147:            void initCollisionFields() {
148:                collide.init(this , FieldSpec, Field.EXPOSED_FIELD, "collide");
149:                proxy.init(this , FieldSpec, Field.FIELD, "proxy");
150:                collideTime.init(this , FieldSpec, Field.EVENT_OUT,
151:                        "collideTime");
152:            }
153:
154:            /**
155:             *  Description of the Method
156:             *
157:             *@return  Description of the Return Value
158:             */
159:            public Object clone() {
160:                return new Collision(loader, (MFNode) children.clone(),
161:                        (SFVec3f) bboxCenter.clone(), (SFVec3f) bboxSize
162:                                .clone(), (SFBool) collide.clone(),
163:                        (SFNode) proxy.clone());
164:            }
165:
166:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.