You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(7) |
Jul
(26) |
Aug
(85) |
Sep
(141) |
Oct
(85) |
Nov
(60) |
Dec
(29) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(38) |
Feb
(78) |
Mar
(10) |
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <tre...@us...> - 2007-10-19 17:15:36
|
Revision: 518
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=518&view=rev
Author: trevorolio
Date: 2007-10-19 10:15:31 -0700 (Fri, 19 Oct 2007)
Log Message:
-----------
Sitting framework pretty much done for now, though the avatars need better animations and a fix for Mike's baggy butt when sitting.
Added seat metadata editing to templateEditor.html
Handled the cases of a thing or user involved in a sit being reloaded or removed from a space.
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Space.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DThingRenderable.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Space.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Space.java 2007-10-19 17:15:26 UTC (rev 517)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Space.java 2007-10-19 17:15:31 UTC (rev 518)
@@ -381,6 +381,12 @@
public void removeThing(Thing thing) {
synchronized (this) {
+ User[] users = getUsers();
+ for (int i = 0; i < users.length; i++) {
+ if(users[i].getSeat() == thing){
+ users[i].setSeat(null);
+ }
+ }
if (things.remove(new Long(thing.getThingID())) == null) {
return;
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java 2007-10-19 17:15:26 UTC (rev 517)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java 2007-10-19 17:15:31 UTC (rev 518)
@@ -347,6 +347,10 @@
}
try {
J3DThingRenderable renderable = (J3DThingRenderable) getThingRenderable(thing.getThingID());
+ if (renderable.getSitters().length > 0) {
+ System.err.println("Cannot reload things which have avatars seated upon them.");
+ return;
+ }
if (renderable != null) {
physicsBehavior.stopRenderableMotion(renderable);
J3DShapeRenderable[] shapeRenderables = renderable.getShapeRenderables();
@@ -396,8 +400,8 @@
Thing seat = user.getSeat();
if (seat != null) {
- J3DThingRenderable thingRenderable = (J3DThingRenderable)getThingRenderable(seat.getThingID());
- if(thingRenderable == null){
+ J3DThingRenderable thingRenderable = (J3DThingRenderable) getThingRenderable(seat.getThingID());
+ if (thingRenderable == null) {
Log.error("Error: tried to add a user sitting on an unknown thing: " + seat);
return;
}
@@ -469,7 +473,7 @@
J3DThingRenderable thingRenderable = (J3DThingRenderable) getThingRenderable(oldSeat.getThingID());
if (thingRenderable == null) { //haven't loaded the thing renderable
return;
- }
+ }
thingRenderable.removeSitter(userRenderable);
usersGroup.addChild(userRenderable);
}
@@ -604,7 +608,12 @@
return;
}
physicsBehavior.stopRenderableMotion(renderable);
- usersGroup.removeChild((J3DUserRenderable) renderable);
+ if (renderable.getUser().getSeat() == null) {
+ usersGroup.removeChild((J3DUserRenderable) renderable);
+ } else {
+ J3DThingRenderable thingRenderable = (J3DThingRenderable)getThingRenderable(renderable.getUser().getSeat().getThingID());
+ thingRenderable.removeSitter((J3DUserRenderable)renderable);
+ }
((J3DUserRenderable) renderable).cleanup();
}
@@ -621,12 +630,12 @@
}
children = worldGroup.getAllChildren();
J3DUserRenderable result = null;
- while(children.hasMoreElements()){
+ while (children.hasMoreElements()) {
Node node = (Node) children.nextElement();
if (node instanceof J3DThingRenderable) {
J3DThingRenderable group = (J3DThingRenderable) node;
result = group.getSitter(username);
- if(result != null){
+ if (result != null) {
return result;
}
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DThingRenderable.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DThingRenderable.java 2007-10-19 17:15:26 UTC (rev 517)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DThingRenderable.java 2007-10-19 17:15:31 UTC (rev 518)
@@ -16,6 +16,7 @@
import java.util.Enumeration;
import java.util.HashMap;
+import java.util.Vector;
import javax.media.j3d.BoundingSphere;
import javax.media.j3d.BranchGroup;
@@ -164,16 +165,24 @@
}
public J3DUserRenderable getSitter(String username) {
+ J3DUserRenderable[] sitters = getSitters();
+ for (int i = 0; i < sitters.length; i++) {
+ if(sitters[i].getUser().getUsername().equals(username)){
+ return sitters[i];
+ }
+ }
+ return null;
+ }
+
+ public J3DUserRenderable[] getSitters() {
Enumeration children = transformGroup.getAllChildren();
+ Vector results = new Vector();
while(children.hasMoreElements()){
Node node = (Node) children.nextElement();
if (node instanceof J3DUserRenderable) {
- J3DUserRenderable userRenderable = (J3DUserRenderable)node;
- if(userRenderable.getUser().getUsername().equals(username)){
- return userRenderable;
- }
+ results.add(node);
}
}
- return null;
+ return (J3DUserRenderable[])results.toArray(new J3DUserRenderable[0]);
}
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-19 17:15:22
|
Revision: 517
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=517&view=rev
Author: trevorolio
Date: 2007-10-19 10:15:26 -0700 (Fri, 19 Oct 2007)
Log Message:
-----------
Sitting framework pretty much done for now, though the avatars need better animations and a fix for Mike's baggy butt when sitting.
Added seat metadata editing to templateEditor.html
Handled the cases of a thing or user involved in a sit being reloaded or removed from a space.
Modified Paths:
--------------
maven/trunk/ogoglio-server/src/main/resources/siteTemplates/templateEditor.html
Modified: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/templateEditor.html
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/siteTemplates/templateEditor.html 2007-10-19 00:58:59 UTC (rev 516)
+++ maven/trunk/ogoglio-server/src/main/resources/siteTemplates/templateEditor.html 2007-10-19 17:15:26 UTC (rev 517)
@@ -18,6 +18,32 @@
width: 100%;
}
+#northDiv {
+ width: 500px;
+ border-right: 250px solid #FFF;
+ margin-right: -250px;
+ float: left;
+}
+
+#rail {
+ background-color: #FFF;
+ width: 250px;
+ float: left;
+}
+
+#seatDiv h3 form {
+ display: inline;
+}
+
+#seatPositionForm {
+ margin-right: 30px;
+ text-align: right;
+}
+#seatRotationForm {
+ margin-right: 30px;
+ text-align: right;
+}
+
.section {
border: solid 1px #CCD;
border-top: solid 5px #CCD;
@@ -37,6 +63,9 @@
var resourceForm = null;
var currentResourcesDiv = null;
var objMessage = null;
+var seatCheckbox = null;
+var seatPositionForm = null;
+var seatRotationForm = null;
var scriptEditor = null;
@@ -88,6 +117,21 @@
}
currentResourcesDiv.innerHTML = resourceHTML;
objMessage.innerHTML = geometryMessage;
+ seatCheckbox.checked = templateDoc.getAttribute("seat") == "true";
+ seatPositionForm["seatX"].value = parseFloat(templateDoc.getAttribute("seatx")).toFixed(2);
+ seatPositionForm["seatY"].value = parseFloat(templateDoc.getAttribute("seaty")).toFixed(2);
+ seatPositionForm["seatZ"].value = parseFloat(templateDoc.getAttribute("seatz")).toFixed(2);
+
+ var rw = parseFloat(templateDoc.getAttribute("seatrw")).toFixed(2);
+ var rx = parseFloat(templateDoc.getAttribute("seatrx")).toFixed(2);
+ var ry = parseFloat(templateDoc.getAttribute("seatry")).toFixed(2);
+ var rz = parseFloat(templateDoc.getAttribute("seatrz")).toFixed(2);
+ var quat = new Quaternion(rw, rx, ry, rz);
+ var euler = quat.getEuler();
+ seatRotationForm["seatRotX"].value = euler[0].toFixed(2);
+ seatRotationForm["seatRotY"].value = euler[1].toFixed(2);
+ seatRotationForm["seatRotZ"].value = euler[2].toFixed(2);
+
}
function deleteObjGeometry0Go(){
@@ -164,6 +208,39 @@
requestTemplate(authedUsername, templateID, handleTemplateDocument);
}
+function updateSeatSettingsGo(){
+ if(templateDoc == null){
+ return;
+ }
+ var isASeat = seatCheckbox.checked;
+ var seatX = +seatPositionForm["seatX"].value;
+ var seatY = +seatPositionForm["seatY"].value;
+ var seatZ = +seatPositionForm["seatZ"].value;
+ var seatRotX = +seatRotationForm["seatRotX"].value;
+ var seatRotY = +seatRotationForm["seatRotY"].value;
+ var seatRotZ = +seatRotationForm["seatRotZ"].value;
+
+ if(isNaN(seatX) || isNaN(seatY) || isNaN(seatX) || isNaN(seatRotX) || isNaN(seatRotY) || isNaN(seatZ)){
+ alert("Bad position or ratation (not a number)");
+ return;
+ }
+
+ templateDoc.setAttribute("seat", isASeat);
+
+ templateDoc.setAttribute("seatx", seatX);
+ templateDoc.setAttribute("seaty", seatY);
+ templateDoc.setAttribute("seatz", seatZ);
+
+ var rotQuat = new Quaternion();
+ rotQuat.setEuler(seatRotX, seatRotY, seatRotZ);
+ templateDoc.setAttribute("seatrw", rotQuat.w);
+ templateDoc.setAttribute("seatrx", rotQuat.x);
+ templateDoc.setAttribute("seatry", rotQuat.y);
+ templateDoc.setAttribute("seatrz", rotQuat.z);
+
+ updateTemplate(templateDoc, handleTemplateDocument);
+}
+
function init(){
populateMemberMenuItem();
mainElement = document.getElementById("main");
@@ -174,6 +251,9 @@
resourceForm = document.getElementById('resourceForm');
currentResourcesDiv = document.getElementById("currentResources");
objMessage = document.getElementById("objMessage");
+ seatCheckbox = document.getElementById("seatCheckbox");
+ seatPositionForm = document.getElementById("seatPositionForm");
+ seatRotationForm = document.getElementById("seatRotationForm");
scriptEditor = document.getElementById('scriptEditor');
@@ -208,29 +288,50 @@
<form id="titleForm" onsubmit="titleFormGo(); return false;"><h1 id="title">Template: loading...</h1></form>
<div id="content">
+ <div id="northDiv">
+ <div class="section">
+ <h3>Geometry:</h3>
+ <p>
+ <h4>Obj file:</h4>
+ <span id="objMessage"></span>
+ <form id="obj0Form" onsubmit="return false;" target="obj0Target" action="" enctype="multipart/form-data" method="post">
+ <input type="file" name="objFile" />
+ <input type="submit" value="set" />
+ </form>
+ <iframe id="obj0Target" name="obj0Target" style="width: 1px; height: 1px;"></iframe>
+
+ <h4>JPEGs, GIFs, PNGs, and MTLs:</h4>
+ <div id="currentResources"> </div>
- <div class="section">
- <h3>Geometry:</h3>
- <p>
- <h4>Obj file:</h4>
- <span id="objMessage"></span>
- <form id="obj0Form" onsubmit="return false;" target="obj0Target" action="" enctype="multipart/form-data" method="post">
- <input type="file" name="objFile" />
- <input type="submit" value="set" />
+ <form id="resourceForm" onsubmit="resourceFormGo();" target="resourceTarget" action="" enctype="multipart/form-data" method="post">
+ <input type="file" name="resourceFile" />
+ <input type="submit" value="add" />
+ </form>
+ <iframe id="resourceTarget" name="resourceTarget" style="width: 1px; height: 1px;"></iframe>
+ </p>
+ </div>
+ </div> <!-- end northDiv -->
+
+ <div id="rail">
+ <div id="seatDiv" class="section">
+ <h3>Is a seat: <form onsubmit="updateSeatSettingsGo(); return false;"><input onchange="updateSeatSettingsGo();" type="checkbox" id="seatCheckbox" /></form></h3>
+ <form method="get" action="index.html" onsubmit="updateSeatSettingsGo(); return false;" id="seatPositionForm">
+ x: <input type="text" size="5" id="seatX" name="seatX" /><br/>
+ y: <input type="text" size="5" id="seatY" name="seatY" /><br/>
+ z: <input type="text" size="5" id="seatZ" name="seatZ" /><br/>
</form>
- <iframe id="obj0Target" name="obj0Target" style="width: 1px; height: 1px;"></iframe>
- <h4>JPEGs, GIFs, PNGs, and MTLs:</h4>
- <div id="currentResources"> </div>
-
- <form id="resourceForm" onsubmit="resourceFormGo();" target="resourceTarget" action="" enctype="multipart/form-data" method="post">
- <input type="file" name="resourceFile" />
- <input type="submit" value="add" />
+ <form method="get" action="index.html" onsubmit="updateSeatSettingsGo(); return false;" id="seatRotationForm">
+ rotation x: <input type="text" size="5" id="seatRotX" name="seatRotX" /><br/>
+ rotation y: <input type="text" size="5" id="seatRotY" name="seatRotY" /><br/>
+ rotation z: <input type="text" size="5" id="seatRotZ" name="seatRotZ" /><br/>
+ <input type="submit" value="set" />
</form>
- <iframe id="resourceTarget" name="resourceTarget" style="width: 1px; height: 1px;"></iframe>
- </p>
- </div>
+ </div>
+ </div><!-- end rail -->
+ <br clear="all"/>
+
<div class="section">
<div style="float: right;" class="navLink"><a href="http://ogoglio.wiki.sourceforge.net/ServerManualJavascriptAPI">Script API »</a></div>
<h3>Script:</h3>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-19 00:58:55
|
Revision: 516
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=516&view=rev
Author: trevorolio
Date: 2007-10-18 17:58:59 -0700 (Thu, 18 Oct 2007)
Log Message:
-----------
Now plays the sit animation when sitting.
Other folks see the sitting avatar, both upon the event and on initial load.
Need to add UI to template html.
Added Paths:
-----------
maven/trunk/ogoglio-bodies/ogoglio-body-andrea/src/main/resources/animation/sit.bvh
maven/trunk/ogoglio-bodies/ogoglio-body-mike/src/main/resources/animation/sit.bvh
Added: maven/trunk/ogoglio-bodies/ogoglio-body-andrea/src/main/resources/animation/sit.bvh
===================================================================
--- maven/trunk/ogoglio-bodies/ogoglio-body-andrea/src/main/resources/animation/sit.bvh (rev 0)
+++ maven/trunk/ogoglio-bodies/ogoglio-body-andrea/src/main/resources/animation/sit.bvh 2007-10-19 00:58:59 UTC (rev 516)
@@ -0,0 +1,179 @@
+HIERARCHY
+ROOT hip
+{
+ OFFSET 0.00 0.00 0.00
+ CHANNELS 6 Xposition Yposition Zposition Xrotation Zrotation Yrotation
+ JOINT abdomen
+ {
+ OFFSET 0.000000 0.000000 0.000000
+ CHANNELS 3 Xrotation Zrotation Yrotation
+ JOINT chest
+ {
+ OFFSET 0.000000 5.018152 -1.882228
+ CHANNELS 3 Xrotation Zrotation Yrotation
+ JOINT neckDummy
+ {
+ OFFSET 0.000000 8.316447 0.784897
+ CHANNELS 3 Xrotation Yrotation Zrotation
+ JOINT neck
+ {
+ OFFSET 0.000000 2.280413 -0.392801
+ CHANNELS 3 Xrotation Zrotation Yrotation
+ JOINT head
+ {
+ OFFSET 0.000000 3.496879 0.529469
+ CHANNELS 3 Xrotation Zrotation Yrotation
+ JOINT figureHair
+ {
+ OFFSET 0.000000 4.699570 0.720622
+ CHANNELS 3 Zrotation Yrotation Xrotation
+ End Site
+ {
+ OFFSET 0.000000 -6.419331 0.000000
+ }
+ }
+ }
+ }
+ }
+ JOINT lCollar
+ {
+ OFFSET 0.599237 8.316447 0.784897
+ CHANNELS 3 Yrotation Zrotation Xrotation
+ JOINT lShldr
+ {
+ OFFSET 6.421198 0.010146 -0.332128
+ CHANNELS 3 Zrotation Yrotation Xrotation
+ JOINT lForeArm
+ {
+ OFFSET 10.552783 0.025574 0.125508
+ CHANNELS 3 Yrotation Zrotation Xrotation
+ JOINT lHand
+ {
+ OFFSET 11.035963 0.319619 0.041520
+ CHANNELS 3 Zrotation Yrotation Xrotation
+ End Site
+ {
+ OFFSET 10.353753 0.000000 0.000000
+ }
+ }
+ }
+ }
+ }
+ JOINT rCollar
+ {
+ OFFSET -0.599237 8.316447 0.784897
+ CHANNELS 3 Yrotation Zrotation Xrotation
+ JOINT rShldr
+ {
+ OFFSET -6.421198 0.010146 -0.332128
+ CHANNELS 3 Zrotation Yrotation Xrotation
+ JOINT rForeArm
+ {
+ OFFSET -10.552783 0.025574 0.125508
+ CHANNELS 3 Yrotation Zrotation Xrotation
+ JOINT rHand
+ {
+ OFFSET -11.035963 0.319619 0.041520
+ CHANNELS 3 Zrotation Yrotation Xrotation
+ End Site
+ {
+ OFFSET -10.353753 0.000000 0.000000
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ JOINT lThigh
+ {
+ OFFSET 4.500466 -6.400484 -1.832696
+ CHANNELS 3 Xrotation Zrotation Yrotation
+ JOINT lShin
+ {
+ OFFSET -1.359117 -18.918689 1.179887
+ CHANNELS 3 Xrotation Zrotation Yrotation
+ JOINT lFoot
+ {
+ OFFSET -0.652380 -17.215186 -0.312137
+ CHANNELS 3 Xrotation Yrotation Zrotation
+ End Site
+ {
+ OFFSET 0.000000 0.000000 10.353752
+ }
+ }
+ }
+ }
+ JOINT rThigh
+ {
+ OFFSET -4.500466 -6.400484 -1.832696
+ CHANNELS 3 Xrotation Zrotation Yrotation
+ JOINT rShin
+ {
+ OFFSET 1.359117 -18.918689 1.179887
+ CHANNELS 3 Xrotation Zrotation Yrotation
+ JOINT rFoot
+ {
+ OFFSET 0.652380 -17.215186 -0.312137
+ CHANNELS 3 Xrotation Yrotation Zrotation
+ End Site
+ {
+ OFFSET 0.000000 0.000000 10.353752
+ }
+ }
+ }
+ }
+}
+MOTION
+Frames: 50
+Frame Time: 0.041667
+0.000000 42.014908 0.240040 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 2.021920 -5.690310 -0.063351 -70.100700 9.978770 15.991600 -22.515600 -9.303740 0.147736 5.969490 -0.173112 0.175734 -2.021920 5.690310 -0.063351 70.100700 -9.978770 15.991600 22.515600 9.303740 0.147736 -5.969490 0.173112 0.175734 -7.545480 4.001929 0.126583 15.872740 -3.319793 -0.839247 -8.608498 1.050494 -0.878046 -7.531943 -4.331991 0.100592 15.814292 3.299639 0.618600 -8.640055 -1.563356 0.936766
+-0.001136 42.047485 0.258350 0.015281 -0.160640 1.231823 -0.202867 -1.017794 5.550867 -0.022891 -2.631103 2.992019 0.000000 0.000000 0.000000 0.000000 0.000000 1.297549 3.800558 -1.201557 7.998749 0.000000 0.000000 0.000000 1.994514 -5.197196 -0.066307 -67.927406 9.117760 16.272688 -21.930227 -10.127905 0.184120 7.175318 0.005541 -0.197885 -2.073291 5.740149 -0.032077 69.997414 -10.220204 15.994469 22.056313 9.142480 0.185973 -6.503005 1.401555 -2.041011 -7.551804 4.214809 0.125835 15.585843 -3.309215 -0.808465 -8.337039 -0.217005 -0.943522 -7.072927 -4.077958 0.028241 15.140048 3.277331 0.570500 -8.423216 -2.749167 0.862214
+-0.002857 42.096840 0.286087 0.029094 -0.365053 2.705819 -0.405597 -2.258602 12.353542 -0.052194 -5.847550 6.673011 0.000000 0.000000 0.000000 0.000000 0.000000 2.867914 8.444941 -2.649465 17.763105 0.000000 0.000000 0.000000 2.026428 -4.493691 -0.053350 -65.288086 8.063235 16.616686 -21.241461 -11.135085 0.222496 8.258029 0.234520 -0.622607 -2.153154 5.878275 0.045403 70.024467 -10.651922 15.978795 21.412695 9.311210 0.253536 -6.883192 3.187223 -5.134254 -7.501410 4.496881 0.123082 15.118730 -3.299616 -0.766510 -7.970469 -1.727266 -1.048025 -6.452955 -3.748653 -0.055355 14.178856 3.239592 0.472283 -8.083669 -4.153584 0.781128
+-0.003286 42.109127 0.292991 0.061213 -0.535572 4.277362 -0.777409 -3.492378 18.982010 -0.075997 -9.012057 10.205709 0.000000 0.000000 0.000000 0.000000 0.000000 4.480512 13.028363 -4.157663 27.440105 0.000000 0.000000 0.000000 2.106382 -3.666201 -0.027852 -62.624863 7.033216 16.953691 -20.461637 -12.127282 0.283488 9.150728 0.488386 -1.057494 -2.251019 6.080780 0.156168 70.160461 -11.211857 15.948553 20.662586 9.747875 0.340776 -7.102841 5.307372 -8.863679 -7.733775 4.735919 0.120272 15.098766 -3.299485 -0.765173 -7.820042 -3.331604 -1.135538 -6.111829 -3.485498 -0.127818 13.752612 3.218626 0.442000 -8.054342 -5.678007 0.704172
+0.000000 42.014908 0.240040 0.140966 -0.588000 5.920680 -1.579400 -4.545870 24.255800 -0.081138 -11.618200 12.859500 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 16.840300 -5.638830 35.604698 0.000000 0.000000 0.000000 2.188578 -2.810312 -0.001600 -60.240200 6.206450 17.227100 -19.525499 -12.948100 0.400552 10.078557 0.751147 -1.508068 -2.352196 6.289758 0.270502 70.299858 -11.790388 15.917407 19.886646 10.196711 0.430919 -7.332713 7.500043 -13.019673 -8.672421 4.828678 0.146981 16.364857 -3.346981 -0.905014 -8.241468 -4.977678 -1.109998 -6.623362 -3.453089 -0.197466 14.911632 3.268945 0.563573 -8.767126 -7.294611 0.632392
+0.008106 41.758495 0.093278 0.286617 -0.465829 7.598319 -2.919785 -5.289261 27.298862 -0.058123 -13.293894 14.099704 0.000000 0.000000 0.000000 0.000000 0.000000 7.315878 19.311069 -7.011647 41.139530 0.000000 0.000000 0.000000 2.227221 -2.021616 0.013618 -58.374638 5.701050 17.393173 -18.427805 -13.479096 0.587695 11.266666 1.006811 -1.979855 -2.441995 6.447314 0.358690 70.337204 -12.277906 15.899037 19.165552 10.401958 0.507188 -7.743576 9.503284 -17.392633 -10.711632 4.735614 0.181811 19.500193 -3.476861 -1.197509 -9.489000 -6.637327 -0.951120 -8.415224 -3.777928 -0.249301 18.396254 3.414390 0.917017 -10.594095 -8.999483 0.561660
+0.016877 41.339180 -0.160993 0.472185 -0.223303 9.226099 -4.295254 -5.766469 28.452793 -0.012122 -14.204382 14.175374 0.000000 0.000000 0.000000 0.000000 0.000000 8.417012 20.434372 -8.218807 44.157990 0.000000 0.000000 0.000000 2.176512 -1.395702 0.006016 -57.021053 5.392597 17.459612 -17.403440 -13.753652 0.781114 12.940200 1.239383 -2.478377 -2.505727 6.495546 0.391018 70.166992 -12.564794 15.907110 18.579964 10.107853 0.552805 -8.506192 11.055137 -21.772951 -13.706823 4.490720 0.248237 24.247133 -3.662852 -1.674194 -11.342396 -8.183679 -0.657165 -11.571109 -4.258971 -0.275373 23.999399 3.634807 1.505209 -13.201004 -10.669835 0.315946
+0.020842 40.769993 -0.531403 0.660630 0.057650 10.708160 -5.049613 -6.064847 28.363611 0.048028 -14.649241 13.531502 0.000000 0.000000 0.000000 0.000000 0.000000 9.317108 20.344748 -9.209007 45.081150 0.000000 0.000000 0.000000 1.990654 -1.028158 -0.036195 -56.110439 5.096044 17.446981 -16.747332 -13.843108 0.897551 15.324302 1.432872 -3.009158 -2.528701 6.376553 0.337769 69.683716 -12.541431 15.955297 18.210548 9.058629 0.550996 -9.791324 11.893643 -25.951015 -17.437792 4.198074 0.338902 30.074774 -3.858332 -2.266191 -13.475947 -9.548857 -0.221030 -15.383269 -4.977664 -0.287406 30.727306 3.876024 2.184429 -16.246342 -12.078061 0.165571
+0.014530 40.063969 -1.026583 0.814910 0.295098 11.948647 -4.526672 -6.271750 27.677338 0.113491 -14.928055 12.613079 0.000000 0.000000 0.000000 0.000000 0.000000 10.029876 19.176733 -9.930942 44.330078 0.000000 0.000000 0.000000 1.623849 -1.014575 -0.124801 -55.573788 4.626344 17.375854 -16.754408 -13.818810 0.853750 18.644119 1.571285 -3.577721 -2.496229 6.032434 0.169230 68.781883 -12.098205 16.057272 18.137974 6.998525 0.484983 -11.769738 11.756850 -29.717213 -21.666656 3.954324 0.443313 36.503391 -4.044169 -2.934869 -15.638267 -10.672198 0.278965 -19.613991 -5.710900 -0.279835 37.803112 4.065731 2.911026 -19.196899 -13.162488 -0.046318
+-0.007528 39.234142 -1.655163 0.897985 0.407112 12.851700 -2.070240 -6.474530 27.040001 0.175430 -15.340400 11.865100 0.000000 0.000000 0.000000 0.000000 0.000000 10.569020 17.064877 -10.333308 42.325867 0.000000 0.000000 0.000000 1.030300 -1.450540 -0.271591 -55.342098 3.798450 17.266800 -17.719601 -13.752100 0.566455 23.124800 1.638630 -4.189590 -2.393620 5.405290 -0.144315 67.356003 -11.125500 16.226700 18.442900 3.671780 0.337990 -14.612200 10.382800 -32.861942 -26.143826 3.846021 0.554989 43.048153 -4.172040 -3.623220 -17.589991 -11.449199 0.840408 -23.938587 -6.463055 -0.274669 44.984058 4.191748 3.669371 -22.069221 -13.790672 -0.121726
+-0.050137 38.292961 -2.409089 0.882349 0.337312 13.353222 2.706291 -6.743101 26.934940 0.224199 -16.094496 11.606818 0.000000 0.000000 0.000000 0.000000 0.000000 10.948249 14.143720 -10.364807 39.489601 0.000000 0.000000 0.000000 0.198067 -2.374392 -0.480962 -55.373985 2.487314 17.137873 -19.762753 -13.696319 -0.000414 28.751705 1.681599 -4.830937 -2.211814 4.486124 -0.621754 65.330505 -9.567327 16.466475 19.172091 -1.036520 0.114412 -18.264462 7.752028 -35.175598 -30.707300 3.953771 0.675722 49.288216 -4.214429 -4.315293 -19.088308 -11.875370 1.386264 -28.477438 -6.873167 -0.220213 51.558327 4.208741 4.360595 -24.106689 -14.144130 -0.270036
+-0.115429 37.250546 -3.213563 0.778648 0.131524 13.516165 9.111165 -7.077611 27.194798 0.246917 -17.033125 11.654552 0.000000 0.000000 0.000000 0.000000 0.000000 11.181270 10.547808 -9.974133 36.242355 0.000000 0.000000 0.000000 -0.749360 -3.595456 -0.727751 -55.738575 0.807899 16.997055 -22.303387 -13.632792 -0.694226 34.551033 1.997627 -5.410524 -1.964272 3.461572 -1.238661 62.749615 -7.582217 16.736366 20.236719 -6.677859 -0.096668 -21.772221 4.815056 -36.448566 -35.223942 4.236428 0.764493 55.312519 -4.176326 -4.968762 -20.384064 -12.023439 1.903501 -32.657665 -7.230220 -0.219549 57.641293 4.117342 5.020196 -25.918390 -14.136715 -0.290269
+-0.204869 36.116421 -3.977106 0.607063 -0.138876 13.435247 16.183052 -7.460773 27.489546 0.229894 -17.907717 11.698886 0.000000 0.000000 0.000000 0.000000 0.000000 11.281791 6.411681 -9.109984 33.005203 0.000000 0.000000 0.000000 -1.654636 -4.865809 -0.979408 -56.532635 -1.064830 16.849812 -24.585958 -13.524848 -1.315175 39.309212 2.946833 -5.817761 -1.670083 2.567176 -1.959786 59.687500 -5.382332 16.985371 21.514063 -12.662883 -0.184997 -23.956169 2.764890 -36.471245 -39.669811 4.646955 0.772826 61.285667 -4.039305 -5.623230 -21.678022 -11.919246 2.350195 -37.009411 -7.279677 -0.227884 63.486649 3.918202 5.641013 -27.336681 -14.054149 -0.454885
+-0.319923 34.900127 -4.608232 0.387775 -0.402509 13.205188 22.960609 -7.875296 27.489159 0.159439 -18.469700 11.430408 0.000000 0.000000 0.000000 0.000000 0.000000 11.263515 1.869889 -7.721058 30.199228 0.000000 0.000000 0.000000 -2.360411 -5.937526 -1.203382 -57.852928 -2.955908 16.701603 -25.854912 -13.335809 -1.663455 41.812660 4.889338 -5.942060 -1.348339 2.038479 -2.749876 56.218346 -3.179836 17.162485 22.881397 -18.402214 -0.040321 -23.636997 2.794546 -35.034027 -43.965260 5.135311 0.690983 67.382362 -3.814714 -6.268446 -23.232658 -11.684981 2.697291 -41.309090 -7.166585 -0.281345 69.357353 3.652169 6.216343 -28.788540 -13.927116 -0.737134
+-0.462055 33.611195 -5.015463 0.140966 -0.588000 12.920700 28.482500 -8.303890 26.863600 0.021864 -18.470501 10.539700 0.000000 0.000000 0.000000 0.000000 0.000000 11.140156 -2.943030 -5.756050 28.245501 0.000000 0.000000 0.000000 -2.709340 -6.562680 -1.367120 -59.796200 -4.690370 16.557899 -25.354700 -13.029000 -1.539260 40.847801 8.185260 -5.672830 -1.018130 2.111020 -3.573680 52.416302 -1.186890 17.216700 24.216000 -23.306499 0.447615 -19.635401 6.097030 -31.927299 -48.061069 5.653193 0.479244 73.787239 -3.474089 -6.889403 -25.328661 -11.391047 2.863119 -45.139637 -7.147304 -0.481332 75.543465 3.301003 6.828876 -30.997875 -13.621574 -1.176313
+-0.625463 32.258106 -5.221559 -0.087118 -0.647162 12.685126 32.141991 -8.714515 25.368425 -0.278603 -17.744574 8.753790 0.000000 0.000000 0.000000 0.000000 0.000000 10.925414 -7.825219 -3.290900 27.354988 0.000000 0.000000 0.000000 -2.514160 -6.420678 -1.452255 -62.329395 -6.144660 16.428251 -23.208241 -12.761728 -0.993648 36.654705 12.391641 -4.982024 -0.749251 2.890534 -4.389220 48.485493 0.562473 17.124125 25.807608 -26.889833 1.483009 -11.844831 12.917302 -27.275766 -52.032818 6.121557 0.178778 80.399940 -3.065367 -7.491178 -27.786781 -11.096766 2.902039 -48.836628 -7.206628 -0.747539 82.045853 2.900582 7.426325 -33.690441 -13.261812 -1.793520
+-0.775271 30.845148 -5.706260 -0.145974 -0.624573 12.636305 34.750740 -9.016124 23.101532 -1.166061 -16.458477 5.945470 0.000000 0.000000 0.000000 0.000000 0.000000 10.632996 -12.305557 -0.910501 26.898216 0.000000 0.000000 0.000000 -1.467941 -4.900249 -1.497147 -64.900131 -7.400843 16.338558 -23.052319 -13.467224 -1.081142 35.288033 13.853205 -4.171755 -0.814312 3.963524 -5.127613 45.149837 2.746739 16.969330 29.595821 -29.080166 3.645842 -4.449783 19.708128 -22.541378 -56.329060 6.338910 0.136681 85.893959 -2.727632 -7.982375 -28.876787 -11.003044 3.166472 -53.101933 -7.461143 -0.796327 87.790771 2.519392 7.935912 -35.187824 -13.149985 -2.232794
+-0.869335 29.375566 -7.063550 0.140966 -0.588000 12.920700 37.474998 -9.102920 20.246401 -3.146690 -14.861800 2.023970 0.000000 0.000000 0.000000 0.000000 0.000000 10.276609 -15.845600 0.673007 26.035603 0.000000 0.000000 0.000000 0.766166 -1.317450 -1.554340 -66.826202 -8.592390 16.318800 -29.402201 -16.272699 -3.107130 44.256100 8.111580 -3.626680 -1.536630 4.786680 -5.713250 43.263199 6.222520 16.864000 37.932701 -29.908899 7.610040 -2.707540 21.974199 -19.520399 -62.393833 6.131525 0.781529 89.501648 -2.529813 -8.347482 -26.404787 -11.069010 4.096362 -59.449234 -8.153783 -0.226388 92.011993 2.216583 8.261917 -33.339851 -13.439254 -1.951319
+-0.872431 27.886549 -9.542672 0.660576 -0.585714 13.415488 40.882645 -8.875570 17.194075 -6.338554 -13.222828 -2.826497 0.000000 0.000000 0.000000 0.000000 0.000000 9.869966 -17.821077 1.014126 23.927561 0.000000 0.000000 0.000000 4.015821 4.340507 -1.644702 -67.609413 -9.885515 16.389240 -44.205246 -21.322229 -7.541314 66.079781 -6.626896 -3.621811 -3.034421 5.164068 -6.112218 43.356716 11.201074 16.894766 51.570087 -29.110842 13.215491 -9.210017 17.106630 -18.929438 -69.892052 5.336908 2.244351 90.224297 -2.607593 -8.505087 -19.621990 -10.779461 5.738407 -67.848671 -9.353822 1.057089 93.872597 2.023984 8.354570 -27.166733 -13.644540 -0.653342
+-0.777013 26.551064 -12.013938 0.140966 -0.588000 12.920700 43.148102 -8.260590 15.165800 -9.307310 -11.884600 -7.321860 0.000000 0.000000 0.000000 0.000000 0.000000 9.426769 -17.264400 0.733914 19.734501 0.000000 0.000000 0.000000 6.071980 9.401870 -1.662390 -67.487602 -11.577400 16.531200 -59.137402 -24.827400 -11.510700 83.330399 -21.497299 -3.993590 -4.605520 6.289250 -6.457390 44.670601 15.312300 17.048000 64.859100 -25.234400 16.966000 -15.887800 10.042100 -17.166401 -75.341019 4.843800 3.455750 90.097908 -2.695096 -8.565252 -13.262901 -9.457743 7.071873 -74.263962 -10.155553 2.081025 94.466759 1.933840 8.348231 -20.709200 -12.765933 0.540243
+-0.591852 25.530415 -13.328908 -2.455969 -0.557183 10.407695 42.380375 -7.136115 15.093898 -10.760098 -11.018998 -10.140150 0.000000 0.000000 0.000000 0.000000 0.000000 8.960727 -13.584900 0.557259 13.013932 0.000000 0.000000 0.000000 4.952104 11.254337 -1.507222 -66.857559 -13.857865 16.697147 -65.650581 -23.260971 -12.243420 79.201653 -27.589514 -4.296614 -5.578798 9.128095 -6.860391 46.224689 16.194149 17.270897 72.147560 -17.503981 15.621323 -14.526196 6.287201 -10.536071 -76.707176 5.707410 3.380951 92.164139 -2.501134 -8.704925 -11.614241 -7.263399 7.239071 -75.908676 -9.556920 1.998037 95.644653 1.852712 8.464150 -17.665529 -10.838728 0.539092
+-0.363304 24.803457 -13.643139 -6.074385 -0.501732 6.610309 38.820499 -5.160920 15.924700 -11.522500 -10.038500 -10.907800 0.000000 0.000000 0.000000 0.000000 0.000000 8.485547 -8.042975 0.557812 4.911759 0.000000 0.000000 0.000000 1.616479 10.208116 -1.228365 -66.015770 -16.356316 16.763041 -64.572441 -18.073032 -10.714931 59.327023 -26.471737 -3.396677 -6.227700 12.346200 -7.181090 47.448299 14.098300 17.454201 74.171303 -9.034440 10.301300 -6.990950 6.082470 0.710524 -75.496025 6.961439 2.244997 95.905380 -2.133769 -8.915996 -13.544906 -4.234988 6.245570 -74.717163 -8.556355 1.092098 97.846397 1.747047 8.680337 -17.445347 -7.904090 -0.618339
+-0.147123 24.303423 -13.438188 -9.134972 -0.441656 2.702975 33.474945 -2.307904 16.147840 -12.606924 -8.502589 -9.806231 0.000000 0.000000 0.000000 0.000000 0.000000 8.014936 -2.361760 0.646416 -3.029062 0.000000 0.000000 0.000000 -2.238928 7.304027 -0.912318 -65.233643 -18.562061 16.585714 -59.074524 -11.957973 -8.837513 34.949783 -22.331715 0.012631 -6.877466 14.308359 -7.263671 48.239124 10.141443 17.425304 73.165558 -3.010855 3.229143 2.332134 8.351938 15.335871 -73.571877 7.398752 0.799846 99.652397 -1.722067 -9.104954 -16.761017 -0.476882 4.617184 -72.896591 -8.194424 -0.132631 100.280342 1.614837 8.934370 -18.506849 -4.307328 -2.469582
+0.000939 23.963556 -13.195612 -10.058400 -0.396959 -0.139853 28.280100 -0.025860 14.412100 -13.654600 -7.318210 -8.288430 0.000000 0.000000 0.000000 0.000000 0.000000 7.562603 1.735580 0.733914 -9.265530 0.000000 0.000000 0.000000 -4.918130 3.582900 -0.645584 -64.782600 -19.964399 16.021999 -52.328400 -7.610210 -8.523450 17.313299 -19.357201 7.237720 -7.115950 14.476300 -7.141320 49.958801 6.286670 16.814600 70.975098 0.990960 -3.318360 9.057210 12.019637 32.102402 -73.282913 7.460052 -0.364895 101.900253 -1.486730 -9.208735 -18.714811 2.437124 3.106550 -72.886467 -8.456903 -1.185964 101.642441 1.543463 9.101422 -18.670393 -1.253969 -4.131649
+0.043469 23.726555 -13.278124 -7.926306 -0.381788 -1.099397 24.939623 0.396672 9.992074 -14.115564 -7.321980 -7.730533 0.000000 0.000000 0.000000 0.000000 0.000000 7.142253 2.971139 0.751940 -12.647152 0.000000 0.000000 0.000000 -5.233160 -0.038699 -0.496564 -64.868721 -20.131510 15.157438 -47.100723 -6.850621 -10.608710 14.206190 -20.386114 18.689032 -6.521918 12.949107 -6.930665 53.784458 4.296818 15.571449 69.107430 4.158430 -7.350912 9.454207 16.009592 48.685352 -76.245377 7.782739 -0.699248 101.753265 -1.486786 -9.210054 -17.797413 3.157538 2.584072 -75.786819 -8.310682 -1.659614 101.088631 1.648746 9.118819 -17.210026 -0.491356 -4.751955
+0.016426 23.572933 -13.573064 -4.464168 -0.386842 -0.779546 23.296490 -0.211947 4.506510 -14.046229 -7.721753 -7.929712 0.000000 0.000000 0.000000 0.000000 0.000000 6.767593 1.848017 0.715297 -13.593440 0.000000 0.000000 0.000000 -4.028121 -3.141241 -0.461256 -65.436722 -18.947090 14.992432 -44.538521 -8.005962 -11.623996 19.598129 -22.857027 31.193110 -5.375175 11.278348 -6.893106 58.691280 4.287345 15.118093 68.111450 7.122568 -8.077724 2.416154 19.245832 58.411160 -80.572365 7.762822 -0.495983 100.244797 -1.633601 -9.132307 -15.388410 2.853946 2.768085 -80.085068 -8.467069 -1.709246 99.736031 1.785352 9.043935 -15.031303 -0.734781 -4.628127
+-0.025891 23.492668 -13.848934 -2.058400 -0.396959 -0.139853 22.728500 -0.494140 0.160156 -13.654600 -7.318200 -8.288400 0.000000 0.000000 0.000000 0.000000 0.000000 6.452331 -0.685447 0.659579 -12.916411 0.000000 0.000000 0.000000 -2.655120 -5.429470 -0.517557 -66.365997 -16.373699 16.756100 -45.383900 -8.529470 -7.023700 24.004101 -22.858700 40.680599 -4.130780 11.378700 -7.326240 63.104000 5.961870 17.245001 68.296402 10.375300 -5.007880 -12.508200 20.652399 53.519100 -83.582695 7.636213 -0.186658 98.951874 -1.798568 -9.068689 -13.419610 2.309466 3.084131 -83.092674 -8.671844 -1.606984 98.685860 1.894741 8.962910 -13.441343 -1.225798 -4.382638
+-0.041389 23.472105 -13.933654 -2.355244 -0.400345 0.073362 22.663372 0.302029 -1.410207 -12.763442 -5.288787 -8.358323 0.000000 0.000000 0.000000 0.000000 0.000000 6.210174 -3.680905 0.620380 -11.428075 0.000000 0.000000 0.000000 -2.146618 -6.714589 -0.635816 -67.489677 -12.660131 21.005629 -49.690632 -6.675766 5.520680 20.655518 -17.934645 44.302353 -3.244061 14.340141 -8.337900 65.804955 8.829684 22.809927 68.480186 13.839926 1.976072 -29.558062 18.727209 34.185310 -83.444283 7.587450 -0.121380 98.962868 -1.827669 -9.074026 -13.260627 2.131085 3.186827 -82.958527 -8.769772 -1.578251 98.724609 1.903192 8.986553 -13.307418 -1.393921 -4.351883
+-0.036799 23.483084 -13.892812 -4.040154 -0.398677 -0.033274 22.728500 0.505900 -0.839800 -9.654600 -2.318200 -8.288400 0.000000 0.000000 0.000000 0.000000 0.000000 6.054828 -6.190008 0.633294 -9.940445 0.000000 0.000000 0.000000 -2.256451 -7.233702 -0.756190 -68.455856 -9.200068 25.610476 -54.759129 -3.905049 19.469149 13.649653 -11.447479 44.090389 -3.171410 17.953800 -9.276880 67.007080 11.622759 28.939779 61.515598 15.165300 11.497700 -18.124701 10.263800 32.333698 -81.643768 7.596544 -0.201949 99.672813 -1.750242 -9.120222 -14.112836 2.247701 3.139502 -81.158745 -8.759913 -1.593118 99.357018 1.844714 9.036206 -14.052436 -1.301064 -4.417953
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 22.728500 -0.494100 0.160200 -5.654600 -0.318199 -8.288400 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.264420 0.733914 -9.265530 0.000000 0.000000 0.000000 -2.418800 -7.330390 -0.811291 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064671 9.800200 -8.214560 43.297001 -3.707600 19.509300 -9.539490 67.280998 12.878750 31.828800 49.938904 13.843800 18.433800 18.058350 -0.060270 55.341801 -80.529556 7.606574 -0.276037 100.080345 -1.682014 -9.139359 -14.624531 2.390794 3.050730 -80.036728 -8.740204 -1.627717 99.804337 1.786962 9.054121 -14.602128 -1.177025 -4.467085
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 22.796249 -0.312243 0.229236 -5.652178 -0.470930 -8.290670 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.319018 0.942366 -9.268350 0.000000 0.000000 0.000000 -2.418800 -7.330391 -0.811292 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064674 9.800200 -8.214563 43.297001 -3.707600 19.509300 -9.539491 67.280998 12.878745 31.828800 49.938904 13.843800 18.433800 18.058344 -0.060273 55.341801 -80.529556 7.606574 -0.276037 99.948349 -1.583841 -9.135448 -14.457079 2.505192 2.925035 -80.036728 -8.740204 -1.627717 99.899406 1.728640 9.056458 -14.764675 -1.100068 -4.439228
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 22.864000 -0.130386 0.298271 -5.649756 -0.623661 -8.292941 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.373616 1.150817 -9.271170 0.000000 0.000000 0.000000 -2.418800 -7.330392 -0.811293 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064676 9.800200 -8.214567 43.297001 -3.707600 19.509300 -9.539492 67.280998 12.878740 31.828800 49.938904 13.843800 18.433800 18.058338 -0.060276 55.341801 -80.529556 7.606574 -0.276037 99.816490 -1.496572 -9.144343 -14.295455 2.634761 2.830058 -80.036728 -8.740204 -1.627717 99.994888 1.679874 9.059991 -14.916922 -1.023317 -4.411181
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 22.931751 0.051471 0.367307 -5.647335 -0.776392 -8.295212 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.428214 1.359269 -9.273990 0.000000 0.000000 0.000000 -2.418800 -7.330393 -0.811294 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064678 9.800200 -8.214571 43.297001 -3.707600 19.509300 -9.539493 67.280998 12.878736 31.828800 49.938904 13.843800 18.433800 18.058334 -0.060279 55.341801 -80.655678 7.296944 -0.294510 99.830833 -1.392337 -9.151498 -14.162417 3.059085 2.733469 -80.036728 -8.740204 -1.627717 100.089966 1.621550 9.061905 -15.078267 -0.949209 -4.363899
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 22.999500 0.233328 0.436343 -5.644913 -0.929123 -8.297482 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.482811 1.567720 -9.276810 0.000000 0.000000 0.000000 -2.418800 -7.330394 -0.811295 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064682 9.800200 -8.214575 43.297001 -3.707600 19.509300 -9.539494 67.280998 12.878731 31.828800 49.938904 13.843800 18.433800 18.058329 -0.060282 55.341801 -80.684761 7.184387 -0.293389 99.884262 -1.286162 -9.160164 -14.151802 3.289547 2.634885 -79.975204 -8.555390 -1.625069 100.048653 1.587265 9.074759 -15.158584 -1.068617 -4.351100
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 23.067249 0.415185 0.505379 -5.642490 -1.081855 -8.299753 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.537410 1.776172 -9.279630 0.000000 0.000000 0.000000 -2.418800 -7.330395 -0.811295 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064686 9.800200 -8.214579 43.297001 -3.707600 19.509300 -9.539495 67.280998 12.878726 31.828800 49.938904 13.843800 18.433800 18.058323 -0.060285 55.341801 -80.655884 7.065650 -0.297986 99.908813 -1.189191 -9.166738 -14.178167 3.518813 2.556376 -79.944778 -8.463006 -1.618956 99.968964 1.551501 9.063015 -15.176853 -1.087549 -4.304982
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 23.135000 0.597042 0.574414 -5.640069 -1.234586 -8.302025 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.592008 1.984624 -9.282450 0.000000 0.000000 0.000000 -2.418800 -7.330396 -0.811296 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064688 9.800200 -8.214582 43.297001 -3.707600 19.509300 -9.539495 67.280998 12.878721 31.828800 49.938904 13.843800 18.433800 18.058319 -0.060288 55.341801 -80.694763 6.948860 -0.293453 99.864395 -1.083336 -9.174717 -14.068148 3.754606 2.445470 -79.920784 -8.406898 -1.614661 99.976341 1.504053 9.066916 -15.275945 -1.070508 -4.274305
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 23.202751 0.778899 0.643450 -5.637647 -1.387317 -8.304296 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.646605 2.193075 -9.285270 0.000000 0.000000 0.000000 -2.418800 -7.330397 -0.811297 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064690 9.800200 -8.214586 43.297001 -3.707600 19.509300 -9.539496 67.280998 12.878716 31.828800 49.938904 13.843800 18.433800 18.058315 -0.060291 55.341801 -80.723465 6.845056 -0.299076 99.840591 -0.988943 -9.169375 -13.973420 3.955399 2.359292 -79.965065 -8.345485 -1.622173 100.022240 1.433999 9.058948 -15.345372 -1.057141 -4.224343
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 23.270500 0.960756 0.712486 -5.635224 -1.540048 -8.306567 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.701204 2.401527 -9.288090 0.000000 0.000000 0.000000 -2.418800 -7.330398 -0.811298 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064693 9.800200 -8.214591 43.297001 -3.707600 19.509300 -9.539497 67.280998 12.878711 31.828800 49.938904 13.843800 18.433800 18.058310 -0.060294 55.341801 -80.683945 6.726146 -0.294566 99.884666 -0.883093 -9.168114 -14.029733 4.186086 2.272666 -79.959534 -8.302510 -1.617384 99.952438 1.411240 9.063025 -15.346992 -1.032802 -4.191750
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 23.338249 1.142613 0.781521 -5.632802 -1.692779 -8.308838 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.755802 2.609978 -9.290910 0.000000 0.000000 0.000000 -2.418800 -7.330399 -0.811299 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064697 9.800200 -8.214596 43.297001 -3.707600 19.509300 -9.539499 67.280998 12.878706 31.828800 49.938904 13.843800 18.433800 18.058304 -0.060297 55.341801 -80.702011 6.623090 -0.290389 99.850136 -0.781133 -9.181367 -13.942264 4.408222 2.169586 -79.944435 -8.252051 -1.616698 99.978989 1.363760 9.078614 -15.435973 -1.019263 -4.161382
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 23.406000 1.324470 0.850557 -5.630380 -1.845510 -8.311110 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.810400 2.818430 -9.293730 0.000000 0.000000 0.000000 -2.418800 -7.330400 -0.811300 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064699 9.800200 -8.214600 43.297001 -3.707600 19.509300 -9.539500 67.280998 12.878700 31.828800 49.938900 13.843800 18.433800 18.058300 -0.060300 55.341801 -80.710396 6.513686 -0.282871 99.825333 -0.674134 -9.190516 -13.881958 4.629443 2.096669 -80.007927 -8.202291 -1.616939 99.918793 1.317311 9.056993 -15.388410 -0.997557 -4.118979
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 23.344410 1.159146 0.787797 -5.632582 -1.706663 -8.309045 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.760765 2.628929 -9.291166 0.000000 0.000000 0.000000 -2.418800 -7.330400 -0.811300 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064699 9.800200 -8.214600 43.297001 -3.707600 19.509300 -9.539500 67.280998 12.878700 31.828800 49.938900 13.843800 18.433800 18.058300 -0.060300 55.341801 -80.693199 6.612239 -0.291641 99.839989 -0.772778 -9.180444 -13.946154 4.428677 2.172705 -80.003632 -8.245581 -1.621523 99.920021 1.346951 9.062195 -15.328702 -1.012920 -4.140097
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 23.282820 0.993821 0.725038 -5.634784 -1.567817 -8.306980 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.711130 2.439427 -9.288602 0.000000 0.000000 0.000000 -2.418800 -7.330400 -0.811300 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064699 9.800200 -8.214600 43.297001 -3.707600 19.509300 -9.539500 67.280998 12.878700 31.828800 49.938900 13.843800 18.433800 18.058300 -0.060300 55.341801 -80.685219 6.703459 -0.286528 99.863335 -0.854945 -9.181154 -14.003063 4.241853 2.258799 -79.950783 -8.291809 -1.616029 99.952049 1.402634 9.062596 -15.367139 -1.024083 -4.190748
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 23.221230 0.828497 0.662278 -5.636986 -1.428970 -8.304915 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.661495 2.249926 -9.286037 0.000000 0.000000 0.000000 -2.418800 -7.330400 -0.811300 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064699 9.800200 -8.214600 43.297001 -3.707600 19.509300 -9.539500 67.280998 12.878700 31.828800 49.938900 13.843800 18.433800 18.058300 -0.060300 55.341801 -80.667908 6.803130 -0.296163 99.878059 -0.955041 -9.172701 -14.061670 4.039531 2.333687 -79.956932 -8.337340 -1.609672 99.934944 1.455034 9.063181 -15.277460 -1.047969 -4.212713
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 23.159639 0.663172 0.599518 -5.639188 -1.290124 -8.302851 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.611860 2.060424 -9.283474 0.000000 0.000000 0.000000 -2.418800 -7.330400 -0.811300 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064699 9.800200 -8.214600 43.297001 -3.707600 19.509300 -9.539500 67.280998 12.878700 31.828800 49.938900 13.843800 18.433800 18.058300 -0.060300 55.341801 -80.707603 6.914013 -0.294665 99.863510 -1.050708 -9.156631 -14.042909 3.811841 2.412342 -79.990997 -8.387027 -1.618792 99.927116 1.486313 9.050206 -15.169321 -1.054980 -4.241894
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 23.098049 0.497848 0.536759 -5.641390 -1.151277 -8.300785 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.562225 1.870923 -9.280910 0.000000 0.000000 0.000000 -2.418800 -7.330400 -0.811300 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064699 9.800200 -8.214600 43.297001 -3.707600 19.509300 -9.539500 67.280998 12.878700 31.828800 49.938900 13.843800 18.433800 18.058300 -0.060300 55.341801 -80.689377 7.018662 -0.298866 99.809319 -1.149674 -9.158791 -14.033837 3.613069 2.495564 -79.937370 -8.433875 -1.622267 99.967369 1.517037 9.061286 -15.207257 -1.072707 -4.283732
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 23.036459 0.332523 0.473999 -5.643592 -1.012431 -8.298720 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.512590 1.681422 -9.278346 0.000000 0.000000 0.000000 -2.418800 -7.330400 -0.811300 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064699 9.800200 -8.214600 43.297001 -3.707600 19.509300 -9.539500 67.280998 12.878700 31.828800 49.938900 13.843800 18.433800 18.058300 -0.060300 55.341801 -80.709412 7.129354 -0.297808 99.871765 -1.232692 -9.164733 -14.105558 3.402184 2.588746 -79.952232 -8.490499 -1.616791 100.009155 1.569074 9.058808 -15.177814 -1.073583 -4.322686
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 22.974869 0.167199 0.411239 -5.645794 -0.873584 -8.296656 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.462955 1.491920 -9.275782 0.000000 0.000000 0.000000 -2.418800 -7.330400 -0.811300 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064699 9.800200 -8.214600 43.297001 -3.707600 19.509300 -9.539500 67.280998 12.878700 31.828800 49.938900 13.843800 18.433800 18.058300 -0.060300 55.341801 -80.671539 7.231766 -0.300439 99.847214 -1.330432 -9.159117 -14.143842 3.191097 2.671165 -79.983688 -8.573734 -1.620535 100.030708 1.614877 9.066291 -15.109808 -1.065939 -4.360067
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 22.913279 0.001874 0.348479 -5.647996 -0.734738 -8.294590 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.413321 1.302419 -9.273218 0.000000 0.000000 0.000000 -2.418800 -7.330400 -0.811300 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064699 9.800200 -8.214600 43.297001 -3.707600 19.509300 -9.539500 67.280998 12.878700 31.828800 49.938900 13.843800 18.433800 18.058300 -0.060300 55.341801 -80.642693 7.334507 -0.294028 99.842178 -1.424945 -9.151748 -14.196482 2.991758 2.755060 -80.036728 -8.740204 -1.627717 100.061119 1.631236 9.060006 -15.028068 -0.969684 -4.375781
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 22.851688 -0.163450 0.285720 -5.650198 -0.595891 -8.292524 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.363686 1.112917 -9.270655 0.000000 0.000000 0.000000 -2.418800 -7.330400 -0.811300 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064699 9.800200 -8.214600 43.297001 -3.707600 19.509300 -9.539500 67.280998 12.878700 31.828800 49.938900 13.843800 18.433800 18.058300 -0.060300 55.341801 -80.529556 7.606574 -0.276037 99.836754 -1.506150 -9.138556 -14.321285 2.601479 2.836400 -80.036728 -8.740204 -1.627717 99.975456 1.689817 9.069006 -14.886281 -1.042104 -4.423136
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 22.790100 -0.328775 0.222960 -5.652400 -0.457045 -8.290460 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.314050 0.923416 -9.268090 0.000000 0.000000 0.000000 -2.418800 -7.330400 -0.811300 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064699 9.800200 -8.214600 43.297001 -3.707600 19.509300 -9.539500 67.280998 12.878700 31.828800 49.938900 13.843800 18.433800 18.058300 -0.060300 55.341801 -80.529556 7.606574 -0.276037 99.958511 -1.593631 -9.138300 -14.467773 2.500639 2.944140 -80.036728 -8.740204 -1.627717 99.890060 1.738380 9.056893 -14.745159 -1.099041 -4.448681
Property changes on: maven/trunk/ogoglio-bodies/ogoglio-body-andrea/src/main/resources/animation/sit.bvh
___________________________________________________________________
Name: svn:executable
+ *
Added: maven/trunk/ogoglio-bodies/ogoglio-body-mike/src/main/resources/animation/sit.bvh
===================================================================
--- maven/trunk/ogoglio-bodies/ogoglio-body-mike/src/main/resources/animation/sit.bvh (rev 0)
+++ maven/trunk/ogoglio-bodies/ogoglio-body-mike/src/main/resources/animation/sit.bvh 2007-10-19 00:58:59 UTC (rev 516)
@@ -0,0 +1,179 @@
+HIERARCHY
+ROOT hip
+{
+ OFFSET 0.00 0.00 0.00
+ CHANNELS 6 Xposition Yposition Zposition Xrotation Zrotation Yrotation
+ JOINT abdomen
+ {
+ OFFSET 0.000000 0.000000 0.000000
+ CHANNELS 3 Xrotation Zrotation Yrotation
+ JOINT chest
+ {
+ OFFSET 0.000000 5.018152 -1.882228
+ CHANNELS 3 Xrotation Zrotation Yrotation
+ JOINT neckDummy
+ {
+ OFFSET 0.000000 8.316447 0.784897
+ CHANNELS 3 Xrotation Yrotation Zrotation
+ JOINT neck
+ {
+ OFFSET 0.000000 2.280413 -0.392801
+ CHANNELS 3 Xrotation Zrotation Yrotation
+ JOINT head
+ {
+ OFFSET 0.000000 3.496879 0.529469
+ CHANNELS 3 Xrotation Zrotation Yrotation
+ JOINT figureHair
+ {
+ OFFSET 0.000000 4.699570 0.720622
+ CHANNELS 3 Zrotation Yrotation Xrotation
+ End Site
+ {
+ OFFSET 0.000000 -6.419331 0.000000
+ }
+ }
+ }
+ }
+ }
+ JOINT lCollar
+ {
+ OFFSET 0.599237 8.316447 0.784897
+ CHANNELS 3 Yrotation Zrotation Xrotation
+ JOINT lShldr
+ {
+ OFFSET 6.421198 0.010146 -0.332128
+ CHANNELS 3 Zrotation Yrotation Xrotation
+ JOINT lForeArm
+ {
+ OFFSET 10.552783 0.025574 0.125508
+ CHANNELS 3 Yrotation Zrotation Xrotation
+ JOINT lHand
+ {
+ OFFSET 11.035963 0.319619 0.041520
+ CHANNELS 3 Zrotation Yrotation Xrotation
+ End Site
+ {
+ OFFSET 10.353753 0.000000 0.000000
+ }
+ }
+ }
+ }
+ }
+ JOINT rCollar
+ {
+ OFFSET -0.599237 8.316447 0.784897
+ CHANNELS 3 Yrotation Zrotation Xrotation
+ JOINT rShldr
+ {
+ OFFSET -6.421198 0.010146 -0.332128
+ CHANNELS 3 Zrotation Yrotation Xrotation
+ JOINT rForeArm
+ {
+ OFFSET -10.552783 0.025574 0.125508
+ CHANNELS 3 Yrotation Zrotation Xrotation
+ JOINT rHand
+ {
+ OFFSET -11.035963 0.319619 0.041520
+ CHANNELS 3 Zrotation Yrotation Xrotation
+ End Site
+ {
+ OFFSET -10.353753 0.000000 0.000000
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ JOINT lThigh
+ {
+ OFFSET 4.500466 -6.400484 -1.832696
+ CHANNELS 3 Xrotation Zrotation Yrotation
+ JOINT lShin
+ {
+ OFFSET -1.359117 -18.918689 1.179887
+ CHANNELS 3 Xrotation Zrotation Yrotation
+ JOINT lFoot
+ {
+ OFFSET -0.652380 -17.215186 -0.312137
+ CHANNELS 3 Xrotation Yrotation Zrotation
+ End Site
+ {
+ OFFSET 0.000000 0.000000 10.353752
+ }
+ }
+ }
+ }
+ JOINT rThigh
+ {
+ OFFSET -4.500466 -6.400484 -1.832696
+ CHANNELS 3 Xrotation Zrotation Yrotation
+ JOINT rShin
+ {
+ OFFSET 1.359117 -18.918689 1.179887
+ CHANNELS 3 Xrotation Zrotation Yrotation
+ JOINT rFoot
+ {
+ OFFSET 0.652380 -17.215186 -0.312137
+ CHANNELS 3 Xrotation Yrotation Zrotation
+ End Site
+ {
+ OFFSET 0.000000 0.000000 10.353752
+ }
+ }
+ }
+ }
+}
+MOTION
+Frames: 50
+Frame Time: 0.041667
+0.000000 42.014908 0.240040 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 2.021920 -5.690310 -0.063351 -70.100700 9.978770 15.991600 -22.515600 -9.303740 0.147736 5.969490 -0.173112 0.175734 -2.021920 5.690310 -0.063351 70.100700 -9.978770 15.991600 22.515600 9.303740 0.147736 -5.969490 0.173112 0.175734 -7.545480 4.001929 0.126583 15.872740 -3.319793 -0.839247 -8.608498 1.050494 -0.878046 -7.531943 -4.331991 0.100592 15.814292 3.299639 0.618600 -8.640055 -1.563356 0.936766
+-0.001136 42.047485 0.258350 0.015281 -0.160640 1.231823 -0.202867 -1.017794 5.550867 -0.022891 -2.631103 2.992019 0.000000 0.000000 0.000000 0.000000 0.000000 1.297549 3.800558 -1.201557 7.998749 0.000000 0.000000 0.000000 1.994514 -5.197196 -0.066307 -67.927406 9.117760 16.272688 -21.930227 -10.127905 0.184120 7.175318 0.005541 -0.197885 -2.073291 5.740149 -0.032077 69.997414 -10.220204 15.994469 22.056313 9.142480 0.185973 -6.503005 1.401555 -2.041011 -7.551804 4.214809 0.125835 15.585843 -3.309215 -0.808465 -8.337039 -0.217005 -0.943522 -7.072927 -4.077958 0.028241 15.140048 3.277331 0.570500 -8.423216 -2.749167 0.862214
+-0.002857 42.096840 0.286087 0.029094 -0.365053 2.705819 -0.405597 -2.258602 12.353542 -0.052194 -5.847550 6.673011 0.000000 0.000000 0.000000 0.000000 0.000000 2.867914 8.444941 -2.649465 17.763105 0.000000 0.000000 0.000000 2.026428 -4.493691 -0.053350 -65.288086 8.063235 16.616686 -21.241461 -11.135085 0.222496 8.258029 0.234520 -0.622607 -2.153154 5.878275 0.045403 70.024467 -10.651922 15.978795 21.412695 9.311210 0.253536 -6.883192 3.187223 -5.134254 -7.501410 4.496881 0.123082 15.118730 -3.299616 -0.766510 -7.970469 -1.727266 -1.048025 -6.452955 -3.748653 -0.055355 14.178856 3.239592 0.472283 -8.083669 -4.153584 0.781128
+-0.003286 42.109127 0.292991 0.061213 -0.535572 4.277362 -0.777409 -3.492378 18.982010 -0.075997 -9.012057 10.205709 0.000000 0.000000 0.000000 0.000000 0.000000 4.480512 13.028363 -4.157663 27.440105 0.000000 0.000000 0.000000 2.106382 -3.666201 -0.027852 -62.624863 7.033216 16.953691 -20.461637 -12.127282 0.283488 9.150728 0.488386 -1.057494 -2.251019 6.080780 0.156168 70.160461 -11.211857 15.948553 20.662586 9.747875 0.340776 -7.102841 5.307372 -8.863679 -7.733775 4.735919 0.120272 15.098766 -3.299485 -0.765173 -7.820042 -3.331604 -1.135538 -6.111829 -3.485498 -0.127818 13.752612 3.218626 0.442000 -8.054342 -5.678007 0.704172
+0.000000 42.014908 0.240040 0.140966 -0.588000 5.920680 -1.579400 -4.545870 24.255800 -0.081138 -11.618200 12.859500 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 16.840300 -5.638830 35.604698 0.000000 0.000000 0.000000 2.188578 -2.810312 -0.001600 -60.240200 6.206450 17.227100 -19.525499 -12.948100 0.400552 10.078557 0.751147 -1.508068 -2.352196 6.289758 0.270502 70.299858 -11.790388 15.917407 19.886646 10.196711 0.430919 -7.332713 7.500043 -13.019673 -8.672421 4.828678 0.146981 16.364857 -3.346981 -0.905014 -8.241468 -4.977678 -1.109998 -6.623362 -3.453089 -0.197466 14.911632 3.268945 0.563573 -8.767126 -7.294611 0.632392
+0.008106 41.758495 0.093278 0.286617 -0.465829 7.598319 -2.919785 -5.289261 27.298862 -0.058123 -13.293894 14.099704 0.000000 0.000000 0.000000 0.000000 0.000000 7.315878 19.311069 -7.011647 41.139530 0.000000 0.000000 0.000000 2.227221 -2.021616 0.013618 -58.374638 5.701050 17.393173 -18.427805 -13.479096 0.587695 11.266666 1.006811 -1.979855 -2.441995 6.447314 0.358690 70.337204 -12.277906 15.899037 19.165552 10.401958 0.507188 -7.743576 9.503284 -17.392633 -10.711632 4.735614 0.181811 19.500193 -3.476861 -1.197509 -9.489000 -6.637327 -0.951120 -8.415224 -3.777928 -0.249301 18.396254 3.414390 0.917017 -10.594095 -8.999483 0.561660
+0.016877 41.339180 -0.160993 0.472185 -0.223303 9.226099 -4.295254 -5.766469 28.452793 -0.012122 -14.204382 14.175374 0.000000 0.000000 0.000000 0.000000 0.000000 8.417012 20.434372 -8.218807 44.157990 0.000000 0.000000 0.000000 2.176512 -1.395702 0.006016 -57.021053 5.392597 17.459612 -17.403440 -13.753652 0.781114 12.940200 1.239383 -2.478377 -2.505727 6.495546 0.391018 70.166992 -12.564794 15.907110 18.579964 10.107853 0.552805 -8.506192 11.055137 -21.772951 -13.706823 4.490720 0.248237 24.247133 -3.662852 -1.674194 -11.342396 -8.183679 -0.657165 -11.571109 -4.258971 -0.275373 23.999399 3.634807 1.505209 -13.201004 -10.669835 0.315946
+0.020842 40.769993 -0.531403 0.660630 0.057650 10.708160 -5.049613 -6.064847 28.363611 0.048028 -14.649241 13.531502 0.000000 0.000000 0.000000 0.000000 0.000000 9.317108 20.344748 -9.209007 45.081150 0.000000 0.000000 0.000000 1.990654 -1.028158 -0.036195 -56.110439 5.096044 17.446981 -16.747332 -13.843108 0.897551 15.324302 1.432872 -3.009158 -2.528701 6.376553 0.337769 69.683716 -12.541431 15.955297 18.210548 9.058629 0.550996 -9.791324 11.893643 -25.951015 -17.437792 4.198074 0.338902 30.074774 -3.858332 -2.266191 -13.475947 -9.548857 -0.221030 -15.383269 -4.977664 -0.287406 30.727306 3.876024 2.184429 -16.246342 -12.078061 0.165571
+0.014530 40.063969 -1.026583 0.814910 0.295098 11.948647 -4.526672 -6.271750 27.677338 0.113491 -14.928055 12.613079 0.000000 0.000000 0.000000 0.000000 0.000000 10.029876 19.176733 -9.930942 44.330078 0.000000 0.000000 0.000000 1.623849 -1.014575 -0.124801 -55.573788 4.626344 17.375854 -16.754408 -13.818810 0.853750 18.644119 1.571285 -3.577721 -2.496229 6.032434 0.169230 68.781883 -12.098205 16.057272 18.137974 6.998525 0.484983 -11.769738 11.756850 -29.717213 -21.666656 3.954324 0.443313 36.503391 -4.044169 -2.934869 -15.638267 -10.672198 0.278965 -19.613991 -5.710900 -0.279835 37.803112 4.065731 2.911026 -19.196899 -13.162488 -0.046318
+-0.007528 39.234142 -1.655163 0.897985 0.407112 12.851700 -2.070240 -6.474530 27.040001 0.175430 -15.340400 11.865100 0.000000 0.000000 0.000000 0.000000 0.000000 10.569020 17.064877 -10.333308 42.325867 0.000000 0.000000 0.000000 1.030300 -1.450540 -0.271591 -55.342098 3.798450 17.266800 -17.719601 -13.752100 0.566455 23.124800 1.638630 -4.189590 -2.393620 5.405290 -0.144315 67.356003 -11.125500 16.226700 18.442900 3.671780 0.337990 -14.612200 10.382800 -32.861942 -26.143826 3.846021 0.554989 43.048153 -4.172040 -3.623220 -17.589991 -11.449199 0.840408 -23.938587 -6.463055 -0.274669 44.984058 4.191748 3.669371 -22.069221 -13.790672 -0.121726
+-0.050137 38.292961 -2.409089 0.882349 0.337312 13.353222 2.706291 -6.743101 26.934940 0.224199 -16.094496 11.606818 0.000000 0.000000 0.000000 0.000000 0.000000 10.948249 14.143720 -10.364807 39.489601 0.000000 0.000000 0.000000 0.198067 -2.374392 -0.480962 -55.373985 2.487314 17.137873 -19.762753 -13.696319 -0.000414 28.751705 1.681599 -4.830937 -2.211814 4.486124 -0.621754 65.330505 -9.567327 16.466475 19.172091 -1.036520 0.114412 -18.264462 7.752028 -35.175598 -30.707300 3.953771 0.675722 49.288216 -4.214429 -4.315293 -19.088308 -11.875370 1.386264 -28.477438 -6.873167 -0.220213 51.558327 4.208741 4.360595 -24.106689 -14.144130 -0.270036
+-0.115429 37.250546 -3.213563 0.778648 0.131524 13.516165 9.111165 -7.077611 27.194798 0.246917 -17.033125 11.654552 0.000000 0.000000 0.000000 0.000000 0.000000 11.181270 10.547808 -9.974133 36.242355 0.000000 0.000000 0.000000 -0.749360 -3.595456 -0.727751 -55.738575 0.807899 16.997055 -22.303387 -13.632792 -0.694226 34.551033 1.997627 -5.410524 -1.964272 3.461572 -1.238661 62.749615 -7.582217 16.736366 20.236719 -6.677859 -0.096668 -21.772221 4.815056 -36.448566 -35.223942 4.236428 0.764493 55.312519 -4.176326 -4.968762 -20.384064 -12.023439 1.903501 -32.657665 -7.230220 -0.219549 57.641293 4.117342 5.020196 -25.918390 -14.136715 -0.290269
+-0.204869 36.116421 -3.977106 0.607063 -0.138876 13.435247 16.183052 -7.460773 27.489546 0.229894 -17.907717 11.698886 0.000000 0.000000 0.000000 0.000000 0.000000 11.281791 6.411681 -9.109984 33.005203 0.000000 0.000000 0.000000 -1.654636 -4.865809 -0.979408 -56.532635 -1.064830 16.849812 -24.585958 -13.524848 -1.315175 39.309212 2.946833 -5.817761 -1.670083 2.567176 -1.959786 59.687500 -5.382332 16.985371 21.514063 -12.662883 -0.184997 -23.956169 2.764890 -36.471245 -39.669811 4.646955 0.772826 61.285667 -4.039305 -5.623230 -21.678022 -11.919246 2.350195 -37.009411 -7.279677 -0.227884 63.486649 3.918202 5.641013 -27.336681 -14.054149 -0.454885
+-0.319923 34.900127 -4.608232 0.387775 -0.402509 13.205188 22.960609 -7.875296 27.489159 0.159439 -18.469700 11.430408 0.000000 0.000000 0.000000 0.000000 0.000000 11.263515 1.869889 -7.721058 30.199228 0.000000 0.000000 0.000000 -2.360411 -5.937526 -1.203382 -57.852928 -2.955908 16.701603 -25.854912 -13.335809 -1.663455 41.812660 4.889338 -5.942060 -1.348339 2.038479 -2.749876 56.218346 -3.179836 17.162485 22.881397 -18.402214 -0.040321 -23.636997 2.794546 -35.034027 -43.965260 5.135311 0.690983 67.382362 -3.814714 -6.268446 -23.232658 -11.684981 2.697291 -41.309090 -7.166585 -0.281345 69.357353 3.652169 6.216343 -28.788540 -13.927116 -0.737134
+-0.462055 33.611195 -5.015463 0.140966 -0.588000 12.920700 28.482500 -8.303890 26.863600 0.021864 -18.470501 10.539700 0.000000 0.000000 0.000000 0.000000 0.000000 11.140156 -2.943030 -5.756050 28.245501 0.000000 0.000000 0.000000 -2.709340 -6.562680 -1.367120 -59.796200 -4.690370 16.557899 -25.354700 -13.029000 -1.539260 40.847801 8.185260 -5.672830 -1.018130 2.111020 -3.573680 52.416302 -1.186890 17.216700 24.216000 -23.306499 0.447615 -19.635401 6.097030 -31.927299 -48.061069 5.653193 0.479244 73.787239 -3.474089 -6.889403 -25.328661 -11.391047 2.863119 -45.139637 -7.147304 -0.481332 75.543465 3.301003 6.828876 -30.997875 -13.621574 -1.176313
+-0.625463 32.258106 -5.221559 -0.087118 -0.647162 12.685126 32.141991 -8.714515 25.368425 -0.278603 -17.744574 8.753790 0.000000 0.000000 0.000000 0.000000 0.000000 10.925414 -7.825219 -3.290900 27.354988 0.000000 0.000000 0.000000 -2.514160 -6.420678 -1.452255 -62.329395 -6.144660 16.428251 -23.208241 -12.761728 -0.993648 36.654705 12.391641 -4.982024 -0.749251 2.890534 -4.389220 48.485493 0.562473 17.124125 25.807608 -26.889833 1.483009 -11.844831 12.917302 -27.275766 -52.032818 6.121557 0.178778 80.399940 -3.065367 -7.491178 -27.786781 -11.096766 2.902039 -48.836628 -7.206628 -0.747539 82.045853 2.900582 7.426325 -33.690441 -13.261812 -1.793520
+-0.775271 30.845148 -5.706260 -0.145974 -0.624573 12.636305 34.750740 -9.016124 23.101532 -1.166061 -16.458477 5.945470 0.000000 0.000000 0.000000 0.000000 0.000000 10.632996 -12.305557 -0.910501 26.898216 0.000000 0.000000 0.000000 -1.467941 -4.900249 -1.497147 -64.900131 -7.400843 16.338558 -23.052319 -13.467224 -1.081142 35.288033 13.853205 -4.171755 -0.814312 3.963524 -5.127613 45.149837 2.746739 16.969330 29.595821 -29.080166 3.645842 -4.449783 19.708128 -22.541378 -56.329060 6.338910 0.136681 85.893959 -2.727632 -7.982375 -28.876787 -11.003044 3.166472 -53.101933 -7.461143 -0.796327 87.790771 2.519392 7.935912 -35.187824 -13.149985 -2.232794
+-0.869335 29.375566 -7.063550 0.140966 -0.588000 12.920700 37.474998 -9.102920 20.246401 -3.146690 -14.861800 2.023970 0.000000 0.000000 0.000000 0.000000 0.000000 10.276609 -15.845600 0.673007 26.035603 0.000000 0.000000 0.000000 0.766166 -1.317450 -1.554340 -66.826202 -8.592390 16.318800 -29.402201 -16.272699 -3.107130 44.256100 8.111580 -3.626680 -1.536630 4.786680 -5.713250 43.263199 6.222520 16.864000 37.932701 -29.908899 7.610040 -2.707540 21.974199 -19.520399 -62.393833 6.131525 0.781529 89.501648 -2.529813 -8.347482 -26.404787 -11.069010 4.096362 -59.449234 -8.153783 -0.226388 92.011993 2.216583 8.261917 -33.339851 -13.439254 -1.951319
+-0.872431 27.886549 -9.542672 0.660576 -0.585714 13.415488 40.882645 -8.875570 17.194075 -6.338554 -13.222828 -2.826497 0.000000 0.000000 0.000000 0.000000 0.000000 9.869966 -17.821077 1.014126 23.927561 0.000000 0.000000 0.000000 4.015821 4.340507 -1.644702 -67.609413 -9.885515 16.389240 -44.205246 -21.322229 -7.541314 66.079781 -6.626896 -3.621811 -3.034421 5.164068 -6.112218 43.356716 11.201074 16.894766 51.570087 -29.110842 13.215491 -9.210017 17.106630 -18.929438 -69.892052 5.336908 2.244351 90.224297 -2.607593 -8.505087 -19.621990 -10.779461 5.738407 -67.848671 -9.353822 1.057089 93.872597 2.023984 8.354570 -27.166733 -13.644540 -0.653342
+-0.777013 26.551064 -12.013938 0.140966 -0.588000 12.920700 43.148102 -8.260590 15.165800 -9.307310 -11.884600 -7.321860 0.000000 0.000000 0.000000 0.000000 0.000000 9.426769 -17.264400 0.733914 19.734501 0.000000 0.000000 0.000000 6.071980 9.401870 -1.662390 -67.487602 -11.577400 16.531200 -59.137402 -24.827400 -11.510700 83.330399 -21.497299 -3.993590 -4.605520 6.289250 -6.457390 44.670601 15.312300 17.048000 64.859100 -25.234400 16.966000 -15.887800 10.042100 -17.166401 -75.341019 4.843800 3.455750 90.097908 -2.695096 -8.565252 -13.262901 -9.457743 7.071873 -74.263962 -10.155553 2.081025 94.466759 1.933840 8.348231 -20.709200 -12.765933 0.540243
+-0.591852 25.530415 -13.328908 -2.455969 -0.557183 10.407695 42.380375 -7.136115 15.093898 -10.760098 -11.018998 -10.140150 0.000000 0.000000 0.000000 0.000000 0.000000 8.960727 -13.584900 0.557259 13.013932 0.000000 0.000000 0.000000 4.952104 11.254337 -1.507222 -66.857559 -13.857865 16.697147 -65.650581 -23.260971 -12.243420 79.201653 -27.589514 -4.296614 -5.578798 9.128095 -6.860391 46.224689 16.194149 17.270897 72.147560 -17.503981 15.621323 -14.526196 6.287201 -10.536071 -76.707176 5.707410 3.380951 92.164139 -2.501134 -8.704925 -11.614241 -7.263399 7.239071 -75.908676 -9.556920 1.998037 95.644653 1.852712 8.464150 -17.665529 -10.838728 0.539092
+-0.363304 24.803457 -13.643139 -6.074385 -0.501732 6.610309 38.820499 -5.160920 15.924700 -11.522500 -10.038500 -10.907800 0.000000 0.000000 0.000000 0.000000 0.000000 8.485547 -8.042975 0.557812 4.911759 0.000000 0.000000 0.000000 1.616479 10.208116 -1.228365 -66.015770 -16.356316 16.763041 -64.572441 -18.073032 -10.714931 59.327023 -26.471737 -3.396677 -6.227700 12.346200 -7.181090 47.448299 14.098300 17.454201 74.171303 -9.034440 10.301300 -6.990950 6.082470 0.710524 -75.496025 6.961439 2.244997 95.905380 -2.133769 -8.915996 -13.544906 -4.234988 6.245570 -74.717163 -8.556355 1.092098 97.846397 1.747047 8.680337 -17.445347 -7.904090 -0.618339
+-0.147123 24.303423 -13.438188 -9.134972 -0.441656 2.702975 33.474945 -2.307904 16.147840 -12.606924 -8.502589 -9.806231 0.000000 0.000000 0.000000 0.000000 0.000000 8.014936 -2.361760 0.646416 -3.029062 0.000000 0.000000 0.000000 -2.238928 7.304027 -0.912318 -65.233643 -18.562061 16.585714 -59.074524 -11.957973 -8.837513 34.949783 -22.331715 0.012631 -6.877466 14.308359 -7.263671 48.239124 10.141443 17.425304 73.165558 -3.010855 3.229143 2.332134 8.351938 15.335871 -73.571877 7.398752 0.799846 99.652397 -1.722067 -9.104954 -16.761017 -0.476882 4.617184 -72.896591 -8.194424 -0.132631 100.280342 1.614837 8.934370 -18.506849 -4.307328 -2.469582
+0.000939 23.963556 -13.195612 -10.058400 -0.396959 -0.139853 28.280100 -0.025860 14.412100 -13.654600 -7.318210 -8.288430 0.000000 0.000000 0.000000 0.000000 0.000000 7.562603 1.735580 0.733914 -9.265530 0.000000 0.000000 0.000000 -4.918130 3.582900 -0.645584 -64.782600 -19.964399 16.021999 -52.328400 -7.610210 -8.523450 17.313299 -19.357201 7.237720 -7.115950 14.476300 -7.141320 49.958801 6.286670 16.814600 70.975098 0.990960 -3.318360 9.057210 12.019637 32.102402 -73.282913 7.460052 -0.364895 101.900253 -1.486730 -9.208735 -18.714811 2.437124 3.106550 -72.886467 -8.456903 -1.185964 101.642441 1.543463 9.101422 -18.670393 -1.253969 -4.131649
+0.043469 23.726555 -13.278124 -7.926306 -0.381788 -1.099397 24.939623 0.396672 9.992074 -14.115564 -7.321980 -7.730533 0.000000 0.000000 0.000000 0.000000 0.000000 7.142253 2.971139 0.751940 -12.647152 0.000000 0.000000 0.000000 -5.233160 -0.038699 -0.496564 -64.868721 -20.131510 15.157438 -47.100723 -6.850621 -10.608710 14.206190 -20.386114 18.689032 -6.521918 12.949107 -6.930665 53.784458 4.296818 15.571449 69.107430 4.158430 -7.350912 9.454207 16.009592 48.685352 -76.245377 7.782739 -0.699248 101.753265 -1.486786 -9.210054 -17.797413 3.157538 2.584072 -75.786819 -8.310682 -1.659614 101.088631 1.648746 9.118819 -17.210026 -0.491356 -4.751955
+0.016426 23.572933 -13.573064 -4.464168 -0.386842 -0.779546 23.296490 -0.211947 4.506510 -14.046229 -7.721753 -7.929712 0.000000 0.000000 0.000000 0.000000 0.000000 6.767593 1.848017 0.715297 -13.593440 0.000000 0.000000 0.000000 -4.028121 -3.141241 -0.461256 -65.436722 -18.947090 14.992432 -44.538521 -8.005962 -11.623996 19.598129 -22.857027 31.193110 -5.375175 11.278348 -6.893106 58.691280 4.287345 15.118093 68.111450 7.122568 -8.077724 2.416154 19.245832 58.411160 -80.572365 7.762822 -0.495983 100.244797 -1.633601 -9.132307 -15.388410 2.853946 2.768085 -80.085068 -8.467069 -1.709246 99.736031 1.785352 9.043935 -15.031303 -0.734781 -4.628127
+-0.025891 23.492668 -13.848934 -2.058400 -0.396959 -0.139853 22.728500 -0.494140 0.160156 -13.654600 -7.318200 -8.288400 0.000000 0.000000 0.000000 0.000000 0.000000 6.452331 -0.685447 0.659579 -12.916411 0.000000 0.000000 0.000000 -2.655120 -5.429470 -0.517557 -66.365997 -16.373699 16.756100 -45.383900 -8.529470 -7.023700 24.004101 -22.858700 40.680599 -4.130780 11.378700 -7.326240 63.104000 5.961870 17.245001 68.296402 10.375300 -5.007880 -12.508200 20.652399 53.519100 -83.582695 7.636213 -0.186658 98.951874 -1.798568 -9.068689 -13.419610 2.309466 3.084131 -83.092674 -8.671844 -1.606984 98.685860 1.894741 8.962910 -13.441343 -1.225798 -4.382638
+-0.041389 23.472105 -13.933654 -2.355244 -0.400345 0.073362 22.663372 0.302029 -1.410207 -12.763442 -5.288787 -8.358323 0.000000 0.000000 0.000000 0.000000 0.000000 6.210174 -3.680905 0.620380 -11.428075 0.000000 0.000000 0.000000 -2.146618 -6.714589 -0.635816 -67.489677 -12.660131 21.005629 -49.690632 -6.675766 5.520680 20.655518 -17.934645 44.302353 -3.244061 14.340141 -8.337900 65.804955 8.829684 22.809927 68.480186 13.839926 1.976072 -29.558062 18.727209 34.185310 -83.444283 7.587450 -0.121380 98.962868 -1.827669 -9.074026 -13.260627 2.131085 3.186827 -82.958527 -8.769772 -1.578251 98.724609 1.903192 8.986553 -13.307418 -1.393921 -4.351883
+-0.036799 23.483084 -13.892812 -4.040154 -0.398677 -0.033274 22.728500 0.505900 -0.839800 -9.654600 -2.318200 -8.288400 0.000000 0.000000 0.000000 0.000000 0.000000 6.054828 -6.190008 0.633294 -9.940445 0.000000 0.000000 0.000000 -2.256451 -7.233702 -0.756190 -68.455856 -9.200068 25.610476 -54.759129 -3.905049 19.469149 13.649653 -11.447479 44.090389 -3.171410 17.953800 -9.276880 67.007080 11.622759 28.939779 61.515598 15.165300 11.497700 -18.124701 10.263800 32.333698 -81.643768 7.596544 -0.201949 99.672813 -1.750242 -9.120222 -14.112836 2.247701 3.139502 -81.158745 -8.759913 -1.593118 99.357018 1.844714 9.036206 -14.052436 -1.301064 -4.417953
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 22.728500 -0.494100 0.160200 -5.654600 -0.318199 -8.288400 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.264420 0.733914 -9.265530 0.000000 0.000000 0.000000 -2.418800 -7.330390 -0.811291 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064671 9.800200 -8.214560 43.297001 -3.707600 19.509300 -9.539490 67.280998 12.878750 31.828800 49.938904 13.843800 18.433800 18.058350 -0.060270 55.341801 -80.529556 7.606574 -0.276037 100.080345 -1.682014 -9.139359 -14.624531 2.390794 3.050730 -80.036728 -8.740204 -1.627717 99.804337 1.786962 9.054121 -14.602128 -1.177025 -4.467085
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 22.796249 -0.312243 0.229236 -5.652178 -0.470930 -8.290670 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.319018 0.942366 -9.268350 0.000000 0.000000 0.000000 -2.418800 -7.330391 -0.811292 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064674 9.800200 -8.214563 43.297001 -3.707600 19.509300 -9.539491 67.280998 12.878745 31.828800 49.938904 13.843800 18.433800 18.058344 -0.060273 55.341801 -80.529556 7.606574 -0.276037 99.948349 -1.583841 -9.135448 -14.457079 2.505192 2.925035 -80.036728 -8.740204 -1.627717 99.899406 1.728640 9.056458 -14.764675 -1.100068 -4.439228
+-0.031061 23.493807 -13.851418 -5.058400 -0.397000 -0.139900 22.864000 -0.130386 0.298271 -5.649756 -0.623661 -8.292941 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 -7.373616 1.150817 -9.271170 0.000000 0.000000 0.000000 -2.418800 -7.330392 -0.811293 -68.866402 -7.673400 27.768200 -57.201500 -2.478900 26.064676 9.800200 -8.214567 43.297001 -3.707600 19.509300 -9.539492 67.280998 12.878740 31.828800 49.938904 13.843800 18.433800 18.058338 -0.060276 55.341801 -80.529556 7.606574 -0.276037 99.816490 -1.496572 -9.144343 -14.295455 2.634761 2.830058 -80.036728 -8.740204 -1.6277...
[truncated message content] |
|
From: <tre...@us...> - 2007-10-19 00:58:50
|
Revision: 515
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=515&view=rev
Author: trevorolio
Date: 2007-10-18 17:58:54 -0700 (Thu, 18 Oct 2007)
Log Message:
-----------
Now plays the sit animation when sitting.
Other folks see the sitting avatar, both upon the event and on initial load.
Need to add UI to template html.
Modified Paths:
--------------
maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
Modified: maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-10-19 00:58:48 UTC (rev 514)
+++ maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-10-19 00:58:54 UTC (rev 515)
@@ -144,7 +144,7 @@
if (user == null || bodyPanel == null || bodyPanel.renderable == null) {
return;
}
- bodyPanel.renderable.playAnimation(animationName, false);
+ bodyPanel.renderable.playAnimation(animationName, false, true);
}
public String getBodyConfigurationDocument() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-19 00:58:44
|
Revision: 514
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=514&view=rev
Author: trevorolio
Date: 2007-10-18 17:58:48 -0700 (Thu, 18 Oct 2007)
Log Message:
-----------
Now plays the sit animation when sitting.
Other folks see the sitting avatar, both upon the event and on initial load.
Need to add UI to template html.
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/BodyConstants.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/BodyConstants.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/BodyConstants.java 2007-10-18 18:57:24 UTC (rev 513)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/BodyConstants.java 2007-10-19 00:58:48 UTC (rev 514)
@@ -7,4 +7,5 @@
public static final String WALK_ANIMATION_NAME = "walk";
+ public static final String SIT_ANIMATION_NAME = "sit";
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java 2007-10-18 18:57:24 UTC (rev 513)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java 2007-10-19 00:58:48 UTC (rev 514)
@@ -402,6 +402,7 @@
return;
}
thingRenderable.addSitter(renderable);
+ renderable.playAnimation(BodyConstants.SIT_ANIMATION_NAME, false, false);
return;
}
@@ -427,7 +428,7 @@
}
startRenderableMotion(renderable, path);
if (!offScreen) {
- renderable.playAnimation(BodyConstants.WALK_ANIMATION_NAME, true);
+ renderable.playAnimation(BodyConstants.WALK_ANIMATION_NAME, true, true);
}
}
@@ -454,6 +455,7 @@
}
usersGroup.removeChild(userRenderable);
thingRenderable.addSitter(userRenderable);
+ userRenderable.playAnimation(BodyConstants.SIT_ANIMATION_NAME, false, false);
}
public void userStood(User user, Thing oldSeat) {
@@ -481,7 +483,7 @@
return;
}
if (!offScreen) {
- renderable.playAnimation(animationName, false);
+ renderable.playAnimation(animationName, false, true);
}
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java 2007-10-18 18:57:24 UTC (rev 513)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java 2007-10-19 00:58:48 UTC (rev 514)
@@ -67,13 +67,15 @@
private float skeletonScale = 1;
private BodyAnimator animator = null;
-
+
private Bvh[] animations = new Bvh[0];
private BodyAnimatorListener bodyAnimatorListener = new BodyAnimatorListener();
private float userHeight = 2; //meters
+ private boolean playDefaultAnimationWhenComplete = true;
+
public J3DUserRenderable(User user, J3DBodyData bodyData, BufferedImage customSkin) {
ArgumentUtils.assertNotNull(user);
this.user = user;
@@ -102,7 +104,7 @@
for (int i = 0; i < sourceAnimations.length; i++) {
animations[i] = sourceAnimations[i].cloneBvh();
scaleBvh(animations[i]);
- if(animations[i].getName().equals(BodyConstants.DEFAULT_ANIMATION_NAME)){
+ if (animations[i].getName().equals(BodyConstants.DEFAULT_ANIMATION_NAME)) {
defaultAnimation = animations[i];
}
}
@@ -127,7 +129,7 @@
bodyGroup.addChild(skeletonBranch);
setPosition(user.getPosition());
- playAnimation(BodyConstants.DEFAULT_ANIMATION_NAME, false);
+ playAnimation(BodyConstants.DEFAULT_ANIMATION_NAME, false, true);
}
private void scaleBvh(Bvh bvh) {
@@ -222,14 +224,14 @@
stopAnimation();
}
- public void updateMorphs(){
+ public void updateMorphs() {
skin.updateMorphs();
}
-
- public void setSkinTexture(BufferedImage skinTexture){
+
+ public void setSkinTexture(BufferedImage skinTexture) {
skin.setBaseImage(skinTexture);
}
-
+
public void repaintSkinTexture() {
skin.updateTexture();
}
@@ -239,7 +241,9 @@
animator.cleanup();
animator = null;
}
- playAnimation(BodyConstants.DEFAULT_ANIMATION_NAME, false);
+ if (playDefaultAnimationWhenComplete) {
+ playAnimation(BodyConstants.DEFAULT_ANIMATION_NAME, false, false);
+ }
}
private class BodyAnimatorListener implements BodyAnimator.Listener {
@@ -247,27 +251,30 @@
if (animator.getBvh().getName().equals(BodyConstants.DEFAULT_ANIMATION_NAME)) {
return;
}
- playAnimation(BodyConstants.DEFAULT_ANIMATION_NAME, false);
+ if (playDefaultAnimationWhenComplete) {
+ playAnimation(BodyConstants.DEFAULT_ANIMATION_NAME, false, false);
+ }
}
}
- public Bvh getAnimation(String animationName){
+ public Bvh getAnimation(String animationName) {
for (int i = 0; i < animations.length; i++) {
- if(animations[i].getName().equals(animationName)){
+ if (animations[i].getName().equals(animationName)) {
return animations[i];
}
}
return null;
}
-
- public synchronized void playAnimation(String animationName, boolean loop) {
+
+ public void playAnimation(String animationName, boolean loop, boolean playDefaultWhenComplete) {
if (animator != null) {
animator.cleanup();
}
Bvh animation = getAnimation(animationName);
- if(animation == null){
+ if (animation == null) {
return;
}
+ this.playDefaultAnimationWhenComplete = playDefaultWhenComplete;
animator = new BodyAnimator(skeleton, animation, skin, bodyAnimatorListener);
animator.animate(loop);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-18 18:57:22
|
Revision: 513
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=513&view=rev
Author: trevorolio
Date: 2007-10-18 11:57:24 -0700 (Thu, 18 Oct 2007)
Log Message:
-----------
Two thirds of the way to sitting:
Added a "Sit Here" context menu item for things made from templates with seat metadata.
Bound the avatar renderable to the seat thing renderable's transform group (hello, flying sofa).
If an avatar moves or teleports while seated, it stands.
Tried to be somewhat good about progressive loading, showing standing avatars before things and then sitting avatars.
Not yet done:
Call the sit animation.
Add seat metadata UI to the template editor HTML.
Make a flying Le Corbusier sofa with info panel controls.
Modified Paths:
--------------
maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/ViewerApplet.java
Modified: maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/ViewerApplet.java
===================================================================
--- maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/ViewerApplet.java 2007-10-18 18:57:19 UTC (rev 512)
+++ maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/ViewerApplet.java 2007-10-18 18:57:24 UTC (rev 513)
@@ -314,10 +314,6 @@
public void disconnected() {
addChatMessage("Disconnected.");
- //removeAll();
- //validate();
- //add(new ErrorPanel("Unfortunately, I lost the connection to the server."), BorderLayout.CENTER);
- //validate();
}
public void receivedChatMessage(String username, String message) {
@@ -369,6 +365,8 @@
JMenuItem moveItem = null;
+ JMenuItem seatItem = null;
+
Thing thing = null;
long startTime;
@@ -380,6 +378,15 @@
nonce = theNonce;
startTime = System.currentTimeMillis();
+ if(theThing.getTemplate().isASeat()){
+ seatItem = add("Sit Here");
+ seatItem.addActionListener(new ActionListener(){
+ public void actionPerformed(ActionEvent e){
+ spaceClient.userRequestedSeat(thing);
+ }
+ });
+ }
+
moveItem = add("Move");
moveItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-18 18:57:15
|
Revision: 512
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=512&view=rev
Author: trevorolio
Date: 2007-10-18 11:57:19 -0700 (Thu, 18 Oct 2007)
Log Message:
-----------
Two thirds of the way to sitting:
Added a "Sit Here" context menu item for things made from templates with seat metadata.
Bound the avatar renderable to the seat thing renderable's transform group (hello, flying sofa).
If an avatar moves or teleports while seated, it stands.
Tried to be somewhat good about progressive loading, showing standing avatars before things and then sitting avatars.
Not yet done:
Call the sit animation.
Add seat metadata UI to the template editor HTML.
Make a flying Le Corbusier sofa with info panel controls.
Modified Paths:
--------------
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java
Modified: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java 2007-10-18 18:57:16 UTC (rev 511)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java 2007-10-18 18:57:19 UTC (rev 512)
@@ -56,50 +56,52 @@
private boolean noCache = true;
-
// WARNING: This is really, really easy to hose yourself with this. This will get called
// WARNING: during the init() of this class, so it is very easy to end up calling this
// WARNING: init method "too soon" in your init method, before you are fully initialized
public abstract SiteResource createBaseResource(ServletConfig servletConfig);
- protected Context initCtx=null;
- protected String baseUrl=null;
-
+ protected Context initCtx = null;
+
+ protected String baseUrl = null;
+
protected void initContext() throws NamingException {
- if (initCtx==null) {
- initCtx = new InitialContext();
- }
+ if (initCtx == null) {
+ initCtx = new InitialContext();
+ }
}
+
public void initBaseUrl() throws NamingException {
- if (baseUrl==null) {
- initContext();
+ if (baseUrl == null) {
+ initContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
baseUrl = (String) envCtx.lookup(OGOGLIO_BASE_URL_KEY);
- }
+ }
}
+
public void init(ServletConfig config) throws ServletException {
try {
- initBaseUrl();
+ initBaseUrl();
} catch (NamingException e) {
throw new ServletException("Could not init in AbstractResourceServlet: " + e);
}
super.init(config);
-
+
baseResource = createBaseResource(config);
-
- if (baseResource==null) {
- Log.warn("Class "+getClass().getName()+" should be sure it eventually sets the value of the base resource on it's servlet.");
+
+ if (baseResource == null) {
+ Log.warn("Class " + getClass().getName() + " should be sure it eventually sets the value of the base resource on it's servlet.");
} else {
- if (!(baseResource.getPathElement() instanceof String)) {
- throw new IllegalStateException("The base resource must have a String path element: " + baseResource.getPathElement());
- }
+ if (!(baseResource.getPathElement() instanceof String)) {
+ throw new IllegalStateException("The base resource must have a String path element: " + baseResource.getPathElement());
+ }
}
}
public String getBaseUrl() {
- return baseUrl;
- }
+ return baseUrl;
+ }
public void destroy() {
super.destroy();
@@ -112,6 +114,7 @@
response.addHeader("Cache-Control", "no-store");
response.setDateHeader("Expires", 0);
}
+
public static String getRequestAuthCookie(HttpServletRequest request) {
Cookie[] cookies = request.getCookies();
for (int i = 0; cookies != null && i < cookies.length; i++) {
@@ -122,12 +125,11 @@
return null;
}
-
public static void setCachable(HttpServletResponse response) {
response.setHeader("Cache-Control", "public");
response.setDateHeader("Expires", System.currentTimeMillis() + 10000000);
}
-
+
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
if (noCache) {
setNoCache(response);
@@ -137,13 +139,13 @@
String[] pathElements = getPathElements((String) baseResource.getPathElement(), requestURI);
- if (pathElements==null) {
- Log.error("Can't understand path elements in "+getClass().getCanonicalName()+"! "+requestURI);
- Log.error(" baseResource for errant service() is "+baseResource.getClass().getCanonicalName());
+ if (pathElements == null) {
+ Log.error("Can't understand path elements in " + getClass().getCanonicalName() + "! " + requestURI);
+ Log.error(" baseResource for errant service() is " + baseResource.getClass().getCanonicalName());
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
}
-
+
SiteResource requestedResource = getSiteResource(pathElements, baseResource);
if (requestedResource == null) {
@@ -231,8 +233,8 @@
outputStream.flush();
outputStream.close();
}
- if (connection.getResponseCode()!=200) {
- Log.warn("Proxy sending error to client: "+connection.getResponseCode()+" on "+uri);
+ if (connection.getResponseCode() != 200 && connection.getResponseCode() != 404) {
+ Log.warn("Proxy sending error to client: " + connection.getResponseCode() + " on " + uri);
}
response.setStatus(connection.getResponseCode());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-18 18:57:12
|
Revision: 511
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=511&view=rev
Author: trevorolio
Date: 2007-10-18 11:57:16 -0700 (Thu, 18 Oct 2007)
Log Message:
-----------
Two thirds of the way to sitting:
Added a "Sit Here" context menu item for things made from templates with seat metadata.
Bound the avatar renderable to the seat thing renderable's transform group (hello, flying sofa).
If an avatar moves or teleports while seated, it stands.
Tried to be somewhat good about progressive loading, showing standing avatars before things and then sitting avatars.
Not yet done:
Call the sit animation.
Add seat metadata UI to the template editor HTML.
Make a flying Le Corbusier sofa with info panel controls.
Modified Paths:
--------------
maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
Modified: maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-10-18 18:57:11 UTC (rev 510)
+++ maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-10-18 18:57:16 UTC (rev 511)
@@ -167,7 +167,7 @@
private class SpacelessUser extends User {
public SpacelessUser(String username, BodyConfigurationDocument bodyConfigDoc) {
- super(new Space(new SpacelessContext(), 1, "Space", "nobody", false, 0), username, new Transform3D(), new BodyConfiguration(bodyConfigDoc));
+ super(new Space(new SpacelessContext(), 1, "Space", "nobody", false, 0), username, new Transform3D(), new BodyConfiguration(bodyConfigDoc), null);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-18 18:57:09
|
Revision: 510
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=510&view=rev
Author: trevorolio
Date: 2007-10-18 11:57:11 -0700 (Thu, 18 Oct 2007)
Log Message:
-----------
Two thirds of the way to sitting:
Added a "Sit Here" context menu item for things made from templates with seat metadata.
Bound the avatar renderable to the seat thing renderable's transform group (hello, flying sofa).
If an avatar moves or teleports while seated, it stands.
Tried to be somewhat good about progressive loading, showing standing avatars before things and then sitting avatars.
Not yet done:
Call the sit animation.
Add seat metadata UI to the template editor HTML.
Make a flying Le Corbusier sofa with info panel controls.
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Space.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/User.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DThingRenderable.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SpaceEvent.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/UserDocument.java
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/XMLTest.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2007-10-18 18:56:57 UTC (rev 509)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2007-10-18 18:57:11 UTC (rev 510)
@@ -104,8 +104,7 @@
//create the event channel and start queuing events
Object selector = AsyncProtoFactory.getDefaultInfo().getProxySpecificSelector();
- messageChannel = new TCPChannel(AsyncProtoFactory.getDefaultClient(serviceURI.getHost(), selector),
- messenger, true, new ChannelListener());
+ messageChannel = new TCPChannel(AsyncProtoFactory.getDefaultClient(serviceURI.getHost(), selector), messenger, true, new ChannelListener());
messenger.authenticate(authCookie);
long startWait = System.currentTimeMillis();
@@ -127,22 +126,6 @@
}
}
- //can't use spaceDoc list of users because it doesn't include the user that just authed (me!)
- UserDocument[] userDocs = webClient.getUserDocuments(spaceID);
- for (int i = 0; i < userDocs.length; i++) {
- BodyConfigurationDocument bodyConfDoc = null;
- if (userDocs[i].getUsername().startsWith(WebConstants.GUEST_COOKIE_PREFIX)) {
- System.out.println("Need to handle guest bodies correctly");
- bodyConfDoc = new BodyConfigurationDocument(0, userDocs[i].getUsername(), "Body", 1);
- } else {
- bodyConfDoc = webClient.getBodyConfiguration(userDocs[i].getUsername(), userDocs[i].getBodyConfigurationID());
- }
- BodyConfiguration bodyConfig = new BodyConfiguration(bodyConfDoc.getBodyConfigurationID(), bodyConfDoc.getDisplayName(), bodyConfDoc.getBodyDataID());
- User user = new User(space, userDocs[i].getUsername(), userDocs[i].getTransform(), bodyConfig);
- bodyConfig.setUser(user);
- space.addUser(user);
- }
-
ThingDocument[] thingDocs = spaceDoc.getThingDocuments();
for (int i = 0; i < thingDocs.length; i++) {
Template template = space.getTemplate(thingDocs[i].getTemplateID());
@@ -175,6 +158,26 @@
}
+ //can't use spaceDoc list of users because it doesn't include the user that just authed (me!)
+ UserDocument[] userDocs = webClient.getUserDocuments(spaceID);
+ for (int i = 0; i < userDocs.length; i++) {
+ BodyConfigurationDocument bodyConfDoc = null;
+ if (userDocs[i].getUsername().startsWith(WebConstants.GUEST_COOKIE_PREFIX)) {
+ System.out.println("Need to handle guest bodies correctly");
+ bodyConfDoc = new BodyConfigurationDocument(0, userDocs[i].getUsername(), "Body", 1);
+ } else {
+ bodyConfDoc = webClient.getBodyConfiguration(userDocs[i].getUsername(), userDocs[i].getBodyConfigurationID());
+ }
+ BodyConfiguration bodyConfig = new BodyConfiguration(bodyConfDoc.getBodyConfigurationID(), bodyConfDoc.getDisplayName(), bodyConfDoc.getBodyDataID());
+ Thing seatThing = null;
+ if (userDocs[i].getSeatThingID() != -1) {
+ seatThing = space.getThing(userDocs[i].getSeatThingID());
+ }
+ User user = new User(space, userDocs[i].getUsername(), userDocs[i].getTransform(), bodyConfig, seatThing);
+ bodyConfig.setUser(user);
+ space.addUser(user);
+ }
+
DoorDocument[] doorDocs = spaceDoc.getDoorDocuments();
for (int i = 0; i < doorDocs.length; i++) {
Template template = space.getTemplate(doorDocs[i].getTemplateID());
@@ -300,13 +303,26 @@
sendSpaceEvent(event);
}
+ public void userRequestedSeat(Thing seatThing) {
+ User user = space.getUser(accountDoc.getUsername());
+ if (user == null || user.getSeat() == seatThing) {
+ return;
+ }
+ user.setSeat(seatThing);
+
+ SpaceEvent event = new SpaceEvent(SpaceEvent.USER_SAT_EVENT);
+ event.setProperty(SpaceEvent.USERNAME, accountDoc.getUsername());
+ event.setProperty(SpaceEvent.THING_ID, new Long(seatThing.getThingID()));
+ sendSpaceEvent(event);
+ }
+
private void handleMessageFromService(Message message) {
if (message.getPayload() instanceof PayloadFactory.SpaceEventPayload) {
SpaceEvent event = ((PayloadFactory.SpaceEventPayload) message.getPayload()).getSpaceEvent();
if (SpaceEvent.ADD_USER_EVENT.equals(event.getName())) {
BodyConfigurationDocument bodyConfigDoc = event.getBodyConfigurationDocument();
BodyConfiguration bodyConfig = new BodyConfiguration(bodyConfigDoc);
- User user = new User(space, event.getStringProperty(SpaceEvent.USERNAME), event.getTransform(), bodyConfig);
+ User user = new User(space, event.getStringProperty(SpaceEvent.USERNAME), event.getTransform(), bodyConfig, null);
space.addUser(user);
} else if (SpaceEvent.REMOVE_USER_EVENT.equals(event.getName())) {
User user = space.getUser(event.getStringProperty(SpaceEvent.USERNAME));
@@ -473,6 +489,27 @@
}
user.stopMotion(event.getTransform());
+ } else if (SpaceEvent.USER_SAT_EVENT.equals(event.getName())) {
+ if (accountDoc.getUsername().equals(event.getStringProperty(SpaceEvent.USERNAME))) {
+ return;
+ }
+
+ User user = space.getUser(event.getStringProperty(SpaceEvent.USERNAME));
+ if (user == null) {
+ Log.error("Got a sit event for an unknown user: " + event.getStringProperty(SpaceEvent.USERNAME));
+ return;
+ }
+ Thing thing = space.getThing(event.getLongProperty(SpaceEvent.THING_ID).longValue());
+ if (thing == null) {
+ Log.error("Got a sit event for an unknown thing: " + user.getUsername() + ", " + event.getLongProperty(SpaceEvent.THING_ID));
+ return;
+ }
+ if (!thing.getTemplate().isASeat()) {
+ Log.error("Got a sit event for a thing which is not a seat: " + user.getUsername() + ", " + event.getLongProperty(SpaceEvent.THING_ID));
+ return;
+ }
+ user.setSeat(thing);
+
} else if (SpaceEvent.THING_START_MOTION_EVENT.equals(event.getName())) {
long thingID = event.getLongProperty(SpaceEvent.THING_ID).longValue();
Thing thing = space.getThing(thingID);
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Space.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Space.java 2007-10-18 18:56:57 UTC (rev 509)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Space.java 2007-10-18 18:57:11 UTC (rev 510)
@@ -42,9 +42,9 @@
private String ownerUsername = null;
private boolean displaySea = false;
-
+
private double seaLevel = 0;
-
+
private HashMap templates = new HashMap(); // Long templateIDs to Templates
private HashMap things = new HashMap(); // Long thingIDs to Things
@@ -62,7 +62,7 @@
this.spaceContext = spaceContext;
ArgumentUtils.assertNotNegative(spaceID);
this.spaceID = spaceID;
-
+
ArgumentUtils.assertNotNull(displayName);
this.displayName = displayName;
@@ -76,11 +76,11 @@
public boolean shouldDisplaySea() {
return displaySea;
}
-
+
public double getSeaLevel() {
return seaLevel;
}
-
+
private class ListenerList {
Vector list = new Vector();
@@ -114,20 +114,31 @@
Thing[] things = getThings();
Arrays.sort(things, new DistanceComparator());
-
+
if (things.length > 0) {
listener.thingAdded(things[0]);
}
User[] users = getUsers();
+
+ //We can't show seated users until after the things are loaded, but we should show as many as possible
for (int i = 0; i < users.length; i++) {
- listener.userAdded(users[i]);
+ if (users[i].getSeat() == null) {
+ listener.userAdded(users[i]);
+ }
}
for (int i = 1; i < things.length; i++) {
listener.thingAdded(things[i]);
}
+ //now show seated users
+ for (int i = 0; i < users.length; i++) {
+ if (users[i].getSeat() != null) {
+ listener.userAdded(users[i]);
+ }
+ }
+
Door[] doors = getDoors();
for (int i = 0; i < doors.length; i++) {
listener.doorAdded(doors[i]);
@@ -204,6 +215,10 @@
public void userAnimationStarted(User user, String animationName);
+ public void userSat(User user, Thing seatThing);
+
+ public void userStood(User user, Thing seat);
+
}
public interface Context {
@@ -497,4 +512,18 @@
public InputStream getPageContentStream(long thingID, long pageID) throws IOException {
return spaceContext.getPageContentStream(thingID, pageID);
}
+
+ public void notifyUserSat(User user, Thing seatThing) {
+ Listener[] listeners = listenerList.getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ listeners[i].userSat(user, seatThing);
+ }
+ }
+
+ public void notifyUserStood(User user, Thing seat) {
+ Listener[] listeners = listenerList.getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ listeners[i].userStood(user, seat);
+ }
+ }
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/User.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/User.java 2007-10-18 18:56:57 UTC (rev 509)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/User.java 2007-10-18 18:57:11 UTC (rev 510)
@@ -31,8 +31,10 @@
private SplinePath path = null;
private BodyConfiguration bodyConfiguration = null;
-
- public User(Space space, String username, Transform3D position, BodyConfiguration bodyConfiguration) {
+
+ private Thing seatThing = null;
+
+ public User(Space space, String username, Transform3D position, BodyConfiguration bodyConfiguration, Thing seatThing) {
ArgumentUtils.assertNotNull(space);
this.space = space;
ArgumentUtils.assertNotNull(username);
@@ -42,16 +44,18 @@
ArgumentUtils.assertNotNull(bodyConfiguration);
this.bodyConfiguration = bodyConfiguration;
bodyConfiguration.setUser(this);
+ this.seatThing = seatThing;
}
public void startMotion(SplinePath path) {
- //TODO make the model reflect the ongoing movement along the path (by listening to the renderer's motion calcs?)
+ setSeat(null);
this.path = path;
this.pathStarted = System.currentTimeMillis();
space.notifyUserMotionStarted(this, path);
}
public void stopMotion(Transform3D position) {
+ setSeat(null);
this.path = null;
this.pathStarted = -1;
space.notifyUserMotionStopped(this, position);
@@ -61,10 +65,10 @@
space.notifyUserAnimationStarted(this, animationName);
}
- public BodyConfiguration getBodyConfiguration(){
+ public BodyConfiguration getBodyConfiguration() {
return bodyConfiguration;
}
-
+
public String toString() {
return "User: " + username;
}
@@ -80,7 +84,7 @@
public String getUsername() {
return username;
}
-
+
public void setPosition(Transform3D newPosition) {
position.set(newPosition);
}
@@ -88,10 +92,27 @@
public SplinePath getSplinePath() {
SplinePath path = this.path;
long pathStarted = this.pathStarted;
- if(path == null || (!path.isLooping() && pathStarted < System.currentTimeMillis() - path.getDuration())) {
+ if (path == null || (!path.isLooping() && pathStarted < System.currentTimeMillis() - path.getDuration())) {
return null;
}
return path;
}
+ public Thing getSeat() {
+ return seatThing;
+ }
+
+ public void setSeat(Thing seatThing) {
+ if(this.seatThing == seatThing){
+ return;
+ }
+
+ Thing oldSeat = this.seatThing;
+ this.seatThing = seatThing;
+ if (seatThing == null) {
+ space.notifyUserStood(this, oldSeat);
+ } else {
+ space.notifyUserSat(this, seatThing);
+ }
+ }
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java 2007-10-18 18:56:57 UTC (rev 509)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java 2007-10-18 18:57:11 UTC (rev 510)
@@ -389,11 +389,23 @@
return;
}
try {
- UserRenderable renderable = createUserRenderable(user);
- if(rendererStopped){
+ J3DUserRenderable renderable = (J3DUserRenderable) createUserRenderable(user);
+ if (rendererStopped) {
return;
}
- addUserRenderable(renderable);
+
+ Thing seat = user.getSeat();
+ if (seat != null) {
+ J3DThingRenderable thingRenderable = (J3DThingRenderable)getThingRenderable(seat.getThingID());
+ if(thingRenderable == null){
+ Log.error("Error: tried to add a user sitting on an unknown thing: " + seat);
+ return;
+ }
+ thingRenderable.addSitter(renderable);
+ return;
+ }
+
+ usersGroup.addChild(renderable);
SplinePath path = user.getSplinePath();
if (path != null) {
userMotionStarted(user, path);
@@ -428,6 +440,38 @@
renderable.stopAnimation();
}
+ public void userSat(User user, Thing seatThing) {
+ if (rendererStopped) {
+ return;
+ }
+ J3DUserRenderable userRenderable = (J3DUserRenderable) getUserRenderable(user.getUsername());
+ if (userRenderable == null) { //haven't loaded the user renderable
+ return;
+ }
+ J3DThingRenderable thingRenderable = (J3DThingRenderable) getThingRenderable(seatThing.getThingID());
+ if (thingRenderable == null) { //haven't loaded the thing renderable
+ return;
+ }
+ usersGroup.removeChild(userRenderable);
+ thingRenderable.addSitter(userRenderable);
+ }
+
+ public void userStood(User user, Thing oldSeat) {
+ if (rendererStopped) {
+ return;
+ }
+ J3DUserRenderable userRenderable = (J3DUserRenderable) getUserRenderable(user.getUsername());
+ if (userRenderable == null) { //haven't loaded the user renderable
+ return;
+ }
+ J3DThingRenderable thingRenderable = (J3DThingRenderable) getThingRenderable(oldSeat.getThingID());
+ if (thingRenderable == null) { //haven't loaded the thing renderable
+ return;
+ }
+ thingRenderable.removeSitter(userRenderable);
+ usersGroup.addChild(userRenderable);
+ }
+
public void userAnimationStarted(User user, String animationName) {
if (rendererStopped) {
return;
@@ -552,24 +596,6 @@
return null;
}
- private void addUserRenderable(UserRenderable group) {
- usersGroup.addChild((J3DUserRenderable) group);
- }
-
- /*
- private UserRenderable[] getUserRenderables() {
- Vector results = new Vector();
- Enumeration children = usersGroup.getAllChildren();
- while (children.hasMoreElements()) {
- Node child = (Node) children.nextElement();
- if (child instanceof J3DUserRenderable) {
- results.add(child);
- }
- }
- return (UserRenderable[]) results.toArray(new UserRenderable[0]);
- }
- */
-
private void removeUserRenderable(UserRenderable renderable) {
if (renderable == null) {
Log.error("User renderable == null");
@@ -591,6 +617,18 @@
}
}
}
+ children = worldGroup.getAllChildren();
+ J3DUserRenderable result = null;
+ while(children.hasMoreElements()){
+ Node node = (Node) children.nextElement();
+ if (node instanceof J3DThingRenderable) {
+ J3DThingRenderable group = (J3DThingRenderable) node;
+ result = group.getSitter(username);
+ if(result != null){
+ return result;
+ }
+ }
+ }
return null;
}
@@ -619,15 +657,15 @@
private UserRenderable createUserRenderable(User user) throws IOException, RenderableParseException {
BodyConfiguration bodyConfig = user.getBodyConfiguration();
J3DBodyData bodyData = dataManager.getBodyData(bodyConfig.getBodyDataID());
- if(rendererStopped){ //this happens sometimes when someone logs in and then a space is cleaned up (usually during testing)
+ if (rendererStopped) { //this happens sometimes when someone logs in and then a space is cleaned up (usually during testing)
return null;
}
- if(bodyData == null){
+ if (bodyData == null) {
throw new IllegalStateException("Cannot load body data");
}
BufferedImage customSkin = dataManager.getBodyTexture(user.getUsername(), bodyConfig.getBodyConfigurationID());
-
+
boolean isLocalUser = !offScreen && username != null && user.getUsername().equals(username);
final J3DUserRenderable renderable = new J3DUserRenderable(user, bodyData, customSkin);
renderable.setID(USER_ID_PREFIX + user.getUsername());
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DThingRenderable.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DThingRenderable.java 2007-10-18 18:56:57 UTC (rev 509)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DThingRenderable.java 2007-10-18 18:57:11 UTC (rev 510)
@@ -24,7 +24,9 @@
import javax.media.j3d.Switch;
import javax.media.j3d.Transform3D;
import javax.media.j3d.TransformGroup;
+import javax.vecmath.Point3d;
import javax.vecmath.Point3f;
+import javax.vecmath.Vector3d;
import com.ogoglio.client.model.Thing;
import com.ogoglio.viewer.render.ThingRenderable;
@@ -145,4 +147,33 @@
return null;
}
+ public void addSitter(J3DUserRenderable userRenderable) {
+ transformGroup.addChild(userRenderable);
+ Transform3D seatTransform = new Transform3D();
+ seatTransform.setRotation(thing.getTemplate().getSeatRotation());
+ Point3d position = thing.getTemplate().getSeatPosition();
+ seatTransform.setTranslation(new Vector3d(position.x, position.y, position.z));
+ userRenderable.setPosition(seatTransform);
+ }
+
+ public void removeSitter(J3DUserRenderable userRenderable) {
+ transformGroup.removeChild(userRenderable);
+ Transform3D thingTransform = new Transform3D();
+ transformGroup.getTransform(thingTransform);
+ userRenderable.setPosition(thingTransform);
+ }
+
+ public J3DUserRenderable getSitter(String username) {
+ Enumeration children = transformGroup.getAllChildren();
+ while(children.hasMoreElements()){
+ Node node = (Node) children.nextElement();
+ if (node instanceof J3DUserRenderable) {
+ J3DUserRenderable userRenderable = (J3DUserRenderable)node;
+ if(userRenderable.getUser().getUsername().equals(username)){
+ return userRenderable;
+ }
+ }
+ }
+ return null;
+ }
}
\ No newline at end of file
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SpaceEvent.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SpaceEvent.java 2007-10-18 18:56:57 UTC (rev 509)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SpaceEvent.java 2007-10-18 18:57:11 UTC (rev 510)
@@ -218,10 +218,12 @@
public static final String THING_CONTEXT_SELECTION_MADE_EVENT = "contextMenuItemChosen";
- public static final String SHOW_INFO_PANEL_EVENT = "ShowInfoPanelEvent";
+ public static final String SHOW_INFO_PANEL_EVENT = "ShowInfoPanel";
public static final String INFO_PANEL_NONCE = "infoPanelNonce";
+ public static final String USER_SAT_EVENT = "UserSat";
+
private String name = null;
private HashMap properties = new HashMap();
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/UserDocument.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/UserDocument.java 2007-10-18 18:56:57 UTC (rev 509)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/UserDocument.java 2007-10-18 18:57:11 UTC (rev 510)
@@ -28,17 +28,20 @@
public static final String BODY_CONFIGURATION_ID = "bodyconfigurationid";
+ public static final String SEAT_THING_ID = "seatthingid";
+
public UserDocument(User user) {
- this(user.getUsername(), user.getPosition(), user.getSplinePath(), user.getBodyConfiguration().getBodyConfigurationID());
+ this(user.getUsername(), user.getPosition(), user.getSplinePath(), user.getBodyConfiguration().getBodyConfigurationID(), user.getSeat() == null ? -1 : user.getSeat().getThingID());
}
- public UserDocument(String username, Transform3D transform, SplinePath splinePath, long bodyConfigurationID) {
+ public UserDocument(String username, Transform3D transform, SplinePath splinePath, long bodyConfigurationID, long seatThingID) {
super(NAME, transform, splinePath);
ArgumentUtils.assertNotNull(username);
getData().setAttribute(USERNAME, username);
if (bodyConfigurationID >= 0) {
getData().setAttribute(BODY_CONFIGURATION_ID, bodyConfigurationID);
}
+ getData().setAttribute(SEAT_THING_ID, seatThingID);
}
public UserDocument(XMLElement data) {
@@ -56,4 +59,8 @@
public long getBodyConfigurationID() {
return getData().getLongAttribute(BODY_CONFIGURATION_ID);
}
+
+ public long getSeatThingID(){
+ return getData().getLongAttribute(SEAT_THING_ID);
+ }
}
Modified: maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/XMLTest.java
===================================================================
--- maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/XMLTest.java 2007-10-18 18:56:57 UTC (rev 509)
+++ maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/XMLTest.java 2007-10-18 18:57:11 UTC (rev 510)
@@ -189,13 +189,15 @@
assertEquals(0, shapeMove1.getSplinePath().getSplineKeyFrames()[1].getKnot(), keyFrames[1].getKnot());
assertEquals(shapeMove1.getShapeName(), "a_shape");
- UserDocument userDoc = new UserDocument(username, new Transform3D(), null, 23);
+ UserDocument userDoc = new UserDocument(username, new Transform3D(), null, 23, 24);
assertEquals(username, userDoc.getUsername());
assertEquals(23, userDoc.getBodyConfigurationID());
+ assertEquals(24, userDoc.getSeatThingID());
userDoc = new UserDocument(XMLElement.parseElementFromString(userDoc.toString()));
assertEquals(username, userDoc.getUsername());
assertEquals(23, userDoc.getBodyConfigurationID());
+ assertEquals(24, userDoc.getSeatThingID());
DoorDocument door1 = new DoorDocument(1, displayName, 2, "susan", uri1, new Transform3D());
assertEquals(1, door1.getDoorID());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-18 18:56:55
|
Revision: 509
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=509&view=rev
Author: trevorolio
Date: 2007-10-18 11:56:57 -0700 (Thu, 18 Oct 2007)
Log Message:
-----------
Two thirds of the way to sitting:
Added a "Sit Here" context menu item for things made from templates with seat metadata.
Bound the avatar renderable to the seat thing renderable's transform group (hello, flying sofa).
If an avatar moves or teleports while seated, it stands.
Tried to be somewhat good about progressive loading, showing standing avatars before things and then sitting avatars.
Not yet done:
Call the sit animation.
Add seat metadata UI to the template editor HTML.
Make a flying Le Corbusier sofa with info panel controls.
Modified Paths:
--------------
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
Modified: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2007-10-18 18:56:46 UTC (rev 508)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2007-10-18 18:56:57 UTC (rev 509)
@@ -326,6 +326,8 @@
checkGeometryAvailableForSpace(advancedClient, thingDocs, spaceClient1.getSpace());
guestSpaceClient1 = checkGuestCookieOperation(spaceDocument.getSpaceID(), advancedClient, WebConstants.GUEST_COOKIE_PREFIX + "Test_Suite_Guest");
+
+ checkUserSitting(spaceDocument, thingDocs, spaceClient1, guestSpaceClient1);
checkDeletingSpaceDestroysThings(spaceDocument.getSpaceID(), advancedClient, USERNAME1);
@@ -341,6 +343,25 @@
}
+ private void checkUserSitting(SpaceDocument spaceDocument, ThingDocument[] thingDocs, SpaceClient spaceClient1, SpaceClient guestSpaceClient1) {
+ assertFalse(thingDocs == null || thingDocs.length == 0);
+ Thing seatThing = spaceClient1.getSpace().getThings()[0];
+ assertTrue(seatThing.getTemplate().isASeat());
+ spaceClient1.userRequestedSeat(seatThing);
+
+ User remoteUser = guestSpaceClient1.getSpace().getUser(spaceClient1.getUsername());
+ long startTime = System.currentTimeMillis();
+ while(System.currentTimeMillis() - startTime < 30000 && remoteUser.getSeat() == null){
+ try {
+ Thread.sleep(500);
+ } catch (Exception e) {
+ }
+ }
+ Thing remoteSeatThing = guestSpaceClient1.getSpace().getUser(spaceClient1.getUsername()).getSeat();
+ assertTrue(remoteSeatThing != null);
+ assertEquals(seatThing.getThingID(), remoteSeatThing.getThingID());
+ }
+
private void checkSpaceDocumentCreateTime(SpaceDocument spaceDocument) {
try {
long now=new Date().getTime();
@@ -364,6 +385,8 @@
basicWebClient.uploadTemplateResourceStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), "TestCube.mtl", UIConstants.getResource("sample-art3d/TestCube.mtl"));
basicWebClient.uploadTemplateResourceStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), "TestCube.gif", UIConstants.getResource("sample-art3d/TestCube.gif"));
basicWebClient.updateTemplateScript(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), StreamUtils.readInput(UIConstants.getResource("sample-art3d/TestCube.js")));
+ newTemplateDoc.setSeat(true);
+ basicWebClient.updateTemplate(newTemplateDoc);
TemplateDocument[] templateDocs = basicWebClient.getTemplateDocuments(basicAuthenticator.getUsername());
assertNotNull(templateDocs);
@@ -619,7 +642,6 @@
assertEquals(0, thingDocs.length);
//put it back so the world is in the same state
- //XXX EVIL! DEPENDENCY BETWEEN TESTS! BOO HISS!
webClient1.addPossessionToSpace(possID, space1.getSpaceID());
}
@@ -670,7 +692,6 @@
}
//now check that we are the sole client
verifyUserDocsBySize(webClient1, spaceDoc.getSpaceID(), 1, USERNAME1);
- spaceClient1.cleanup();
return spaceClient1;
}
@@ -814,7 +835,7 @@
}
- //we done reload better check again
+ //better check again
thingDocs = webClient1.getThingDocuments(spaceDocument.getSpaceID());
//get shape doc for our one thing: it should be a thing
@@ -888,9 +909,11 @@
templateName = "Test Cube";
newTemplateDoc.setDisplayName(templateName);
+ newTemplateDoc.setSeat(true);
newTemplateDoc = webClient1.updateTemplate(newTemplateDoc);
assertEquals(templateName, newTemplateDoc.getDisplayName());
-
+ assertTrue(newTemplateDoc.isSeat());
+
assertEquals(false, newTemplateDoc.hasScriptFile());
assertNull(newTemplateDoc.getScriptModifiedTime());
@@ -923,7 +946,6 @@
newTemplateDoc = webClient1.getTemplateDocument(webClient1.getAuthenticator().getUsername(), newTemplateDoc.getTemplateID());
assertEquals(false, newTemplateDoc.hasScriptFile());
- assertFalse(newTemplateDoc.isSeat());
newTemplateDoc.setSeat(true);
Point3d seatPosition = new Point3d(3, 4, 5);
newTemplateDoc.setSeatPosition(seatPosition);
@@ -935,11 +957,6 @@
assertTrue(seatPosition.equals(newTemplateDoc.getSeatPosition()));
assertTrue(seatRot.equals(newTemplateDoc.getSeatRotation()));
- newTemplateDoc.setSeat(false);
- webClient1.updateTemplate(newTemplateDoc);
- newTemplateDoc = webClient1.getTemplateDocument(webClient1.getAuthenticator().getUsername(), newTemplateDoc.getTemplateID());
- assertEquals(false, newTemplateDoc.isSeat());
-
return newTemplateDoc;
}
@@ -1020,6 +1037,8 @@
Vector thingMotionStops = new Vector();
+ Vector userSats = new Vector();
+
public void userAdded(User person) {
if (person == null) {
fail();
@@ -1142,6 +1161,17 @@
public void templateRemoved(com.ogoglio.client.model.Template template) {
}
+ public void userSat(User user, Thing seatThing) {
+ if(user == null) fail();
+ if(seatThing == null) fail();
+ userSats.add(user);
+ }
+
+ public void userStood(User user, Thing seat) {
+ // TODO Auto-generated method stub
+
+ }
+
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-18 18:56:43
|
Revision: 508
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=508&view=rev
Author: trevorolio
Date: 2007-10-18 11:56:46 -0700 (Thu, 18 Oct 2007)
Log Message:
-----------
Two thirds of the way to sitting:
Added a "Sit Here" context menu item for things made from templates with seat metadata.
Bound the avatar renderable to the seat thing renderable's transform group (hello, flying sofa).
If an avatar moves or teleports while seated, it stands.
Tried to be somewhat good about progressive loading, showing standing avatars before things and then sitting avatars.
Not yet done:
Call the sit animation.
Add seat metadata UI to the template editor HTML.
Make a flying Le Corbusier sofa with info panel controls.
Modified Paths:
--------------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/SpaceScriptEngine.java
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java 2007-10-17 23:50:01 UTC (rev 507)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java 2007-10-18 18:56:46 UTC (rev 508)
@@ -231,7 +231,21 @@
}
user.stopMotion(event.getTransform());
listener.generatedSpaceEvent(event, SpaceSimulator.this);
-
+ } else if(SpaceEvent.USER_SAT_EVENT.equals(event.getName())){
+ String username = event.getStringProperty(SpaceEvent.USERNAME);
+ User user = space.getUser(username);
+ if (user == null) {
+ log("Received sit event for unknown user: " + username);
+ continue;
+ }
+ long thingID = event.getLongProperty(SpaceEvent.THING_ID).longValue();
+ Thing seatThing = space.getThing(thingID);
+ if(seatThing == null){
+ log("Received sit event for unknown thing: " + username + ", " + thingID);
+ }
+ user.setSeat(seatThing);
+ listener.generatedSpaceEvent(event, SpaceSimulator.this);
+
} else if (SpaceEvent.THING_START_MOTION_EVENT.equals(event.getName())) {
long thingID = event.getLongProperty(SpaceEvent.THING_ID).longValue();
Thing thing = space.getThing(thingID);
@@ -819,7 +833,7 @@
Transform3D position = new Transform3D();
position.setTranslation(new Vector3d(0, 0, 0));
BodyConfigurationDocument bodyConfigDoc = listener.getDefaultBodyConfigurationDocument(username);
- User user = new User(space, username, position, new BodyConfiguration(bodyConfigDoc));
+ User user = new User(space, username, position, new BodyConfiguration(bodyConfigDoc), null);
space.addUser(user);
SpaceEvent spaceEvent = new SpaceEvent(SpaceEvent.ADD_USER_EVENT);
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/SpaceScriptEngine.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/SpaceScriptEngine.java 2007-10-17 23:50:01 UTC (rev 507)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/SpaceScriptEngine.java 2007-10-18 18:56:46 UTC (rev 508)
@@ -466,4 +466,10 @@
public void userAnimationStarted(User user, String animationName) {
}
+
+ public void userSat(User user, Thing seatThing) {
+ }
+
+ public void userStood(User user, Thing seat) {
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-17 23:50:00
|
Revision: 507
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=507&view=rev
Author: trevorolio
Date: 2007-10-17 16:50:01 -0700 (Wed, 17 Oct 2007)
Log Message:
-----------
THIS CHECKIN BREAKS THE DB FORMAT. Drop and rebuild upon update.
Added several fields to templates to hold information about whether avatars can sit on them.
(not that the UI reflects this or the client actually supports it yet)
Modified Paths:
--------------
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
Modified: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2007-10-17 23:49:58 UTC (rev 506)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2007-10-17 23:50:01 UTC (rev 507)
@@ -15,7 +15,6 @@
import java.awt.Dimension;
import java.awt.Shape;
-import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
@@ -29,6 +28,8 @@
import java.util.Vector;
import javax.media.j3d.Transform3D;
+import javax.vecmath.Point3d;
+import javax.vecmath.Quat4d;
import javax.vecmath.Vector3d;
import junit.framework.TestCase;
@@ -921,6 +922,24 @@
newTemplateDoc = webClient1.getTemplateDocument(webClient1.getAuthenticator().getUsername(), newTemplateDoc.getTemplateID());
assertEquals(false, newTemplateDoc.hasScriptFile());
+
+ assertFalse(newTemplateDoc.isSeat());
+ newTemplateDoc.setSeat(true);
+ Point3d seatPosition = new Point3d(3, 4, 5);
+ newTemplateDoc.setSeatPosition(seatPosition);
+ Quat4d seatRot = new Quat4d(0.5, 0.5, 0.5, 0.5);
+ newTemplateDoc.setSeatRotation(seatRot);
+ webClient1.updateTemplate(newTemplateDoc);
+ newTemplateDoc = webClient1.getTemplateDocument(webClient1.getAuthenticator().getUsername(), newTemplateDoc.getTemplateID());
+ assertEquals(true, newTemplateDoc.isSeat());
+ assertTrue(seatPosition.equals(newTemplateDoc.getSeatPosition()));
+ assertTrue(seatRot.equals(newTemplateDoc.getSeatRotation()));
+
+ newTemplateDoc.setSeat(false);
+ webClient1.updateTemplate(newTemplateDoc);
+ newTemplateDoc = webClient1.getTemplateDocument(webClient1.getAuthenticator().getUsername(), newTemplateDoc.getTemplateID());
+ assertEquals(false, newTemplateDoc.isSeat());
+
return newTemplateDoc;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-17 23:49:54
|
Revision: 506
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=506&view=rev
Author: trevorolio
Date: 2007-10-17 16:49:58 -0700 (Wed, 17 Oct 2007)
Log Message:
-----------
THIS CHECKIN BREAKS THE DB FORMAT. Drop and rebuild upon update.
Added several fields to templates to hold information about whether avatars can sit on them.
(not that the UI reflects this or the client actually supports it yet)
Modified Paths:
--------------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplatePersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/xml/server/DocumentFactory.java
maven/trunk/ogoglio-server/src/main/resources/hibernate/migration-1.xml
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/sim/script/test/ScriptTest.java
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplatePersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplatePersistTasks.java 2007-10-17 23:49:54 UTC (rev 505)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplatePersistTasks.java 2007-10-17 23:49:58 UTC (rev 506)
@@ -15,6 +15,9 @@
import java.util.Date;
+import javax.vecmath.Point3d;
+import javax.vecmath.Quat4d;
+
import org.hibernate.Hibernate;
import org.hibernate.Query;
import org.hibernate.Session;
@@ -112,7 +115,27 @@
dirty = true;
record.setDisplayName(newDoc.getDisplayName().trim());
}
-
+
+ if(newDoc.isSeat() != record.isSeat()){
+ dirty = true;
+ record.setSeat(newDoc.isSeat());
+ }
+ Point3d seatPosition = newDoc.getSeatPosition();
+ if(seatPosition.x != record.getSeatX() || seatPosition.y != record.getSeatY() || seatPosition.z != record.getSeatZ()){
+ dirty = true;
+ record.setSeatX(seatPosition.x);
+ record.setSeatY(seatPosition.y);
+ record.setSeatZ(seatPosition.z);
+ }
+ Quat4d seatRotation = newDoc.getSeatRotation();
+ if(seatRotation.w != record.getSeatRW() || seatRotation.x != record.getSeatRX() || seatRotation.y != record.getSeatRY() || seatRotation.z != record.getSeatRZ()){
+ dirty = true;
+ record.setSeatRW(seatRotation.w);
+ record.setSeatRX(seatRotation.x);
+ record.setSeatRY(seatRotation.y);
+ record.setSeatRZ(seatRotation.z);
+ }
+
if(dirty) {
return update(record, sessionFactory);
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateRecord.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateRecord.java 2007-10-17 23:49:54 UTC (rev 505)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateRecord.java 2007-10-17 23:49:58 UTC (rev 506)
@@ -17,22 +17,29 @@
import java.util.Iterator;
import java.util.Set;
+import javax.vecmath.Point3d;
+import javax.vecmath.Quat4d;
+
import com.ogoglio.util.ArgumentUtils;
public class TemplateRecord {
private long templateID = -1;
-
+
private String ownerUsername = null;
-
+
private String displayName = null;
-
+
private String description = null;
- //private boolean scriptFile = false;
-
+ private boolean seat = false;
+
+ private double seatX = 0, seatY = 0, seatZ = 0;
+
+ private double seatRW = 1, seatRX = 0, seatRY = 0, seatRZ = 0;
+
private Set supportFiles = new HashSet();
-
+
public TemplateRecord() {
}
@@ -54,22 +61,21 @@
public String getOwnerUsername() {
return ownerUsername;
}
-
+
//hibernate access
private void setOwnerUsername(String ownerUsername) {
this.ownerUsername = ownerUsername;
}
-
+
//hibernate access
private void setTemplateID(long templateID) {
this.templateID = templateID;
}
-
+
public long getTemplateID() {
return templateID;
}
-
public String getDescription() {
return description;
}
@@ -77,91 +83,183 @@
public void setDescription(String description) {
this.description = description;
}
-
- public boolean hasScriptFile()
- {
- return findScriptFileRec()!=null;
+
+ public boolean hasScriptFile() {
+ return findScriptFileRec() != null;
}
+
public Set getSupportFiles() {
- return supportFiles;
+ return supportFiles;
}
+
public void setSupportFiles(Set newMaterials) {
- supportFiles=newMaterials;
+ supportFiles = newMaterials;
}
- public void addTemplateSupportFileRecord(TemplateSupportFileRecord sf) {
- supportFiles.add(sf);
- }
- public String scriptLastChanged() {
- TemplateSupportFileRecord scriptRec = findScriptFileRec();
- if (scriptRec==null) {
- return null;
- }
- return scriptRec.getLastChangedAsUTC();
- }
+ public void addTemplateSupportFileRecord(TemplateSupportFileRecord sf) {
+ supportFiles.add(sf);
+ }
+ public String scriptLastChanged() {
+ TemplateSupportFileRecord scriptRec = findScriptFileRec();
+ if (scriptRec == null) {
+ return null;
+ }
+ return scriptRec.getLastChangedAsUTC();
+ }
- private void sanityCheck(int lod) {
- int script=0, geom=0;
-
- Iterator iter=getSupportFiles().iterator();
- while (iter.hasNext()) {
- TemplateSupportFileRecord record = (TemplateSupportFileRecord) iter.next();
- if (record.isGeometryAtLevelOfDetail(lod)) {
- ++geom;
- }
- if (record.getScript()) {
- ++script;
- }
- }
- if (geom>1) {
- throw new IllegalArgumentException("Bogus TSF because there are "+geom+" geoms at LOD "+lod);
- }
- if (script>1) {
- throw new IllegalArgumentException("Bogus TSF because there are "+script+" scipts!");
- }
-
- }
- class TemplateSupportFileRecordFinder {
- public boolean find(TemplateSupportFileRecord record) {
- return false;
- }
- }
+ private void sanityCheck(int lod) {
+ int script = 0, geom = 0;
- private TemplateSupportFileRecord walkAndFindRecord(TemplateSupportFileRecordFinder finder) {
- sanityCheck(0);
- Iterator iter=getSupportFiles().iterator();
- while (iter.hasNext()) {
- TemplateSupportFileRecord record = (TemplateSupportFileRecord) iter.next();
- if (finder.find(record)) {
- return record;
- }
- }
- return null;
- }
- public TemplateSupportFileRecord findGeometryFileRec(final int lod) {
- TemplateSupportFileRecordFinder finder = new TemplateSupportFileRecordFinder() {
- public boolean find(TemplateSupportFileRecord record) {
- return record.isGeometryAtLevelOfDetail(lod);
- }
- };
- return walkAndFindRecord(finder);
- }
+ Iterator iter = getSupportFiles().iterator();
+ while (iter.hasNext()) {
+ TemplateSupportFileRecord record = (TemplateSupportFileRecord) iter.next();
+ if (record.isGeometryAtLevelOfDetail(lod)) {
+ ++geom;
+ }
+ if (record.getScript()) {
+ ++script;
+ }
+ }
+ if (geom > 1) {
+ throw new IllegalArgumentException("Bogus TSF because there are " + geom + " geoms at LOD " + lod);
+ }
+ if (script > 1) {
+ throw new IllegalArgumentException("Bogus TSF because there are " + script + " scipts!");
+ }
- public TemplateSupportFileRecord findSupportFile(final String name) {
- TemplateSupportFileRecordFinder finder = new TemplateSupportFileRecordFinder() {
- public boolean find(TemplateSupportFileRecord record) {
- return ((record.getSupportFile()!=null)&& (record.getSupportFile().equals(name)));
- }
- };
- return walkAndFindRecord(finder);
- }
- public TemplateSupportFileRecord findScriptFileRec() {
- TemplateSupportFileRecordFinder finder = new TemplateSupportFileRecordFinder() {
- public boolean find(TemplateSupportFileRecord record) {
- return record.getScript();
- }
- };
- return walkAndFindRecord(finder);
- }
+ }
+
+ class TemplateSupportFileRecordFinder {
+ public boolean find(TemplateSupportFileRecord record) {
+ return false;
+ }
+ }
+
+ private TemplateSupportFileRecord walkAndFindRecord(TemplateSupportFileRecordFinder finder) {
+ sanityCheck(0);
+ Iterator iter = getSupportFiles().iterator();
+ while (iter.hasNext()) {
+ TemplateSupportFileRecord record = (TemplateSupportFileRecord) iter.next();
+ if (finder.find(record)) {
+ return record;
+ }
+ }
+ return null;
+ }
+
+ public TemplateSupportFileRecord findGeometryFileRec(final int lod) {
+ TemplateSupportFileRecordFinder finder = new TemplateSupportFileRecordFinder() {
+ public boolean find(TemplateSupportFileRecord record) {
+ return record.isGeometryAtLevelOfDetail(lod);
+ }
+ };
+ return walkAndFindRecord(finder);
+ }
+
+ public TemplateSupportFileRecord findSupportFile(final String name) {
+ TemplateSupportFileRecordFinder finder = new TemplateSupportFileRecordFinder() {
+ public boolean find(TemplateSupportFileRecord record) {
+ return ((record.getSupportFile() != null) && (record.getSupportFile().equals(name)));
+ }
+ };
+ return walkAndFindRecord(finder);
+ }
+
+ public TemplateSupportFileRecord findScriptFileRec() {
+ TemplateSupportFileRecordFinder finder = new TemplateSupportFileRecordFinder() {
+ public boolean find(TemplateSupportFileRecord record) {
+ return record.getScript();
+ }
+ };
+ return walkAndFindRecord(finder);
+ }
+
+ public double getSeatX() {
+ return seatX;
+ }
+
+ public void setSeatX(double seatX) {
+ this.seatX = seatX;
+ }
+
+ public double getSeatY() {
+ return seatY;
+ }
+
+ public void setSeatY(double seatY) {
+ this.seatY = seatY;
+ }
+
+ public double getSeatZ() {
+ return seatZ;
+ }
+
+ public void setSeatZ(double seatZ) {
+ this.seatZ = seatZ;
+ }
+
+ public double getSeatRW() {
+ return seatRW;
+ }
+
+ public void setSeatRW(double seatRW) {
+ this.seatRW = seatRW;
+ }
+
+ public double getSeatRX() {
+ return seatRX;
+ }
+
+ public void setSeatRX(double seatRX) {
+ this.seatRX = seatRX;
+ }
+
+ public double getSeatRY() {
+ return seatRY;
+ }
+
+ public void setSeatRY(double seatRY) {
+ this.seatRY = seatRY;
+ }
+
+ public double getSeatRZ() {
+ return seatRZ;
+ }
+
+ public void setSeatRZ(double seatRZ) {
+ this.seatRZ = seatRZ;
+ }
+
+ public void getSeatPosition(Point3d point){
+ point.x = seatX;
+ point.y = seatY;
+ point.z = seatZ;
+ }
+
+ public void setSeatPosition(Point3d point){
+ seatX = point.x;
+ seatY = point.y;
+ seatZ = point.z;
+ }
+
+ public void getSeatQuat(Quat4d quat){
+ quat.set(seatRX, seatRY, seatRZ, seatRW);
+ }
+
+ public void setSeatQuat(Quat4d quat){
+ seatRW = quat.w;
+ seatRX = quat.x;
+ seatRY = quat.y;
+ seatRZ = quat.z;
+
+ }
+
+ public boolean isSeat() {
+ return seat;
+ }
+
+ public void setSeat(boolean seat) {
+ this.seat = seat;
+ }
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/xml/server/DocumentFactory.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/xml/server/DocumentFactory.java 2007-10-17 23:49:54 UTC (rev 505)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/xml/server/DocumentFactory.java 2007-10-17 23:49:58 UTC (rev 506)
@@ -56,7 +56,7 @@
TemplateSupportFileDocument doc = documentFromRecord(rec);
supportSet.add(doc);
}
- return new TemplateDocument(templateRecord.getTemplateID(), templateRecord.getDisplayName(), templateRecord.getOwnerUsername(), templateRecord.getDescription(), supportSet);
+ return new TemplateDocument(templateRecord.getTemplateID(), templateRecord.getDisplayName(), templateRecord.getOwnerUsername(), templateRecord.getDescription(), supportSet, templateRecord.isSeat(), templateRecord.getSeatX(), templateRecord.getSeatY(), templateRecord.getSeatZ(), templateRecord.getSeatRW(), templateRecord.getSeatRX(), templateRecord.getSeatRY(), templateRecord.getSeatRZ());
}
public static TemplateSupportFileDocument documentFromRecord(TemplateSupportFileRecord rec) {
Modified: maven/trunk/ogoglio-server/src/main/resources/hibernate/migration-1.xml
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/hibernate/migration-1.xml 2007-10-17 23:49:54 UTC (rev 505)
+++ maven/trunk/ogoglio-server/src/main/resources/hibernate/migration-1.xml 2007-10-17 23:49:58 UTC (rev 506)
@@ -102,6 +102,7 @@
<property name="ownerUsername" not-null="true" />
<property name="displayName" not-null="true" />
<property name="description" />
+ <property name="seat" />
<set name="supportFiles" table="TemplateTemplateSupportFiles"
cascade="all">
@@ -109,6 +110,14 @@
<many-to-many column="templateSupportFileID" unique="true"
class="com.ogoglio.persist.TemplateSupportFileRecord" />
</set>
+
+ <property name="seatX" />
+ <property name="seatY" />
+ <property name="seatZ" />
+ <property name="seatRX" />
+ <property name="seatRY" />
+ <property name="seatRZ" />
+ <property name="seatRW" />
</class>
<class name="com.ogoglio.appdev.migrate.DBVersionRecord"
Modified: maven/trunk/ogoglio-server/src/test/java/com/ogoglio/sim/script/test/ScriptTest.java
===================================================================
--- maven/trunk/ogoglio-server/src/test/java/com/ogoglio/sim/script/test/ScriptTest.java 2007-10-17 23:49:54 UTC (rev 505)
+++ maven/trunk/ogoglio-server/src/test/java/com/ogoglio/sim/script/test/ScriptTest.java 2007-10-17 23:49:58 UTC (rev 506)
@@ -33,7 +33,7 @@
spaceSimulator = new SpaceSimulator(spaceDocument, listener);
spaceSimulator.startSim();
- TemplateDocument templateDoc1 = new TemplateDocument(1, "Template 1", "trevor", "A cool template", null);
+ TemplateDocument templateDoc1 = new TemplateDocument(1, "Template 1", "trevor", "A cool template", null, false, 0, 0, 0, 1, 0, 0, 0);
listener.templateMap.put(new Long(1), templateDoc1);
listener.scriptMap.put(new Long(1), simplestScript);
listener.objMap.put(new Long(1), "templates/TestCube.obj");
@@ -41,7 +41,7 @@
ThingDocument thingDoc = spaceSimulator.addThing(templateDoc1.getTemplateID(), templateDoc1.getOwnerUsername(), templateDoc1.getDisplayName(), "trevor", 1, new Transform3D());
assertTrue(spaceSimulator.removeThing(thingDoc.getThingID()));
- TemplateDocument templateDoc2 = new TemplateDocument(2, "Template 2", "trevor", "Another cool template", null);
+ TemplateDocument templateDoc2 = new TemplateDocument(2, "Template 2", "trevor", "Another cool template", null, false, 0, 0, 0, 1, 0, 0, 0);
listener.templateMap.put(new Long(2), templateDoc2);
listener.scriptMap.put(new Long(2), constructorScript);
listener.objMap.put(new Long(2), "templates/TestCube.obj");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-17 23:49:50
|
Revision: 505
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=505&view=rev
Author: trevorolio
Date: 2007-10-17 16:49:54 -0700 (Wed, 17 Oct 2007)
Log Message:
-----------
THIS CHECKIN BREAKS THE DB FORMAT. Drop and rebuild upon update.
Added several fields to templates to hold information about whether avatars can sit on them.
(not that the UI reflects this or the client actually supports it yet)
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Template.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/TemplateDocument.java
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/XMLTest.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java 2007-10-17 20:45:00 UTC (rev 504)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java 2007-10-17 23:49:54 UTC (rev 505)
@@ -287,7 +287,7 @@
}
public TemplateDocument createTemplate(String templateName) throws IOException {
- TemplateDocument templateDoc = new TemplateDocument(-1, templateName, authenticator.getUsername(), null, null);
+ TemplateDocument templateDoc = new TemplateDocument(-1, templateName, authenticator.getUsername(), null, null, false, 0, 0, 0, 1, 0, 0, 0);
XMLElement templateXML = wire.postAuthenticatedXML(descriptor.getTemplatesURI(authenticator.getUsername()), templateDoc.toString(), authenticator.getAuthCookie());
return new TemplateDocument(templateXML);
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Template.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Template.java 2007-10-17 20:45:00 UTC (rev 504)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Template.java 2007-10-17 23:49:54 UTC (rev 505)
@@ -13,6 +13,9 @@
limitations under the License. */
package com.ogoglio.client.model;
+import javax.vecmath.Point3d;
+import javax.vecmath.Quat4d;
+
import com.ogoglio.util.ArgumentUtils;
import com.ogoglio.xml.TemplateDocument;
@@ -25,18 +28,27 @@
private String ownerUsername = null;
private String displayName = null;
+
+ private boolean isASeat = false;
- public Template(long templateID, String ownerUsername, String displayName) {
+ private Point3d seatPosition = new Point3d();
+
+ private Quat4d seatRotation = new Quat4d();
+
+ public Template(long templateID, String ownerUsername, String displayName, boolean isASeat, Point3d seatPosition, Quat4d seatRotation) {
ArgumentUtils.assertNotNegative(templateID);
this.templateID = templateID;
ArgumentUtils.assertNotNull(ownerUsername);
this.ownerUsername = ownerUsername;
ArgumentUtils.assertNotEmpty(displayName);
this.displayName = displayName;
+ this.isASeat = isASeat;
+ this.seatPosition.set(seatPosition);
+ this.seatRotation.set(seatRotation);
}
public Template(TemplateDocument templateDoc) {
- this(templateDoc.getTemplateID(), templateDoc.getOwnerUsername(), templateDoc.getDisplayName());
+ this(templateDoc.getTemplateID(), templateDoc.getOwnerUsername(), templateDoc.getDisplayName(), templateDoc.isSeat(), templateDoc.getSeatPosition(), templateDoc.getSeatRotation());
}
public long getTemplateID() {
@@ -50,4 +62,16 @@
public String getOwnerUsername() {
return ownerUsername;
}
+
+ public boolean isASeat(){
+ return isASeat;
+ }
+
+ public Point3d getSeatPosition(){
+ return seatPosition;
+ }
+
+ public Quat4d getSeatRotation(){
+ return seatRotation;
+ }
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/TemplateDocument.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/TemplateDocument.java 2007-10-17 20:45:00 UTC (rev 504)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/TemplateDocument.java 2007-10-17 23:49:54 UTC (rev 505)
@@ -16,6 +16,9 @@
import java.util.Iterator;
import java.util.Set;
+import javax.vecmath.Point3d;
+import javax.vecmath.Quat4d;
+
import nanoxml.XMLElement;
import com.ogoglio.util.ArgumentUtils;
@@ -28,66 +31,84 @@
public static final String OWNER_USERNAME = "ownerusername";
public static final String DISPLAY_NAME = "displayname";
-
+
public static final String DESCRIPTION = "description";
- public static final String SCRIPT_TAG="scriptfile";
+ public static final String SCRIPT_TAG = "scriptfile";
- public static final String LAST_MODIFIED="lastmodifiedUTC";
+ public static final String LAST_MODIFIED = "lastmodifiedUTC";
- private static final String GEOMETRY_TAG = "geometry";
+ private static final String GEOMETRY_TAG = "geometry";
- private static final String LEVEL_OF_DETAIL = "levelofdetail";
+ private static final String LEVEL_OF_DETAIL = "levelofdetail";
- private static final String SUPPORT_TAG= "supportfile";
+ private static final String SUPPORT_TAG = "supportfile";
- private static final String SUPPORT_FILE_NAME= "filename";
+ private static final String SUPPORT_FILE_NAME = "filename";
+ private static final String IS_SEAT = "seat";
-
+ private static final String SEAT_X = "seatx";
+
+ private static final String SEAT_Y = "seaty";
+
+ private static final String SEAT_Z = "seatz";
+
+ private static final String SEAT_RW = "seatrw";
+
+ private static final String SEAT_RX = "seatrx";
+
+ private static final String SEAT_RY = "seatry";
+
+ private static final String SEAT_RZ = "seatrz";
+
XMLElement data = null;
//for convenience of people who are creating this dynamically via the mock system
public TemplateDocument(Long templateID, String displayName, String ownerUsername, String description) {
- this(templateID.longValue(),displayName,ownerUsername,description, null);
+ this(templateID.longValue(), displayName, ownerUsername, description, null, false, 0, 0, 0, 1, 0, 0, 0);
}
- public TemplateDocument(long templateID, String displayName, String ownerUsername, String description, Set supportFiles) {
+
+ public TemplateDocument(long templateID, String displayName, String ownerUsername, String description, Set supportFiles, boolean isASeat, double seatX, double seatY, double seatZ, double seatRW, double seatRX, double seatRY, double seatRZ) {
data = new XMLElement(NAME);
data.setAttribute(TEMPLATE_ID, templateID);
ArgumentUtils.assertNotNull(displayName);
data.setAttribute(DISPLAY_NAME, displayName);
ArgumentUtils.assertNotNull(OWNER_USERNAME);
data.setAttribute(OWNER_USERNAME, ownerUsername);
- if(description != null && description.trim().length() > 0) {
+ if (description != null && description.trim().length() > 0) {
data.setAttribute(DESCRIPTION, description);
}
- if (supportFiles!=null) {
- //script tag
- Iterator iter=supportFiles.iterator();
- while (iter.hasNext()) {
- TemplateSupportFileDocument element = (TemplateSupportFileDocument) iter.next();
- if (element.getScript()) {
- XMLElement script=new XMLElement(SCRIPT_TAG);
- script.setAttribute(LAST_MODIFIED, element.getLastChangedAsUTC());
- data.addChild(script);
- continue;
- }
- if (element.getLevelOfDetail()!=TemplateSupportFileDocument.NO_LOD) {
- XMLElement script=new XMLElement(GEOMETRY_TAG);
- script.setAttribute(LAST_MODIFIED, element.getLastChangedAsUTC());
- script.setAttribute(LEVEL_OF_DETAIL, element.getLevelOfDetail());
- data.addChild(script);
- continue;
- }
- if (element.getSupportFile()!=null) {
- XMLElement support = new XMLElement(SUPPORT_TAG);
- support.setAttribute(SUPPORT_FILE_NAME, element.getSupportFile());
- support.setAttribute(LAST_MODIFIED, element.getLastChangedAsUTC());
- data.addChild(support);
- continue;
- }
- }
+ if (supportFiles != null) {
+ //script tag
+ Iterator iter = supportFiles.iterator();
+ while (iter.hasNext()) {
+ TemplateSupportFileDocument element = (TemplateSupportFileDocument) iter.next();
+ if (element.getScript()) {
+ XMLElement script = new XMLElement(SCRIPT_TAG);
+ script.setAttribute(LAST_MODIFIED, element.getLastChangedAsUTC());
+ data.addChild(script);
+ continue;
+ }
+ if (element.getLevelOfDetail() != TemplateSupportFileDocument.NO_LOD) {
+ XMLElement script = new XMLElement(GEOMETRY_TAG);
+ script.setAttribute(LAST_MODIFIED, element.getLastChangedAsUTC());
+ script.setAttribute(LEVEL_OF_DETAIL, element.getLevelOfDetail());
+ data.addChild(script);
+ continue;
+ }
+ if (element.getSupportFile() != null) {
+ XMLElement support = new XMLElement(SUPPORT_TAG);
+ support.setAttribute(SUPPORT_FILE_NAME, element.getSupportFile());
+ support.setAttribute(LAST_MODIFIED, element.getLastChangedAsUTC());
+ data.addChild(support);
+ continue;
+ }
+ }
}
+ setSeat(isASeat);
+ setSeatPosition(seatX, seatY, seatZ);
+ setSeatRotation(seatRW, seatRX, seatRY, seatRZ);
}
public TemplateDocument(XMLElement data) {
@@ -101,11 +122,11 @@
ArgumentUtils.assertNotEmpty(data.getStringAttribute(OWNER_USERNAME));
this.data = data;
}
-
+
public long getTemplateID() {
return data.getLongAttribute(TEMPLATE_ID);
}
-
+
public String getDisplayName() {
return data.getStringAttribute(DISPLAY_NAME);
}
@@ -122,72 +143,113 @@
public String getDescription() {
return data.getStringAttribute(DESCRIPTION);
}
-
+
public XMLElement toElement() {
return data;
}
-
+
public String toString() {
return data.toString();
}
- public boolean hasScriptFile() {
- return data.getChild(SCRIPT_TAG)!=null;
- }
- public String getScriptModifiedTime() {
- if (!hasScriptFile()) {
- return null;
- }
- return (String) data.getChild(SCRIPT_TAG).getAttribute(LAST_MODIFIED);
- }
- public XMLElement findSupportFileChild(String name) {
- XMLElement elem[] = data.getChildren(SUPPORT_TAG);
- for (int i=0; i<elem.length; ++i) {
- XMLElement candidate = elem[i];
- String filename=candidate.getStringAttribute(SUPPORT_FILE_NAME,null);
- if (filename.equals(name)) {
- return candidate;
- }
- }
- return null;
- }
+ public boolean hasScriptFile() {
+ return data.getChild(SCRIPT_TAG) != null;
+ }
- public XMLElement findGeometryChildWithLOD(int LOD) {
- XMLElement elem[] = data.getChildren(GEOMETRY_TAG);
- for (int i=0; i<elem.length; ++i) {
- XMLElement candidate = elem[i];
- if (candidate.getAttribute(LEVEL_OF_DETAIL).equals("0")) {
- return candidate;
- }
- }
- return null;
- }
-
- public boolean hasGeometryFileWithLOD(int LOD) {
- return findGeometryChildWithLOD(LOD)!=null;
- }
- public String getGeometryModifiedTime(int LOD) {
- XMLElement elem = findGeometryChildWithLOD(LOD);
- if (elem==null) {
- return null;
- }
- return (String)elem.getAttribute(LAST_MODIFIED);
- }
+ public String getScriptModifiedTime() {
+ if (!hasScriptFile()) {
+ return null;
+ }
+ return (String) data.getChild(SCRIPT_TAG).getAttribute(LAST_MODIFIED);
+ }
- public String getSupportFileModifiedTime(String name) {
- XMLElement elem = findSupportFileChild(name);
- if (elem==null) {
- return null;
- }
- return (String)elem.getAttribute(LAST_MODIFIED);
- }
+ public XMLElement findSupportFileChild(String name) {
+ XMLElement elem[] = data.getChildren(SUPPORT_TAG);
+ for (int i = 0; i < elem.length; ++i) {
+ XMLElement candidate = elem[i];
+ String filename = candidate.getStringAttribute(SUPPORT_FILE_NAME, null);
+ if (filename.equals(name)) {
+ return candidate;
+ }
+ }
+ return null;
+ }
+
+ public XMLElement findGeometryChildWithLOD(int LOD) {
+ XMLElement elem[] = data.getChildren(GEOMETRY_TAG);
+ for (int i = 0; i < elem.length; ++i) {
+ XMLElement candidate = elem[i];
+ if (candidate.getAttribute(LEVEL_OF_DETAIL).equals("0")) {
+ return candidate;
+ }
+ }
+ return null;
+ }
+
+ public boolean hasGeometryFileWithLOD(int LOD) {
+ return findGeometryChildWithLOD(LOD) != null;
+ }
+
+ public String getGeometryModifiedTime(int LOD) {
+ XMLElement elem = findGeometryChildWithLOD(LOD);
+ if (elem == null) {
+ return null;
+ }
+ return (String) elem.getAttribute(LAST_MODIFIED);
+ }
+
+ public String getSupportFileModifiedTime(String name) {
+ XMLElement elem = findSupportFileChild(name);
+ if (elem == null) {
+ return null;
+ }
+ return (String) elem.getAttribute(LAST_MODIFIED);
+ }
+
public String[] getAllSupportFileNames() {
XMLElement elem[] = data.getChildren(SUPPORT_TAG);
- String[] result=new String[elem.length];
- for (int i=0; i<elem.length; ++i) {
+ String[] result = new String[elem.length];
+ for (int i = 0; i < elem.length; ++i) {
XMLElement candidate = elem[i];
- result[i]=elem[i].getStringAttribute(SUPPORT_FILE_NAME,null);
+ result[i] = elem[i].getStringAttribute(SUPPORT_FILE_NAME, null);
}
return result;
}
+
+ public boolean isSeat() {
+ return data.getBooleanAttribute(IS_SEAT);
+ }
+
+ public Point3d getSeatPosition() {
+ return new Point3d(data.getDoubleAttribute(SEAT_X, 0), data.getDoubleAttribute(SEAT_Y, 0), data.getDoubleAttribute(SEAT_Z, 0));
+ }
+
+ public void setSeatRotation(Quat4d quat){
+ setSeatRotation(quat.w, quat.x, quat.y, quat.z);
+ }
+
+ public void setSeatRotation(double seatRW, double seatRX, double seatRY, double seatRZ) {
+ data.setAttribute(SEAT_RW, seatRW);
+ data.setAttribute(SEAT_RX, seatRX);
+ data.setAttribute(SEAT_RY, seatRY);
+ data.setAttribute(SEAT_RZ, seatRZ);
+ }
+
+ public Quat4d getSeatRotation() {
+ return new Quat4d(data.getDoubleAttribute(SEAT_RX, 0), data.getDoubleAttribute(SEAT_RY, 0), data.getDoubleAttribute(SEAT_RZ, 0), data.getDoubleAttribute(SEAT_RW, 1));
+ }
+
+ public void setSeat(boolean isASeat) {
+ data.setAttribute(IS_SEAT, isASeat);
+ }
+
+ public void setSeatPosition(Point3d seatPosition) {
+ setSeatPosition(seatPosition.x, seatPosition.y, seatPosition.z);
+ }
+
+ public void setSeatPosition(double seatX, double seatY, double seatZ) {
+ data.setAttribute(SEAT_X, seatX);
+ data.setAttribute(SEAT_Y, seatY);
+ data.setAttribute(SEAT_Z, seatZ);
+ }
}
Modified: maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/XMLTest.java
===================================================================
--- maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/XMLTest.java 2007-10-17 20:45:00 UTC (rev 504)
+++ maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/XMLTest.java 2007-10-17 23:49:54 UTC (rev 505)
@@ -154,7 +154,7 @@
String username = "kurt";
String description = "This thing rocks out with it's cupcake out.";
- TemplateDocument templateDoc = new TemplateDocument(1, displayName, username, description, null);
+ TemplateDocument templateDoc = new TemplateDocument(1, displayName, username, description, null, false, 0, 0, 0, 1, 0, 0, 0);
assertEquals(1, templateDoc.getTemplateID());
assertEquals(displayName, templateDoc.getDisplayName());
assertEquals(username, templateDoc.getOwnerUsername());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-10-16 14:23:29
|
Revision: 503
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=503&view=rev
Author: iansmith
Date: 2007-10-16 07:23:32 -0700 (Tue, 16 Oct 2007)
Log Message:
-----------
More comet prep and some reorg.
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Command.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Message.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/NoSuchDestinationException.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/TCPChannel.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/TCPMessageReader.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/AsyncProto.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/AsyncProtoFactory.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/CometClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/SimpleSocketAsync.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/Sim.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SimMessageHandler.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/MessageProxy.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java
maven/trunk/ogoglio-server/src/main/webapp/WEB-INF/web.xml
Added Paths:
-----------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/MeasPerfClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/AsyncProtoInfo.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/Locator.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/SimpleSocketInfo.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/AsyncClientReady.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/AsyncProtoServerFactory.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/AsyncProtoShutdownHandle.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/CometServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/MeasPerfServer.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/NetworkChannelServer.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/SimpleSocketAsyncServer.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/SimpleSocketWaiterThread.java
Removed Paths:
-------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Locator.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/NetworkChannelServer.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/AsyncProtoServer.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/SimpleSocketAsyncServer.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/CometServlet.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2007-10-15 19:10:23 UTC (rev 502)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -39,6 +39,7 @@
import com.ogoglio.message.NoSuchDestinationException;
import com.ogoglio.message.PayloadFactory;
import com.ogoglio.message.TCPChannel;
+import com.ogoglio.message.proto.AsyncProtoFactory;
import com.ogoglio.util.ArgumentUtils;
import com.ogoglio.util.Log;
import com.ogoglio.util.WebConstants;
@@ -56,8 +57,6 @@
public class SpaceClient implements UserInputListener, Space.Context {
- public static int DEFAULT_EVENT_PORT = 43455;
-
private Listener listener = null;
private WebAPIClient webClient = null;
@@ -104,7 +103,9 @@
space = new Space(this, spaceDoc.getSpaceID(), spaceDoc.getDisplayName(), spaceDoc.getOwnerUsername(), spaceDoc.getDisplaySea(), spaceDoc.getSeaLevel());
//create the event channel and start queuing events
- messageChannel = new TCPChannel(serviceURI.getHost(), DEFAULT_EVENT_PORT, messenger, true, new ChannelListener());
+ Object selector = AsyncProtoFactory.getDefaultInfo().getProxySpecificSelector();
+ messageChannel = new TCPChannel(AsyncProtoFactory.getDefaultClient(serviceURI.getHost(), selector),
+ messenger, true, new ChannelListener());
messenger.authenticate(authCookie);
long startWait = System.currentTimeMillis();
@@ -406,7 +407,6 @@
if (!page.getContentType().equals(event.getStringProperty(SpaceEvent.CONTENT_TYPE))) {
page.setContentType(event.getStringProperty(SpaceEvent.CONTENT_TYPE));
}
- System.out.println("Page content type: " + page.getContentType());
page.reloadContent();
} else if (SpaceEvent.ADD_DOOR_EVENT.equals(event.getName())) {
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Command.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Command.java 2007-10-15 19:10:23 UTC (rev 502)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Command.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -59,10 +59,10 @@
throw new IllegalStateException("Cannot have a message length < 0: " + commandString);
}
} catch (NumberFormatException e) {
- throw new IllegalArgumentException("Bad command string (bad length): " + commandString);
+ throw new IllegalArgumentException("Bad command string (bad length): >" + commandString+"<");
}
} else {
- throw new IllegalArgumentException("Bad command string: " + commandString);
+ throw new IllegalArgumentException("Bad command string: >" + commandString+"<");
}
}
Deleted: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Locator.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Locator.java 2007-10-15 19:10:23 UTC (rev 502)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Locator.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -1,98 +0,0 @@
-/* Copyright 2007 Transmutable (http://transmutable.com/)
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License. */
-
-package com.ogoglio.message;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-public class Locator {
-
- public static final String SCHEME = "og";
-
- private URI uri = null;
-
- public Locator(String locatorString) {
- try {
- uri = new URI(locatorString);
- } catch (URISyntaxException e) {
- throw new IllegalArgumentException("Bad locatorString: " + locatorString);
- }
- if (uri.getPort() <= 0) {
- throw new IllegalArgumentException("bad port: " + uri.getPort());
- }
- if (!SCHEME.equals(uri.getScheme())) {
- throw new IllegalArgumentException("bad scheme: " + uri.getScheme());
- }
- }
-
- public Locator(String host, int port) {
- if (port <= 0) {
- throw new IllegalArgumentException("bad port: " + port);
- }
- try {
- uri = new URI(SCHEME + "://" + host + ":" + port + "/");
- } catch (URISyntaxException e) {
- throw new IllegalArgumentException("bad args: " + host + ", " + port);
- }
- }
-
- public String getHost() {
- return uri.getHost();
- }
-
- public void setPort(int port) {
- String newURI = uri.getScheme() + "://" + uri.getHost() + ":" + port + "/";
- try {
- uri = new URI(newURI);
- } catch (URISyntaxException e) {
- throw new IllegalStateException("Bad uri: " + newURI);
- }
- }
-
- public void setHost(String host) {
- if (host == null || host.trim().length() == 0) {
- throw new IllegalArgumentException("Bad host name: " + host);
- }
- String newURI = uri.getScheme() + "://" + host + ":" + uri.getPort() + "/";
- try {
- uri = new URI(newURI);
- } catch (URISyntaxException e) {
- throw new IllegalStateException("Bad uri: " + newURI);
- }
- }
-
- public int getPort() {
- return uri.getPort();
- }
-
- public String toString() {
- return uri.toString();
- }
-
- public boolean equals(Object object) {
- if (object == null || !(object instanceof Locator)) {
- return false;
- }
- return toString().equals(((Locator) object).toString());
- }
-
- public int hashCode() {
- return toString().hashCode();
- }
-
- public boolean matchesHostAndPort(Locator locator) {
- return getHost().equals(locator.getHost()) && getPort() == locator.getPort();
- }
-}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/MeasPerfClient.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/MeasPerfClient.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/MeasPerfClient.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -0,0 +1,144 @@
+package com.ogoglio.message;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+
+import com.ogoglio.message.proto.AsyncProto;
+import com.ogoglio.message.proto.AsyncProtoFactory;
+
+
+public class MeasPerfClient extends Thread implements MessageHandler, TCPChannel.Listener {
+
+ private static final double THRESHOLD_DANGER= 2.0; //make a note if it takes longer than this
+ private static final int MAX_SLEEP_TIME_MS= 5000; //avg 2.5secs
+ private static final int RAMP_UP_TIME= 250; //time btwn two thread creations
+ private static final int THRESHOLD_TERMINATE = 10; //we start culling senders if we see this many over THRESHOLD_DANGER
+
+ private TCPChannel channel;
+ private static Map timeMap=Collections.synchronizedMap(new HashMap());
+ private static Map senderMap=new HashMap();
+ private static List deathList=Collections.synchronizedList(new ArrayList());
+
+ private static double totalTime = 0.0;
+ private static double totalSamples=0.0;
+ private static Object totalTimeLock=new Object();
+
+ private static int warningCounter =0;
+ private static Object warningCounterLock = new Object();
+
+ private Random r=new Random();
+
+ public static void main(String[] argv) {
+ int n = Integer.parseInt(argv[0]);
+
+ try {
+ for (int i = 0; i < n; ++i) {
+ AsyncProto proto=AsyncProtoFactory.getDefaultClient(argv[1], AsyncProtoFactory.getDefaultInfo().getSimSpecificSelector());
+ Thread t =new MeasPerfClient(proto);
+ t.start();
+ try {
+ Thread.sleep(RAMP_UP_TIME);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public MeasPerfClient(AsyncProto proto) {
+ channel = new TCPChannel(proto,this,false,this);
+ }
+
+ public void run() {
+ while (true) {
+ Payload p ;
+ Message m;
+
+ try {
+ Long me=new Long(Thread.currentThread().getId());
+ while (true) {
+ p=new PayloadFactory.HeartbeatPayload();
+ long id=r.nextLong();
+ m=new Message(channel.getLocalLocator(),channel.getRemoteLocator(),id,p);
+ timeMap.put(new Long(id),new Long(System.currentTimeMillis()));
+ senderMap.put(new Long(id),me);
+ channel.sendMessage(m);
+ int ms=r.nextInt(MAX_SLEEP_TIME_MS);
+ Thread.yield();
+ Thread.sleep(ms);
+ synchronized (deathList) {
+ if (deathList.contains(me)) {
+ channel.cleanup();
+ return;
+ }
+ }
+ //did somebody close this?
+ if (channel==null) {
+ return;
+ }
+ }
+ } catch (NoSuchDestinationException e) {
+ e.printStackTrace();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public void handleMessage(Message message, TCPChannel sourceChannel) throws NoSuchDestinationException {
+ Long id=new Long(message.getSpaceID());
+ long now=System.currentTimeMillis();
+ if (!timeMap.containsKey(id)) {
+ System.out.println("Can't find id in time map! Ignoring id:"+id);
+ return;
+ }
+ Long before=(Long)timeMap.get(id);
+ long diff = now-before.longValue();
+ double secs = ((double)diff)/1000.0;
+ synchronized (totalTimeLock) {
+ totalTime+=secs;
+ totalSamples+=1.0;
+ }
+ if (r.nextInt(100)==0) {
+ double avg;
+ synchronized (totalTimeLock) {
+ avg=totalTime/totalSamples;
+ }
+ System.out.println(""+ channel.getLocalLocator() +" Sample Turnaround time on heartbeat:"+secs+" and avg:"+avg);
+ }
+ if (secs>THRESHOLD_DANGER) {
+ boolean cull=false;
+
+ synchronized (warningCounterLock) {
+ warningCounter++;
+ if (warningCounter>THRESHOLD_TERMINATE) {
+ cull=true;
+ warningCounter=0;
+ }
+ }
+ //not enough to convince us to blow up somebody?
+ if (!cull) {
+ return;
+ }
+ //ok, the sender of the message should die if it took too long...
+ Long die = (Long)senderMap.get(id);
+ synchronized (deathList) {
+ if (!deathList.contains(die)) {
+ System.out.println("Killing sender "+die+" because of too much time elapsed:"+secs);
+ deathList.add(die);
+ }
+ }
+ }
+ }
+
+ public void channelClosed(TCPChannel channel) {
+ System.out.println("Got a message about closing channel:"+channel.hashCode()+ " vs. "+this.channel.hashCode());
+ }
+}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Message.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Message.java 2007-10-15 19:10:23 UTC (rev 502)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Message.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -16,6 +16,7 @@
import nanoxml.XMLElement;
+import com.ogoglio.message.proto.Locator;
import com.ogoglio.util.ArgumentUtils;
public class Message {
Deleted: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/NetworkChannelServer.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/NetworkChannelServer.java 2007-10-15 19:10:23 UTC (rev 502)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/NetworkChannelServer.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -1,182 +0,0 @@
-/* Copyright 2007 Transmutable (http://transmutable.com/)
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License. */
-
-package com.ogoglio.message;
-
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.util.Vector;
-
-import com.ogoglio.message.proto.AsyncProto;
-import com.ogoglio.message.proto.AsyncProtoFactory;
-import com.ogoglio.message.proto.AsyncProtoServer;
-import com.ogoglio.util.BlockingQueue;
-import com.ogoglio.util.Log;
-import com.ogoglio.util.NetworkUtils;
-
-public class NetworkChannelServer implements TCPChannel.Listener {
-
- private Vector channels = new Vector();
-
- private AsyncProtoServer serverProto = null;
-
- private ChannelSocketListenerThread listenerThread = new ChannelSocketListenerThread();
-
- private boolean cleaned = false;
-
- private MessageHandler messageHandler = null;
-
- private boolean ensureOrigin = false;
-
- private Listener listener;
-
- public NetworkChannelServer(MessageHandler messageHandler, int port, boolean ensureOrigin, Listener listener) {
- try {
- serverProto= AsyncProtoFactory.getDefaultServer(port);
- } catch (IOException e) {
- throw new IllegalStateException("Could not open a server socket: " + e);
- }
- this.messageHandler = messageHandler;
- this.ensureOrigin = ensureOrigin;
- if (listener == null) {
- throw new IllegalArgumentException("bad listener " + listener);
- }
- this.listener=listener;
- listenerThread.start();
- }
-
- public interface Listener {
- public void channelAdded(TCPChannel channel);
- public void channelRemoved(TCPChannel channel);
- }
-
- public void distribute(Payload payload, long spaceID) {
- TCPChannel[] channels = getChannels();
- for (int i = 0; i < channels.length; i++) {
- Message message = new Message(getLocator(), channels[i].getRemoteLocator(), spaceID, payload);
- try {
- channels[i].sendMessage(message);
- } catch (NoSuchDestinationException e) {
- e.printStackTrace();
- } catch (BlockingQueue.QueueClosedException e) {
- e.printStackTrace();
- }
- }
- }
-
- public void distributeExclusively(Payload payload, Locator excludedLocator) {
- TCPChannel[] channels = getChannels();
- for (int i = 0; i < channels.length; i++) {
- if (!channels[i].getRemoteLocator().matchesHostAndPort(excludedLocator)) {
- Message message = new Message(getLocator(), channels[i].getRemoteLocator(), -1, payload);
- try {
- channels[i].sendMessage(message);
- } catch (NoSuchDestinationException e) {
- e.printStackTrace();
- }
- }
- }
- }
-
- public synchronized void sendMessage(Message message) throws NoSuchDestinationException {
- Locator remoteLocator = message.getProxy() != null ? message.getProxy() : message.getDestination();
- TCPChannel[] channels = getChannels();
- for (int i = 0; i < channels.length; i++) {
- if (channels[i].getRemoteLocator().matchesHostAndPort(remoteLocator)) {
- channels[i].sendMessage(message);
- return;
- }
- }
-
- Log.info("Attempted location??: " + remoteLocator);
- //for (int i = 0; i < channels.length; i++) {
- // System.out.println("Available channels: " + channels[i].getRemoteLocator());
- //}
-
- throw new NoSuchDestinationException("Not local or for a connected channel: " + message);
- }
-
- public Locator getLocator() {
- return new Locator(NetworkUtils.getLocalHostAddress(), serverProto.getLocalPort());
- }
-
- public void cleanup() {
- cleaned = true;
- try {
- serverProto.shutdown();
- } catch (Exception e) {
- Log.info("Trying to close server socket of NCServer",e);
- // don't care
- }
- TCPChannel[] channels = getChannels();
- for (int i = 0; i < channels.length; i++) {
- channels[i].cleanup();
- }
- }
-
- private class ChannelSocketListenerThread extends Thread {
-
- public ChannelSocketListenerThread() {
- super("NetworkChannelServer");
- setDaemon(true);
- }
-
- public void run() {
- while (!cleaned) {
- try {
- AsyncProto clientProto = serverProto.waitForClient();
- if (clientProto == null) {
- break;
- }
- TCPChannel channel = new TCPChannel(clientProto, messageHandler, ensureOrigin, NetworkChannelServer.this);
- addChannel(channel);
- listener.channelAdded(channel);
- } catch (IOException e) {
- if (!cleaned) {
- e.printStackTrace();
- }
- break;
- }
- }
- if (!cleaned) {
- Log.error("Unclean client socket listener thread exiting.");
- }
- }
- }
-
- public synchronized void closeChannel(Locator remoteLocator) {
- TCPChannel[] channels = getChannels();
- for (int i = 0; i < channels.length; i++) {
- if (remoteLocator.equals(channels[i].getRemoteLocator())) {
- channels[i].cleanup();
- return;
- }
- }
- }
-
- private synchronized void addChannel(TCPChannel channel) {
- channels.add(channel);
- }
-
- public synchronized TCPChannel[] getChannels() {
- return (TCPChannel[]) channels.toArray(new TCPChannel[0]);
- }
-
- public synchronized void channelClosed(TCPChannel channel) {
- channels.remove(channel);
- listener.channelRemoved(channel);
- }
-
-}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/NoSuchDestinationException.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/NoSuchDestinationException.java 2007-10-15 19:10:23 UTC (rev 502)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/NoSuchDestinationException.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -14,6 +14,8 @@
package com.ogoglio.message;
+import com.ogoglio.message.proto.Locator;
+
public class NoSuchDestinationException extends Exception {
public NoSuchDestinationException(Locator destination) {
super("No such destination: " + destination.toString());
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/TCPChannel.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/TCPChannel.java 2007-10-15 19:10:23 UTC (rev 502)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/TCPChannel.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -18,6 +18,7 @@
import com.ogoglio.message.proto.AsyncProto;
import com.ogoglio.message.proto.AsyncProtoFactory;
+import com.ogoglio.message.proto.Locator;
import com.ogoglio.util.Log;
import com.ogoglio.util.NetworkUtils;
import com.ogoglio.util.BlockingQueue.QueueClosedException;
@@ -27,9 +28,9 @@
private AsyncProto clientProto = null;
- private String remoteHostName = null;
+// private String remoteHostName = null;
- private int remoteHostPort = -1;
+ // private int remoteHostPort = -1;
private TCPMessageReader readerThread = null;
@@ -43,14 +44,14 @@
private boolean ensureOrigin = false;
- public TCPChannel(String remoteHost, int remotePort, MessageHandler messageHandler, boolean ensureOrigin, Listener listener) throws IOException {
- this(AsyncProtoFactory.getDefaultClient(remoteHost, remotePort), messageHandler, ensureOrigin, listener);
+ public TCPChannel(String remoteHost, Object selector, MessageHandler messageHandler, boolean ensureOrigin, Listener listener) throws IOException {
+ this(AsyncProtoFactory.getDefaultClient(remoteHost, selector), messageHandler, ensureOrigin, listener);
}
public TCPChannel(AsyncProto proto, MessageHandler message_handler, boolean ensureOrigin, Listener listener) {
this.clientProto= proto;
- remoteHostName = clientProto.getRemoteAddress().getAddress().getHostAddress();
- remoteHostPort = clientProto.getRemoteAddress().getPort();
+ //remoteHostName = clientProto.getRemoteAddress().getAddress().getHostAddress();
+ //remoteHostPort = clientProto.getRemoteAddress().getPort();
if (message_handler == null) {
throw new IllegalArgumentException("bad message handler " + message_handler);
}
@@ -70,16 +71,20 @@
}
+
+ public void clientReady(AsyncProto newlyConnectedProto) {
+ Log.info("Client connected from: "+newlyConnectedProto.getRemoteLocator());
+ }
public interface Listener {
public void channelClosed(TCPChannel channel);
}
public Locator getLocalLocator() {
- return new Locator(NetworkUtils.getLocalHostAddress(), clientProto.getLocalPort());
+ return clientProto.getLocalLocator();
}
public Locator getRemoteLocator() {
- return new Locator(remoteHostName, remoteHostPort);
+ return clientProto.getRemoteLocator();
}
public void cleanup() {
@@ -103,26 +108,26 @@
public void sendMessage(Message message) throws NoSuchDestinationException {
if(message.getProxy() != null) {
- if(message.getProxy().getPort() != remoteHostPort || !message.getProxy().getHost().equals(remoteHostName)){
+ if (!message.getProxy().equals(clientProto.getRemoteLocator())) {
throw new NoSuchDestinationException("Passed a message to a TCPChannel with the wrong proxy: " + message.getProxy());
}
- } else if (message.getDestination().getPort() != remoteHostPort || !message.getDestination().getHost().equals(remoteHostName)){
+ } else if (!message.getDestination().equals(clientProto.getRemoteLocator())){
throw new NoSuchDestinationException("Passed a message to a TCPChannel with the wrong destination: " + message.getDestination());
}
try {
senderQueue.sendMessage(message);
} catch (QueueOverflowException e) {
- Log.error("Queue overflow: " + remoteHostName + ":" + remoteHostPort,e);
+ Log.error("Queue overflow: " + clientProto.getRemoteLocator(),e);
cleanup();
} catch (QueueClosedException e) {
- Log.error("Queue closed: " + remoteHostName + ":" + remoteHostPort,e);
+ Log.error("Queue closed: " + clientProto.getRemoteLocator(),e);
cleanup();
}
}
public String toString() {
- return "TCPChannel from " + NetworkUtils.getLocalHostAddress() + ":" + clientProto.getLocalPort() + " to " + remoteHostName + ":" + remoteHostPort;
+ return "TCPChannel from " + clientProto.getLocalLocator() + " to " +clientProto.getRemoteLocator();
}
public void socketClosed() {
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/TCPMessageReader.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/TCPMessageReader.java 2007-10-15 19:10:23 UTC (rev 502)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/TCPMessageReader.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -27,9 +27,9 @@
private TCPChannel channel = null;
- private String remoteHostName = null;
+ //private String remoteHostName = null;
- private int remotePort = -1;
+ //private int remotePort = -1;
private AsyncProto clientProto=null;
@@ -39,8 +39,8 @@
if (clientProto == null) {
throw new IllegalArgumentException("bad protocol to TCPMessageReader" + clientProto);
}
- remoteHostName = clientProto.getRemoteAddress().getAddress().getHostAddress();
- remotePort = clientProto.getRemoteAddress().getPort();
+ //remoteHostName = clientProto.getRemoteAddress().getAddress().getHostAddress();
+ //remotePort = clientProto.getRemoteAddress().getPort();
if (messageHandler == null) {
throw new IllegalArgumentException("bad message handler: " + messageHandler);
}
@@ -82,14 +82,12 @@
return;
}
command.reset(commandLine);
- if (!command.getType().equals(Command.MESSAGE)) {
- throw new IllegalStateException("Whoa! Bad message type!"+command.getType());
- }
String msg = clientProto.readString(command.getMessageLength());
Message message = Message.parseMessage(msg);
if (channel.ensureOrigin()) {
- message.getOrigin().setHost(remoteHostName);
- message.getOrigin().setPort(remotePort);
+ message.setOrigin(clientProto.getRemoteLocator());
+ //message.getOrigin().setHost(remoteHostName);
+ //message.getOrigin().setPort(remotePort);
}
try {
messageHandler.handleMessage(message, channel);
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/AsyncProto.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/AsyncProto.java 2007-10-15 19:10:23 UTC (rev 502)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/AsyncProto.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -17,11 +17,11 @@
/**
* The caller needs to be able to get at the endpoint to which this proto is speaking.
*/
- public InetSocketAddress getRemoteAddress();
+ public Locator getRemoteLocator();
/**
- * The caller needs to get the port we are talking on.
+ * The caller needs to be able to get our own name.
*/
- public int getLocalPort();
+ public Locator getLocalLocator();
/**
* Deal with various shutdown issues.
*/
@@ -41,12 +41,14 @@
*/
public String readString(int length) throws IOException;
/**
- * Insure that we are ready for writing to the output.
+ * Insure that we are ready for writing to the output.It is required this be called before
+ * attempting to send.
* @throws IOException
*/
public void prepareOutput() throws IOException;
/**
- * Insure that we are ready for reading from the input.
+ * Insure that we are ready for reading from the input. It is required that this be called before
+ * attempting to read.
* @throws IOException
*/
public void prepareInput() throws IOException;
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/AsyncProtoFactory.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/AsyncProtoFactory.java 2007-10-15 19:10:23 UTC (rev 502)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/AsyncProtoFactory.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -1,35 +1,32 @@
package com.ogoglio.message.proto;
import java.io.IOException;
-import java.net.ServerSocket;
/**
* This is a factory for other classes to get a handle on our async protocol handler and so
- * we can "throw the switch" in exactly one place if we want to switch protocols.
+ * we can "throw the switch" in exactly one place if we want to switch protocols.
*
+ * Clients call the getDefaultClient() routine and servers call the waitForClient() routine.
+ *
* @author iansmith
*
*/
public class AsyncProtoFactory {
/**
- * Get a handler for this protocol. This is the client side call.
+ * Get a handler for this protocol. This is the client side call. This fails if the connection
+ * cannot be made. It returns a connected proto object.
*
* @param host
- * @param port
+ * @param selector a proto-specific object
* @return
* @throws IOException
*/
- public static AsyncProto getDefaultClient(String host, int port) throws IOException {
- return new SimpleSocketAsync(host,port);
+ public static AsyncProto getDefaultClient(String host, Object selector) throws IOException {
+ return new SimpleSocketAsync(host, ((Integer)selector).intValue());
}
- /**
- * Become a serevr who waits for connections.
- *
- * If we are going to wait on a port, you pass it here. Note that you may not end up waiting
- * on that port if the underlying protocol doesn't need to.
- */
- public static AsyncProtoServer getDefaultServer(int port) throws IOException {
- return new SimpleSocketAsyncServer(port);
+
+ public static AsyncProtoInfo getDefaultInfo() {
+ return new SimpleSocketInfo();
}
}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/AsyncProtoInfo.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/AsyncProtoInfo.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/AsyncProtoInfo.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -0,0 +1,19 @@
+package com.ogoglio.message.proto;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+/**
+ * The intention of this interface is to hide various specifics about how the underlying async
+ * protocol is implemented. The objects returned here should be considered opaque.
+ *
+ * @author iansmith
+ *
+ */
+public interface AsyncProtoInfo {
+ public String getScheme();
+ public Object getProxySpecificSelector();
+ public Object getSimSpecificSelector();
+
+ public URI getURI(String host, Object selector) throws URISyntaxException;
+}
Deleted: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/AsyncProtoServer.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/AsyncProtoServer.java 2007-10-15 19:10:23 UTC (rev 502)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/AsyncProtoServer.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -1,20 +0,0 @@
-package com.ogoglio.message.proto;
-
-import java.io.IOException;
-
-public interface AsyncProtoServer {
- /**
- * Wait for a client to show up and connect to us. If he does, return the object of the right type.
- */
- public AsyncProto waitForClient() throws IOException ;
-
- /**
- * Clean up
- */
- public void shutdown() throws IOException;
-
- /**
- * Get the local port, if there is one
- */
- public int getLocalPort();
-}
\ No newline at end of file
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/CometClient.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/CometClient.java 2007-10-15 19:10:23 UTC (rev 502)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/CometClient.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -9,11 +9,8 @@
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.Socket;
-import java.net.URL;
-import java.net.URLConnection;
import com.ogoglio.message.MessageHandler;
-import com.ogoglio.message.TCPChannel;
import com.ogoglio.message.TCPChannel.Listener;
public class CometClient {
Copied: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/Locator.java (from rev 483, maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Locator.java)
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/Locator.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/Locator.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -0,0 +1,90 @@
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+
+package com.ogoglio.message.proto;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+
+public class Locator {
+
+ public static final AsyncProtoInfo info = AsyncProtoFactory.getDefaultInfo();
+
+ private URI uri = null;
+
+ public Locator(String locatorString) {
+ try {
+ uri = new URI(locatorString);
+ } catch (URISyntaxException e) {
+ throw new IllegalArgumentException("Bad locatorString: " + locatorString);
+ }
+ if (uri.getPort() <= 0) {
+ throw new IllegalArgumentException("bad port: " + uri.getPort());
+ }
+ if (!info.getScheme().equals(uri.getScheme())) {
+ throw new IllegalArgumentException("bad scheme: " + uri.getScheme());
+ }
+ }
+
+ public String getHost() {
+ return uri.getHost();
+ }
+
+ /*
+ public void setPort(int port) {
+ String newURI = uri.getScheme() + "://" + uri.getHost() + ":" + port + "/";
+ try {
+ uri = new URI(newURI);
+ } catch (URISyntaxException e) {
+ throw new IllegalStateException("Bad uri: " + newURI);
+ }
+ }
+
+ public void setHost(String host) {
+ if (host == null || host.trim().length() == 0) {
+ throw new IllegalArgumentException("Bad host name: " + host);
+ }
+ String newURI = uri.getScheme() + "://" + host + ":" + uri.getPort() + "/";
+ try {
+ uri = new URI(newURI);
+ } catch (URISyntaxException e) {
+ throw new IllegalStateException("Bad uri: " + newURI);
+ }
+
+ }
+ */
+ public int getPort() {
+ return uri.getPort();
+ }
+
+ public String toString() {
+ return uri.toString();
+ }
+
+ public boolean equals(Object object) {
+ if (object == null || !(object instanceof Locator)) {
+ return false;
+ }
+ return toString().equals(((Locator) object).toString());
+ }
+
+ public int hashCode() {
+ return toString().hashCode();
+ }
+
+ public boolean matchesHostAndPort(Locator locator) {
+ return getHost().equals(locator.getHost()) && getPort() == locator.getPort();
+ }
+}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/SimpleSocketAsync.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/SimpleSocketAsync.java 2007-10-15 19:10:23 UTC (rev 502)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/SimpleSocketAsync.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -7,6 +7,7 @@
import java.net.Socket;
import com.ogoglio.util.Log;
+import com.ogoglio.util.NetworkUtils;
/**
* This is a simple impementation of a custom async proto that works on a standard TCP
@@ -39,14 +40,25 @@
this.socket=socket;
}
- public InetSocketAddress getRemoteAddress() {
- return (InetSocketAddress) socket.getRemoteSocketAddress();
+ public Locator getRemoteLocator() {
+ InetSocketAddress addr=(InetSocketAddress) socket.getRemoteSocketAddress();
+ return sockAddrToScheme(addr);
}
- public int getLocalPort() {
- return socket.getLocalPort();
+ public Locator getLocalLocator() {
+ InetSocketAddress addr=(InetSocketAddress) socket.getLocalSocketAddress();
+ return sockAddrToScheme(addr);
}
+ private Locator sockAddrToScheme(InetSocketAddress addr) {
+ String scheme = AsyncProtoFactory.getDefaultInfo().getScheme();
+ return new Locator(scheme +"://"+addr.getHostName()+":"+addr.getPort());
+ }
+
+ public Object getSelector() {
+ return new Integer(socket.getLocalPort());
+ }
+
public void shutdown() {
try {
if (socket != null) {
@@ -74,7 +86,7 @@
throw new IllegalStateException("Command exceeds max length: " + commandBuffer);
}
char inChar = (char) inInt;
- if (inChar == '\r') { // this shouldn't happen, but people are silly
+ if (inChar == '\r') {
continue;
}
if (inChar != '\n') {
Deleted: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/SimpleSocketAsyncServer.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/SimpleSocketAsyncServer.java 2007-10-15 19:10:23 UTC (rev 502)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/SimpleSocketAsyncServer.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -1,37 +0,0 @@
-package com.ogoglio.message.proto;
-
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.net.Socket;
-
-public class SimpleSocketAsyncServer implements AsyncProtoServer {
-
- private ServerSocket serverSocket;
-
- public SimpleSocketAsyncServer(int port) throws IOException {
- if (port == -1) {
- serverSocket = new ServerSocket(0);
- } else {
- serverSocket = new ServerSocket(port);
- }
- }
- /**
- * Wait for a client to show up and connect to us. If he does, return the object of the right type.
- */
- public AsyncProto waitForClient() throws IOException {
- Socket socket=serverSocket.accept();
- return new SimpleSocketAsync(socket);
- }
- /**
- * Clean up
- */
- public void shutdown() throws IOException {
- serverSocket.close();
- }
- /**
- * Get the local port, if there is one
- */
- public int getLocalPort() {
- return serverSocket.getLocalPort();
- }
-}
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/SimpleSocketInfo.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/SimpleSocketInfo.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/proto/SimpleSocketInfo.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -0,0 +1,30 @@
+package com.ogoglio.message.proto;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+
+public class SimpleSocketInfo implements AsyncProtoInfo {
+
+ private static final int DEFAULT_SIM_PORT=8932;
+ private static final int DEFAULT_PROXY_PORT=43092;
+
+ private static final String SCHEME = "og";
+
+ public Object getProxySpecificSelector() {
+ return new Integer(DEFAULT_PROXY_PORT);
+ }
+
+ public String getScheme() {
+ return SCHEME;
+ }
+
+ public Object getSimSpecificSelector() {
+ return new Integer(DEFAULT_SIM_PORT);
+ }
+
+ public URI getURI(String host, Object selector) throws URISyntaxException {
+ return new URI(getScheme() + "://" + host + ":" + selector+ "/");
+ }
+
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/AsyncClientReady.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/AsyncClientReady.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/AsyncClientReady.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -0,0 +1,18 @@
+package com.ogoglio.message.server;
+
+import com.ogoglio.message.proto.AsyncProto;
+
+/**
+ * Pass an instance of this to the waitForClient() of the factory and when a client connects,
+ * we will call back to you via this object.
+ *
+ * However, this *will* be called from a different thread than the caller so be sure to take
+ * care to synchronize as needed.
+ *
+ * @author iansmith
+ *
+ */
+public interface AsyncClientReady {
+
+ public void clientReady(AsyncProto newlyConnectedProto);
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/AsyncProtoServerFactory.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/AsyncProtoServerFactory.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/AsyncProtoServerFactory.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -0,0 +1,37 @@
+package com.ogoglio.message.server;
+
+import java.io.IOException;
+
+import com.ogoglio.message.proto.AsyncProtoInfo;
+import com.ogoglio.message.proto.SimpleSocketInfo;
+
+
+public class AsyncProtoServerFactory {
+ /**
+ * Become a server who waits for connections.
+ *
+ * If we are going to wait on a port, you pass it here. Note that you may not end up waiting
+ * on that port if the underlying protocol doesn't need to.
+ *
+ * This hands back a handle immediately, it does not block. The handle returned can be
+ * used when you want to not be a server anymore and want to clean up the resources.
+ */
+ public static AsyncProtoShutdownHandle waitForClient(Object serverSelector, AsyncClientReady ready) throws IOException {
+ return simpleSocketImpl(((Integer)serverSelector).intValue(),ready);
+ }
+
+ public static AsyncProtoInfo getInfo() {
+ return simpleSocketInfo();
+ }
+
+ private static AsyncProtoInfo simpleSocketInfo() {
+ return new SimpleSocketInfo();
+ }
+
+ private static AsyncProtoShutdownHandle simpleSocketImpl(int port, AsyncClientReady ready) throws IOException {
+ SimpleSocketWaiterThread waiter = new SimpleSocketWaiterThread(port,ready);
+ waiter.start();
+ return waiter.getShutdownHandle();
+ }
+
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/AsyncProtoShutdownHandle.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/AsyncProtoShutdownHandle.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/AsyncProtoShutdownHandle.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -0,0 +1,16 @@
+package com.ogoglio.message.server;
+
+import com.ogoglio.message.proto.Locator;
+
+public interface AsyncProtoShutdownHandle {
+
+ /*
+ * This allows you to see inside the object for info about what it's waiting on.
+ */
+ public Locator getLocalLocator();
+
+ /**
+ * This cleans up the resources behind the API if they are any that need it.
+ */
+ public void shutdown();
+}
Copied: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/CometServlet.java (from rev 490, maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/CometServlet.java)
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/CometServlet.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/CometServlet.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -0,0 +1,165 @@
+package com.ogoglio.message.server;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.catalina.CometEvent;
+import org.apache.catalina.CometProcessor;
+
+import com.ogoglio.util.Log;
+
+public class CometServlet extends HttpServlet implements CometProcessor {
+
+ protected ArrayList connections = new ArrayList();
+
+ protected MessageSender messageSender = null;
+
+ public void init() throws ServletException {
+ messageSender = new MessageSender();
+ Thread messageSenderThread = new Thread(messageSender, "MessageSender[" + getServletContext() + "]");
+ messageSenderThread.setDaemon(true);
+ messageSenderThread.start();
+ }
+
+ public void destroy() {
+ connections.clear();
+ messageSender.stop();
+ messageSender = null;
+ }
+
+ /**
+ * Process the given Comet event.
+ *
+ * @param event The Comet event that will be processed
+ * @throws IOException
+ * @throws ServletException
+ */
+ public void event(CometEvent event) throws IOException, ServletException {
+ HttpServletRequest request = event.getHttpServletRequest();
+ HttpServletResponse response = event.getHttpServletResponse();
+ if (event.getEventType() == CometEvent.EventType.BEGIN) {
+ //event.setTimeout(60000);
+ Log.info("Begin for session: " + request.getSession(true).getId());
+ PrintWriter writer = response.getWriter();
+ response.setContentType("text/plain");
+ writer.println("<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">");
+ writer.println("<head><title>JSP Chat</title></head><body bgcolor=\"#FFFFFF\">");
+ writer.flush();
+ synchronized (connections) {
+ connections.add(response);
+ }
+ //drainDataBuffer(event, request);
+ } else if (event.getEventType() == CometEvent.EventType.ERROR) {
+ Log.error("Error for session: " + request.getSession(true).getId()+"-->"+event.getEventSubType());
+ if (event.getEventSubType()==CometEvent.EventSubType.TIMEOUT) {
+ Log.info("Timeout ignored!");
+ return;
+ }
+ synchronized (connections) {
+ connections.remove(response);
+ }
+ event.close();
+ } else if (event.getEventType() == CometEvent.EventType.END) {
+ Log.info("End for session: " + request.getSession(true).getId());
+ synchronized (connections) {
+ connections.remove(response);
+ }
+ PrintWriter writer = response.getWriter();
+ writer.println("</body></html>");
+ event.close();
+ } else if (event.getEventType() == CometEvent.EventType.READ) {
+ drainDataBuffer(event, request);
+ }
+ }
+
+ private void drainDataBuffer(CometEvent event, HttpServletRequest request) throws IOException {
+ InputStream is = request.getInputStream();
+ byte[] buf = new byte[512];
+ do {
+ int n = is.read(buf); //can throw an IOException
+ if (n > 0) {
+ Log.info("Read " + n + " bytes: " + new String(buf, 0, n) + " for session: " + request.getSession(true).getId());
+ String msg=new String(buf);
+ String sender=msg.substring(0,msg.indexOf(':'));
+ String message=msg.substring(msg.indexOf(':')+1);
+ messageSender.send(sender, message);
+ } else if (n < 0) {
+ Log.error("Read error:"+event.getEventType()+"," +request.getRequestURI()+","+n);
+ return;
+ }
+ } while (is.available() > 0);
+ }
+
+ public class MessageSender implements Runnable {
+
+ protected boolean running = true;
+
+ protected ArrayList messages = new ArrayList();
+
+ public MessageSender() {
+ }
+
+ public void stop() {
+ running = false;
+ }
+
+ /**
+ * Add message for sending.
+ */
+ public void send(String user, String message) {
+ Log.info("FART:adding"+message +" from "+user);
+ synchronized (messages) {
+ messages.add("[" + user + "]: " + message);
+ messages.notify();
+ }
+ }
+
+ public void run() {
+
+ while (running) {
+
+ if (messages.size() == 0) {
+ try {
+ synchronized (messages) {
+ messages.wait();
+ }
+ } catch (InterruptedException e) {
+ // Ignore
+ }
+ }
+
+ synchronized (connections) {
+ String[] pendingMessages = null;
+ synchronized (messages) {
+ pendingMessages = (String[]) messages.toArray(new String[0]);
+ messages.clear();
+ }
+ // Send any pending message on all the open connections
+ Log.info("FART currently need to send on "+connections.size()+" connections with "+pendingMessages.length);
+ for (int i = 0; i < connections.size(); i++) {
+ try {
+ PrintWriter writer = ((HttpServletResponse) connections.get(i)).getWriter();
+ for (int j = 0; j < pendingMessages.length; j++) {
+ writer.println(pendingMessages[j] + "<br>");
+ }
+ writer.flush();
+ } catch (IOException e) {
+ Log.error("IOExeption sending message", e);
+ }
+ }
+ }
+
+ }
+
+ }
+
+ }
+
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/MeasPerfServer.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/MeasPerfServer.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/MeasPerfServer.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -0,0 +1,48 @@
+package com.ogoglio.message.server;
+
+import com.ogoglio.message.Message;
+import com.ogoglio.message.MessageHandler;
+import com.ogoglio.message.NoSuchDestinationException;
+import com.ogoglio.message.TCPChannel;
+import com.ogoglio.message.proto.AsyncProtoInfo;
+import com.ogoglio.message.server.NetworkChannelServer.Listener;
+
+
+public class MeasPerfServer implements MessageHandler, NetworkChannelServer.Listener {
+
+ /**
+ * Bootstrap to object's main
+ */
+ public static void main(String[] argv) {
+
+ new MeasPerfServer().main();
+
+ }
+
+ private NetworkChannelServer ncs;
+
+ public void main() {
+ try {
+ AsyncProtoInfo info = AsyncProtoServerFactory.getInfo();
+ ncs = new NetworkChannelServer(this,info.getSimSpecificSelector(),false,this);
+ while (true) {
+ System.out.println("Waiting for connections...");
+ Thread.sleep(30000);
+ }
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void handleMessage(Message message, TCPChannel sourceChannel) throws NoSuchDestinationException {
+ ncs.distribute(message.getPayload(), message.getSpaceID());
+ }
+
+ public void channelAdded(TCPChannel channel) {
+ System.out.println("Added a TCP Channel:"+channel.getRemoteLocator()+" ["+ncs.getChannels().length+"]");
+ }
+
+ public void channelRemoved(TCPChannel channel) {
+ System.out.println("Removed a TCP Channel:"+channel.getRemoteLocator()+" ["+ncs.getChannels().length+"]");
+ }
+}
Copied: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/NetworkChannelServer.java (from rev 490, maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/NetworkChannelServer.java)
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/NetworkChannelServer.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/message/server/NetworkChannelServer.java 2007-10-16 14:23:32 UTC (rev 503)
@@ -0,0 +1,155 @@
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+
+package com.ogoglio.message.server;
+
+import java.io.IOException;
+import java.util.Vector;
+
+import com.ogoglio.message.Message;
+import com.ogoglio.message.MessageHandler;
+import com.ogoglio.message.NoSuchDestinationException;
+import com.ogoglio.message.Payload;
+import com.ogoglio.message.TCPChannel;
+import com.ogoglio.message.proto.AsyncProto;
+import com.ogoglio.message.proto.Locator;
+import com.ogoglio.util.BlockingQueue;
+import com.ogoglio.util.Log;
+import com.ogoglio.util.NetworkUtils;
+
+public class NetworkChannelServer implements TCPChannel.Listener, AsyncClientReady {
+
+ private Vector channels = new Vector();
+
+ private AsyncProtoShutdownHandle handle= null;
+
+ private MessageHandler messageHandler = null;
+
+ private boolean ensureOrigin = false;
+
+ private Listener listener;
+
+ public NetworkChannelServer(MessageHandler messageHandler, Object serverSelector, boolean ensureOrigin, Listener listener) {
+ try {
+ handle=AsyncProtoServerFactory.waitForClient(serverSelector, this);
+ } catch (IOException e) {
+ throw new IllegalStateException("Could not open a server socket: " + e);
+ }
+ this.messageHandler = messageHandler;
+ this.ensureOrigin = ensureOrigin;
+ if (listener == null) {
+ throw new IllegalArgumentException("bad listener " + listener);
+ }
+ this.listener=listener;
+ }
+
+ public interface Listener {
+ public void channelAdded(TCPChannel channel);
+ public void channelRemoved(TCPChannel channel);
+ }
+
+ public void distribute(Payload payload, long spaceID) {
+ TCPChannel[] channels = getChannels();
+ for (int i = 0; i < channels.length; i++) {
+ Message message = new Message(getLocator(), channels[i].getRem...
[truncated message content] |
|
From: <tre...@us...> - 2007-10-15 19:10:27
|
Revision: 502
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=502&view=rev
Author: trevorolio
Date: 2007-10-15 12:10:23 -0700 (Mon, 15 Oct 2007)
Log Message:
-----------
Switched the body editor applet to just show the 3D, with editing functions exposed to the page via LiveConnect.
Made body.html use the new functions to display morph controls, animation triggers, and a save button.
Hopefully we will avoid future use of applets for any 2D controls.
Modified Paths:
--------------
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java
Modified: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java 2007-10-15 19:10:20 UTC (rev 501)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java 2007-10-15 19:10:23 UTC (rev 502)
@@ -34,7 +34,7 @@
public class BodyAppletTestWindow extends Frame {
- Dimension appDimension = new Dimension(800, 620);
+ Dimension appDimension = new Dimension(300, 420);
public BodyEditorApplet applet = null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-15 19:10:21
|
Revision: 500
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=500&view=rev
Author: trevorolio
Date: 2007-10-15 12:10:14 -0700 (Mon, 15 Oct 2007)
Log Message:
-----------
Switched the body editor applet to just show the 3D, with editing functions exposed to the page via LiveConnect.
Made body.html use the new functions to display morph controls, animation triggers, and a save button.
Hopefully we will avoid future use of applets for any 2D controls.
Modified Paths:
--------------
maven/trunk/ogoglio-server/src/main/resources/siteTemplates/body.html
Modified: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/body.html
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/siteTemplates/body.html 2007-10-15 16:15:44 UTC (rev 499)
+++ maven/trunk/ogoglio-server/src/main/resources/siteTemplates/body.html 2007-10-15 19:10:14 UTC (rev 500)
@@ -8,8 +8,13 @@
<title>Ogoglio Example: body</title>
<style type="text/css">
#main {
+ margin: 10px;
+ position: relative;
+ top: 0px;
+ left: 0px;
+ height: 430px;
overflow: hidden;
- width: 750px;
+ width: 730px;
}
.section {
@@ -24,9 +29,43 @@
}
#appletDiv {
- width: 800px;
- height: 600px;
+ width: 300px;
+ height: 400px;
+ position: absolute;
+ top: 0px;
+ left: 205px;
}
+
+#leftControlDiv {
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 200px;
+ height: 400px;
+ overflow: auto;
+}
+
+#rightControlDiv {
+ position: absolute;
+ top: 0px;
+ left: 510px;
+ width: 200px;
+ height: 400px;
+}
+
+#morphControls form {
+ display: inline;
+}
+
+#animationControls form input {
+ margin-bottom: 5px;
+ width: 75px;
+}
+
+#textureForm {
+ margin-top: 25px;
+}
+
</style>
<script type="text/javascript">
@@ -36,8 +75,12 @@
var mainElement = null;
var titleElement = null;
var appletDiv = null;
-var textureDiv = null;
+var leftControlDiv = null;
+var rightControlDiv = null;
+var bottomControlDiv = null;
var textureForm = null;
+var morphControls = null;
+var animationControls = null;
var bodyXML = null;
@@ -57,7 +100,7 @@
function handleBodyConfiguration(xml){
if(xml == null){
- textureDiv.innerHTML = "";
+ bottomControlDiv.innerHTML = "";
return;
}
bodyXML = xml;
@@ -65,15 +108,69 @@
var ownerUsername = bodyXML.getAttribute("ownerusername");
textureForm.action = appPath + "/account/" + ownerUsername + "/body/" + bodyConfigurationID + "/texture";
+
+ setTimeout("awaitInitialLoad();", 1000);
}
+function awaitInitialLoad(){
+ var editor = document.getElementById("viewer");
+ if(editor != null && editor.completedInitialLoad()){
+ initControls();
+ return;
+ }
+ setTimeout("awaitInitialLoad();", 500);
+}
+
+function initControls(){
+ var editor = document.getElementById("viewer");
+ var morphNames = editor.getMorphNames();
+ var morphHTML = "";
+ for(var i = morphNames.length - 1; i >= 0; i--){
+ var settingValue = editor.getMorphSetting(morphNames[i]);
+ morphHTML += "<h4>" + morphNames[i] + ":</h4>";
+ morphHTML += "<form onsubmit='changeMorph(\"" + morphNames[i] + "\", 0.1);return false;'><input type='submit' value='+' name='" + morphNames[i] + "'></form>";
+ morphHTML += " <span id='" + morphNames[i] + " setting'>" + formatSettingValue(settingValue) + "</span> ";
+ morphHTML += "<form onsubmit='changeMorph(\"" + morphNames[i] + "\", -0.1);return false;'><input type='submit' value='-' name='" + morphNames[i] + "'></form>";
+ }
+ morphControls.innerHTML = morphHTML;
+
+ var animationNames = editor.getAnimationNames();
+ var animationHTML = "";
+ for(var i = 0; i < animationNames.length; i++){
+ if(animationNames[i] == "default"){
+ continue;
+ }
+ animationHTML += "<form onsubmit='playAnimation(\"" + animationNames[i] + "\"); return false;'><input type='submit' value='" + animationNames[i] + "'/></form>";
+ }
+ animationControls.innerHTML = animationHTML;
+}
+
+function playAnimation(animationName){
+ var editor = document.getElementById("viewer");
+ editor.playAnimation(animationName);
+}
+
+function changeMorph(morphName, delta){
+ var editor = document.getElementById("viewer");
+ var settingValue = editor.getMorphSetting(morphName) + delta;
+ if(settingValue < 0) settingValue = 0;
+ if(settingValue > 1) settingValue = 1;
+ editor.setMorphSetting(morphName, settingValue);
+ var settingSpan = document.getElementById(morphName + " setting");
+ settingSpan.innerHTML = formatSettingValue(settingValue);
+}
+
+function formatSettingValue(settingValue){
+ return settingValue.toPrecision(2);
+}
+
function writeApplet(){
if(loginCookie == null){
appletDiv.innerHTML = "No cookie. Please sign in or register as a guest.";
return;
}
var serviceURI = getServiceURI();
- var html = "<applet id='viewer' codebase='" + serviceURI + "' code='com.ogoglio.bodyeditor.BodyEditorApplet' archive='ogoglio-common.jar,ogoglio-body-editor-applet.jar' width='800' height='600' mayscript='true'>";
+ var html = "<applet id='viewer' codebase='" + serviceURI + "' code='com.ogoglio.bodyeditor.BodyEditorApplet' archive='ogoglio-common.jar,ogoglio-body-editor-applet.jar' width='300' height='400' mayscript='true'>";
html += "<param name='loginCookie' value='" + loginCookie + "' />";
html += "<param name='serviceURI' value='" + getServiceURI() + "' />";
html += "<param name='image' value='" + appPath + "/icons/32x32/face-monkey.png' />";
@@ -92,14 +189,26 @@
ogViewer.updateTextures();
}
+function doSave(){
+ var editor = document.getElementById("viewer");
+ if(editor == null){
+ return;
+ }
+ editor.saveBodyConfiguration();
+}
+
function init(){
populateMemberMenuItem();
titleElement = document.getElementById("title");
mainElement = document.getElementById("main");
appletDiv = document.getElementById("appletDiv");
- textureDiv = document.getElementById("textureDiv");
+ leftControlDiv = document.getElementById("leftControlDiv");
+ rightControlDiv = document.getElementById("rightControlDiv");
+ bottomControlDiv = document.getElementById("bottomControlDiv");
textureForm = document.getElementById("textureForm");
+ morphControls = document.getElementById("morphControls");
+ animationControls = document.getElementById("animationControls");
addAuthListeners(handleAuth, handleAuth);
}
@@ -109,13 +218,6 @@
<div id="header">
<strong><a href="index.html">Ogoglio Example</a></strong>
- <span id="search">
- <!-- <form style="margin: 0px;" method="get" action="http://www.google.com/search">
- <input type="text" size="20" name="q"/>
- <input type="hidden" name="q" value="site:example.com"/>
- <input type="submit" value="find"/>
- </form> -->
- </span>
</div> <!-- end header -->
<div id="headerMenu">
@@ -123,18 +225,27 @@
<span id="memberMenuItem"> </span>
</div> <!-- end header menu -->
+ <h2 id="title">Body Editor:</h2>
<div id="main">
- <h2 id="title">Body Editor:</h2>
+ <div id="leftControlDiv">
+ <div id="morphControls"> </div>
+ </div>
+ <div id="rightControlDiv">
+ <div id="animationControls"> </div>
+
+ <form id="textureForm" onsubmit="handleTextureForm();" target="textureTargetFrame" action="" enctype="multipart/form-data" method="post">
+ <input type="file" size="7" name="textureData" />
+ <input type="submit" value="upload custom skin" />
+ </form>
+ <iframe id="textureTargetFrame" name="textureTargetFrame" style="width: 1px; height: 1px;"></iframe>
+
+ </div>
<div id="appletDiv"> </div>
</div> <!-- end main -->
-<div id="textureDiv" style="text-align: center;">
- <form id="textureForm" onsubmit="handleTextureForm();" target="textureTargetFrame" action="" enctype="multipart/form-data" method="post">
- <input type="file" name="textureData" />
- <input type="submit" value="upload custom skin" />
- </form>
- <iframe id="textureTargetFrame" name="textureTargetFrame" style="width: 1px; height: 1px;"></iframe>
+<div id="bottomControlDiv" style="text-align: center;">
+ <form onsubmit="doSave(); return false"><input type="submit" value="save" /></form>
</div>
<div id="footer">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-15 19:10:20
|
Revision: 501
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=501&view=rev
Author: trevorolio
Date: 2007-10-15 12:10:20 -0700 (Mon, 15 Oct 2007)
Log Message:
-----------
Switched the body editor applet to just show the 3D, with editing functions exposed to the page via LiveConnect.
Made body.html use the new functions to display morph controls, animation triggers, and a save button.
Hopefully we will avoid future use of applets for any 2D controls.
Modified Paths:
--------------
maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
Modified: maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-10-15 19:10:14 UTC (rev 500)
+++ maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-10-15 19:10:20 UTC (rev 501)
@@ -15,23 +15,17 @@
import java.applet.Applet;
import java.awt.BorderLayout;
-import java.awt.Button;
import java.awt.Color;
import java.awt.Dimension;
-import java.awt.FlowLayout;
import java.awt.GraphicsConfigTemplate;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
-import java.awt.Label;
import java.awt.Panel;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
-import java.util.Vector;
import java.util.zip.ZipInputStream;
import javax.media.j3d.AmbientLight;
@@ -43,8 +37,6 @@
import javax.media.j3d.Transform3D;
import javax.media.j3d.TransformGroup;
import javax.media.j3d.View;
-import javax.swing.BoxLayout;
-import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.vecmath.Color3f;
import javax.vecmath.Point3d;
@@ -82,12 +74,8 @@
private AccountDocument accountDoc = null;
- private WestPanel westPanel = null;
-
private BodyPanel bodyPanel = new BodyPanel();
- private EastPanel eastPanel = null;
-
private SpacelessUser user = null;
private WebAPIClient webClient = null;
@@ -95,17 +83,17 @@
private boolean completedInitialLoad = false;
private J3DDataManager dataManager = null;
-
+
private BodyDataDocument[] bodyDataDocuments = null;
-
+
public BodyEditorApplet() {
setBackground(Color.WHITE);
setLayout(new BorderLayout());
- setSize(new Dimension(800, 600));
+ setSize(new Dimension(300, 400));
}
-
- public void updateTextures(){
- if(bodyPanel == null || bodyPanel.renderable == null){
+
+ public void updateTextures() {
+ if (bodyPanel == null || bodyPanel.renderable == null) {
return;
}
dataManager.removeBodyTexture(user.getUsername(), user.getBodyConfiguration().getBodyConfigurationID());
@@ -113,12 +101,80 @@
bodyPanel.renderable.repaintSkinTexture();
}
+ public String[] getMorphNames() {
+ if (bodyPanel.bodyData == null) {
+ return new String[0];
+ }
+ MorphDeltaMap[] deltaMaps = bodyPanel.bodyData.getMorphDeltaMaps();
+ String[] results = new String[deltaMaps.length];
+ for (int i = 0; i < results.length; i++) {
+ results[i] = deltaMaps[i].getName();
+ }
+ return results;
+ }
+
+ public float getMorphSetting(String morphName) {
+ if (user == null) {
+ return 0;
+ }
+ return user.getBodyConfiguration().getSetting(morphName);
+ }
+
+ public void setMorphSetting(String morphName, float setting) {
+ if (user == null || bodyPanel == null || bodyPanel.renderable == null) {
+ return;
+ }
+ user.getBodyConfiguration().addSetting(morphName, setting);
+ bodyPanel.renderable.updateMorphs();
+ }
+
+ public String[] getAnimationNames() {
+ if (user == null || bodyPanel == null || bodyPanel.renderable == null) {
+ return new String[0];
+ }
+ Bvh[] animations = bodyPanel.bodyData.getAnimations();
+ String[] results = new String[animations.length];
+ for (int i = 0; i < results.length; i++) {
+ results[i] = animations[i].getName();
+ }
+ return results;
+ }
+
+ public void playAnimation(String animationName) {
+ if (user == null || bodyPanel == null || bodyPanel.renderable == null) {
+ return;
+ }
+ bodyPanel.renderable.playAnimation(animationName, false);
+ }
+
+ public String getBodyConfigurationDocument() {
+ if (user == null || bodyPanel == null || bodyPanel.renderable == null) {
+ return null;
+ }
+ return new BodyConfigurationDocument(user.getBodyConfiguration()).toElement().toString();
+ }
+
+ public void saveBodyConfiguration(){
+ if (user == null || bodyPanel == null || bodyPanel.renderable == null) {
+ return;
+ }
+ try {
+ webClient.updateBodyConfiguration(new BodyConfigurationDocument(user.getBodyConfiguration()));
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
private class SpacelessUser extends User {
public SpacelessUser(String username, BodyConfigurationDocument bodyConfigDoc) {
super(new Space(new SpacelessContext(), 1, "Space", "nobody", false, 0), username, new Transform3D(), new BodyConfiguration(bodyConfigDoc));
}
}
+ public boolean completedInitialLoad() {
+ return completedInitialLoad;
+ }
+
private class SpacelessContext implements Context {
public InputStream getPageContentStream(long thingID, long pageID) {
@@ -168,8 +224,6 @@
bodyData = dataManager.getBodyData(user.getBodyConfiguration().getBodyDataID());
renderable = new J3DUserRenderable(user, bodyData, dataManager.getBodyTexture(user.getUsername(), user.getBodyConfiguration().getBodyConfigurationID()));
userGroup.addChild(renderable);
- westPanel.morphList.initList();
- eastPanel.animationList.initAnimationList();
return true;
} catch (Exception e) {
e.printStackTrace();
@@ -224,237 +278,6 @@
}
}
- private class MorphListPanel extends Panel implements ActionListener {
- Dimension dimension = new Dimension(150, 565);
-
- Button saveButton = new Button("Save");
-
- public MorphListPanel() {
- setPreferredSize(dimension);
- setMinimumSize(dimension);
- setLayout(new FlowLayout(FlowLayout.CENTER, 0, 1));
- setBackground(Color.WHITE);
- }
-
- void initList() {
- removeAll();
- validate();
- MorphDeltaMap[] deltaMaps = bodyPanel.bodyData.getMorphDeltaMaps();
- if (deltaMaps.length == 0) {
- add(saveButton);
- validate();
- return;
- }
-
- for (int i = deltaMaps.length - 1; i >= 0; i--) {
- add(new MorphPanel(deltaMaps[i]));
- validate();
- }
-
- saveButton.setBackground(Color.WHITE);
- saveButton.addActionListener(this);
- add(saveButton);
- validate();
- }
-
- public void actionPerformed(ActionEvent event) {
- if (event.getSource() == saveButton) {
- try {
- webClient.updateBodyConfiguration(new BodyConfigurationDocument(user.getBodyConfiguration()));
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- }
-
- private class MorphPanel extends Panel implements ActionListener {
-
- float buttonStep = 0.1f;
-
- Dimension dimension = new Dimension(150, 50);
-
- MorphDeltaMap morphDeltaMap = null;
-
- Label nameLabel = null;
-
- Label valueLabel = null;
-
- Button moreButton = new Button("+");
-
- Button lessButton = new Button("-");
-
- public MorphPanel(MorphDeltaMap morphDeltaMap) {
- setPreferredSize(dimension);
- setMinimumSize(dimension);
- setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
- setBackground(Color.WHITE);
-
- this.morphDeltaMap = morphDeltaMap;
- nameLabel = new Label(morphDeltaMap.getName() + ":");
- nameLabel.setBackground(Color.WHITE);
- add(nameLabel);
-
- Panel buttonPanel = new Panel();
- buttonPanel.setBackground(Color.WHITE);
-
- moreButton.setBackground(Color.WHITE);
- moreButton.addActionListener(this);
- buttonPanel.add(moreButton);
-
- valueLabel = new Label(formatValue(getMorphSetting()));
- valueLabel.setBackground(Color.WHITE);
- buttonPanel.add(valueLabel);
-
- lessButton.setBackground(Color.WHITE);
- lessButton.addActionListener(this);
- buttonPanel.add(lessButton);
-
- add(buttonPanel);
- }
-
- float getMorphSetting() {
- return user.getBodyConfiguration().getSetting(morphDeltaMap.getName());
- }
-
- public void actionPerformed(ActionEvent event) {
- float setting = -1;
- if (event.getSource() == moreButton) {
- setting = getMorphSetting();
- if (setting >= 1) {
- return;
- }
- setting += buttonStep;
- } else if (event.getSource() == lessButton) {
- setting = getMorphSetting();
- if (setting <= 0) {
- return;
- }
- setting -= buttonStep;
- }
- if (setting != -1) {
- user.getBodyConfiguration().addSetting(morphDeltaMap.getName(), setting);
- valueLabel.setText(formatValue(getMorphSetting()));
- bodyPanel.renderable.updateMorphs();
- }
- }
-
- String formatValue(float value) {
- Object[] args = { new Float(value) };
- return String.format("%1.1f", args);
- }
-
- }
-
- private class BodyPickerPanel extends Panel implements ActionListener {
- Dimension dimension = new Dimension(150, 35);
-
- JComboBox bodyComboBox = null;
-
- public BodyPickerPanel() {
- setPreferredSize(dimension);
- setMinimumSize(dimension);
- setLayout(new FlowLayout(FlowLayout.CENTER, 0, 5));
- setBackground(Color.WHITE);
-
- Vector names = new Vector();
- int selectedIndex = -1;
- for (int i = 0; i < bodyDataDocuments.length; i++) {
- names.add(bodyDataDocuments[i].getDisplayName());
- if(user.getBodyConfiguration().getBodyDataID() == bodyDataDocuments[i].getBodyDataID()){
- selectedIndex = i;
- }
- }
- bodyComboBox = new JComboBox(names.toArray());
- bodyComboBox.setSelectedIndex(selectedIndex);
- bodyComboBox.setBackground(Color.WHITE);
- bodyComboBox.addActionListener(this);
- add(bodyComboBox);
- }
-
- public void actionPerformed(ActionEvent event) {
- if(event.getSource() == bodyComboBox){
- String bodyName = (String)bodyComboBox.getSelectedItem();
- if(bodyName == null){
- return;
- }
- for (int i = 0; i < bodyDataDocuments.length; i++) {
- if(bodyName.equals(bodyDataDocuments[i].getDisplayName())){
- if(bodyDataDocuments[i].getBodyDataID() == user.getBodyConfiguration().getBodyDataID()){
- return;
- }
- user.getBodyConfiguration().setBodyDataID(bodyDataDocuments[i].getBodyDataID());
- bodyPanel.bodyData = dataManager.getBodyData(bodyDataDocuments[i].getBodyDataID());
- bodyPanel.renderable.initBody(bodyPanel.bodyData, dataManager.getBodyTexture(user.getUsername(), user.getBodyConfiguration().getBodyConfigurationID()));
- westPanel.morphList.initList();
- eastPanel.animationList.initAnimationList();
- }
- }
- }
- }
- }
-
- private class WestPanel extends Panel {
- Dimension dimension = new Dimension(150, 400);
-
- BodyPickerPanel bodyPickerPanel = new BodyPickerPanel();
-
- MorphListPanel morphList = new MorphListPanel();
-
- public WestPanel() {
- setPreferredSize(dimension);
- setMinimumSize(dimension);
- setLayout(new FlowLayout(FlowLayout.CENTER, 0, 5));
- setBackground(Color.WHITE);
- add(bodyPickerPanel);
- add(morphList);
- }
- }
-
- private class AnimationList extends Panel implements ActionListener {
- Dimension dimension = new Dimension(150, 400);
-
- public AnimationList() {
- setPreferredSize(dimension);
- setMinimumSize(dimension);
- setLayout(new FlowLayout(FlowLayout.CENTER, 0, 5));
- setBackground(Color.WHITE);
- }
-
- void initAnimationList() {
- removeAll();
- validate();
- Bvh[] animations = bodyPanel.bodyData.getAnimations();
- for (int i = 0; i < animations.length; i++) {
- Button button = new Button(animations[i].getName());
- button.addActionListener(this);
- add(button);
- validate();
- }
- }
-
- public void actionPerformed(ActionEvent e) {
- if (e.getSource() instanceof Button) {
- Button button = (Button) e.getSource();
- bodyPanel.renderable.playAnimation(button.getLabel(), false);
- }
- }
- }
-
- private class EastPanel extends Panel {
- Dimension dimension = new Dimension(150, 400);
-
- AnimationList animationList = new AnimationList();
-
- public EastPanel() {
- setPreferredSize(dimension);
- setMinimumSize(dimension);
- setLayout(new FlowLayout(FlowLayout.CENTER, 0, 5));
- setBackground(Color.WHITE);
- add(animationList);
- }
- }
-
public void start() {
authCookie = getParameter("loginCookie");
if (authCookie == null) {
@@ -481,13 +304,8 @@
user = new SpacelessUser(accountDoc.getUsername(), webClient.getDefaultBodyConfiguration(accountDoc.getUsername()));
bodyDataDocuments = webClient.getBodyDataDocuments();
-
- add(bodyPanel, BorderLayout.CENTER);
- westPanel = new WestPanel();
- add(westPanel, BorderLayout.WEST);
- eastPanel = new EastPanel();
- add(eastPanel, BorderLayout.EAST);
+ add(bodyPanel, BorderLayout.CENTER);
} catch (URISyntaxException e) {
e.printStackTrace();
removeAll();
@@ -571,9 +389,4 @@
configTemplate.setDoubleBuffer(GraphicsConfigTemplate.REQUIRED);
return device.getBestConfiguration(configTemplate);
}
-
- public boolean completedInitialLoad() {
- return completedInitialLoad;
- }
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-15 16:15:43
|
Revision: 499
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=499&view=rev
Author: trevorolio
Date: 2007-10-15 09:15:44 -0700 (Mon, 15 Oct 2007)
Log Message:
-----------
Added a way for javascript to refresh the skin of a body editor applet after uploading a new texture.
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataCache.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataManager.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/Skin.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataCache.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataCache.java 2007-10-15 16:15:40 UTC (rev 498)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataCache.java 2007-10-15 16:15:44 UTC (rev 499)
@@ -36,6 +36,10 @@
bodyTextureMap.put(new Long(bodyConfigurationID), image);
}
+ public void removeBodyTexture(long bodyConfigurationID) {
+ bodyTextureMap.remove(new Long(bodyConfigurationID));
+ }
+
public J3DTemplateData getTemplateData(long templateID, int lod) {
return (J3DTemplateData) templateDataMap.get(createTemplateGUID(templateID, lod));
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataManager.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataManager.java 2007-10-15 16:15:40 UTC (rev 498)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataManager.java 2007-10-15 16:15:44 UTC (rev 499)
@@ -107,7 +107,11 @@
dataCache.putBodyTexture(bodyConfigurationID, image);
return image;
}
-
+
+ public void removeBodyTexture(String username, long bodyConfigurationID) {
+ dataCache.removeBodyTexture(bodyConfigurationID);
+ }
+
public J3DBodyData getBodyData(long bodyDataID) {
J3DBodyData data = dataCache.getBodyData(bodyDataID);
if (data != null) {
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java 2007-10-15 16:15:40 UTC (rev 498)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java 2007-10-15 16:15:44 UTC (rev 499)
@@ -226,6 +226,10 @@
skin.updateMorphs();
}
+ public void setSkinTexture(BufferedImage skinTexture){
+ skin.setBaseImage(skinTexture);
+ }
+
public void repaintSkinTexture() {
skin.updateTexture();
}
@@ -267,5 +271,4 @@
animator = new BodyAnimator(skeleton, animation, skin, bodyAnimatorListener);
animator.animate(loop);
}
-
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/Skin.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/Skin.java 2007-10-15 16:15:40 UTC (rev 498)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/Skin.java 2007-10-15 16:15:44 UTC (rev 499)
@@ -112,6 +112,10 @@
}
+ public void setBaseImage(BufferedImage baseImage){
+ this.baseImage = baseImage;
+ }
+
public void updateTexture() {
if (baseImage == null) {
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-15 16:15:36
|
Revision: 498
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=498&view=rev
Author: trevorolio
Date: 2007-10-15 09:15:40 -0700 (Mon, 15 Oct 2007)
Log Message:
-----------
Added a way for javascript to refresh the skin of a body editor applet after uploading a new texture.
Modified Paths:
--------------
maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
Modified: maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-10-15 16:15:38 UTC (rev 497)
+++ maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-10-15 16:15:40 UTC (rev 498)
@@ -103,6 +103,15 @@
setLayout(new BorderLayout());
setSize(new Dimension(800, 600));
}
+
+ public void updateTextures(){
+ if(bodyPanel == null || bodyPanel.renderable == null){
+ return;
+ }
+ dataManager.removeBodyTexture(user.getUsername(), user.getBodyConfiguration().getBodyConfigurationID());
+ bodyPanel.renderable.setSkinTexture(dataManager.getBodyTexture(user.getUsername(), user.getBodyConfiguration().getBodyConfigurationID()));
+ bodyPanel.renderable.repaintSkinTexture();
+ }
private class SpacelessUser extends User {
public SpacelessUser(String username, BodyConfigurationDocument bodyConfigDoc) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-15 16:15:34
|
Revision: 497
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=497&view=rev
Author: trevorolio
Date: 2007-10-15 09:15:38 -0700 (Mon, 15 Oct 2007)
Log Message:
-----------
Added a way for javascript to refresh the skin of a body editor applet after uploading a new texture.
Modified Paths:
--------------
maven/trunk/ogoglio-server/src/main/resources/siteTemplates/body.html
Modified: maven/trunk/ogoglio-server/src/main/resources/siteTemplates/body.html
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/siteTemplates/body.html 2007-10-15 13:55:10 UTC (rev 496)
+++ maven/trunk/ogoglio-server/src/main/resources/siteTemplates/body.html 2007-10-15 16:15:38 UTC (rev 497)
@@ -82,6 +82,16 @@
appletDiv.innerHTML = html;
}
+function handleTextureForm(){
+ setTimeout("repaintTexture();", 5000);
+ return true;
+}
+
+function repaintTexture(){
+ var ogViewer = document.getElementById("viewer");
+ ogViewer.updateTextures();
+}
+
function init(){
populateMemberMenuItem();
@@ -119,8 +129,8 @@
</div> <!-- end main -->
-<div id="textureDiv">
- <form id="textureForm" target="textureTargetFrame" action="" enctype="multipart/form-data" method="post">
+<div id="textureDiv" style="text-align: center;">
+ <form id="textureForm" onsubmit="handleTextureForm();" target="textureTargetFrame" action="" enctype="multipart/form-data" method="post">
<input type="file" name="textureData" />
<input type="submit" value="upload custom skin" />
</form>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-15 13:55:12
|
Revision: 496
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=496&view=rev
Author: trevorolio
Date: 2007-10-15 06:55:10 -0700 (Mon, 15 Oct 2007)
Log Message:
-----------
Switched avatars to use texture replacement instead of shading combination, for a flat, bright look.
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/Skin.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/Skin.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/Skin.java 2007-10-15 13:48:33 UTC (rev 495)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/Skin.java 2007-10-15 13:55:10 UTC (rev 496)
@@ -81,7 +81,7 @@
Appearance appearance = new Appearance();
TextureAttributes textureAtts = new TextureAttributes();
- textureAtts.setTextureMode(TextureAttributes.COMBINE);
+ textureAtts.setTextureMode(TextureAttributes.REPLACE);
appearance.setTextureAttributes(textureAtts);
appearance.setTexture(texture);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-15 13:48:29
|
Revision: 495
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=495&view=rev
Author: trevorolio
Date: 2007-10-15 06:48:33 -0700 (Mon, 15 Oct 2007)
Log Message:
-----------
Removed some annoying debug printlns.
Modified Paths:
--------------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java 2007-10-15 13:04:52 UTC (rev 494)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java 2007-10-15 13:48:33 UTC (rev 495)
@@ -211,14 +211,12 @@
InputStream fileInput = null;
if (request.getContentType() != null && request.getContentType().startsWith("multipart/form-data")) {
fileInput = getFirstFile(request, Sim.MAX_GEOMETRY_SIZE);
- System.out.println("File input: " + fileInput);
if (fileInput == null) {
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
return;
}
} else {
fileInput = request.getInputStream();
- System.out.println("inputolio: " + fileInput);
}
if (!getMediaService().write(MediaService.getBodyTextureName(configRecord.getBodyConfigurationID()), fileInput, Sim.MAX_BODY_TEXTURE_SIZE)) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-15 13:04:51
|
Revision: 494
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=494&view=rev
Author: trevorolio
Date: 2007-10-15 06:04:52 -0700 (Mon, 15 Oct 2007)
Log Message:
-----------
Added a body texture web resource, backed by the media service. This is used in conjunction with body configurations to provide users with skin customization.
Still to come in texture land:
the body editor UI needs some design love to incorporate the texture upload form
body loading takes too long and shows no progress information
a base skin texture with decal textures baked on top
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIDescriptor.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/BodyDataProvider.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataCache.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataManager.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/SkinLoader.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2007-10-15 13:04:48 UTC (rev 493)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2007-10-15 13:04:52 UTC (rev 494)
@@ -728,6 +728,10 @@
}
}
+ public InputStream getBodyTexture(String username, long bodyConfigurationID) {
+ return webClient.getBodyTexture(username, bodyConfigurationID);
+ }
+
}
public TemplateDataProvider getTemplateDataProvider() {
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java 2007-10-15 13:04:48 UTC (rev 493)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java 2007-10-15 13:04:52 UTC (rev 494)
@@ -477,14 +477,14 @@
}
public BodyDataDocument[] getBodyDataDocuments() throws IOException {
-
+
XMLElement result = wire.fetchAuthenticatedXML(descriptor.getBodiesURI(), authenticator.getAuthCookie());
Vector docs = new Vector();
Vector children = result.getChildren();
for (int i = 0; i < children.size(); i++) {
- docs.add(new BodyDataDocument((XMLElement)children.get(i)));
+ docs.add(new BodyDataDocument((XMLElement) children.get(i)));
}
- return (BodyDataDocument[])docs.toArray(new BodyDataDocument[0]);
+ return (BodyDataDocument[]) docs.toArray(new BodyDataDocument[0]);
}
public BodyDataDocument getBodyDataDocument(long bodyDataID) throws IOException {
@@ -549,4 +549,19 @@
return new BodyConfigurationDocument(wire.fetchAuthenticatedXML(descriptor.getDefaultBodyConfiguration(username), authenticator.getAuthCookie()));
}
+ public void setBodyTexture(String username, long bodyConfigurationID, InputStream textureData, String mimeType) throws IOException {
+ wire.performPOST(descriptor.getBodyTextureURI(username, bodyConfigurationID), textureData, mimeType, authenticator.getAuthCookie());
+ }
+
+ public InputStream getBodyTexture(String username, long bodyConfigurationID) {
+ try {
+ return wire.fetchAuthenticatedStream(descriptor.getBodyTextureURI(username, bodyConfigurationID), authenticator.getAuthCookie());
+ } catch (IOException e) {
+ return null;
+ }
+ }
+
+ public void deleteBodyTexture(String username, long bodyConfigurationID) throws IOException {
+ wire.sendDelete(descriptor.getBodyTextureURI(username, bodyConfigurationID), authenticator.getAuthCookie());
+ }
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIDescriptor.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIDescriptor.java 2007-10-15 13:04:48 UTC (rev 493)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIDescriptor.java 2007-10-15 13:04:52 UTC (rev 494)
@@ -135,6 +135,9 @@
return WebAPIUtil.appendToURI(getBodyConfigurationsURI(username), bodyConfigurationID + "/");
}
+ public URI getBodyTextureURI(String username, long bodyConfigurationID){
+ return WebAPIUtil.appendToURI(getBodyConfigurationURI(username, bodyConfigurationID), "texture");
+ }
public URI getDefaultBodyConfiguration(String username) {
return WebAPIUtil.appendToURI(getBodyConfigurationsURI(username), "default/");
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/BodyDataProvider.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/BodyDataProvider.java 2007-10-15 13:04:48 UTC (rev 493)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/BodyDataProvider.java 2007-10-15 13:04:52 UTC (rev 494)
@@ -1,9 +1,12 @@
package com.ogoglio.client.model;
+import java.io.InputStream;
import java.util.zip.ZipInputStream;
public interface BodyDataProvider {
public ZipInputStream getBodyData(long bodyDataID);
+ public InputStream getBodyTexture(String username, long bodyConfigurationID);
+
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataCache.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataCache.java 2007-10-15 13:04:48 UTC (rev 493)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataCache.java 2007-10-15 13:04:52 UTC (rev 494)
@@ -13,46 +13,61 @@
limitations under the License. */
package com.ogoglio.viewer.j3d;
+import java.awt.image.BufferedImage;
import java.util.HashMap;
public class J3DDataCache {
private HashMap bodyDataMap = new HashMap(); //maps body IDs to J3DBodyData objects
-
+
private HashMap templateDataMap = new HashMap(); //maps template guid to J3DTemplateData objects
+ private HashMap bodyTextureMap = new HashMap(); //maps bodyConfigurationIDs to BufferedImage objects
+
+ public BufferedImage getBodyTexture(long bodyConfigurationID) {
+ return (BufferedImage) bodyTextureMap.get(new Long(bodyConfigurationID));
+ }
+
+ public void putBodyTexture(long bodyConfigurationID, BufferedImage image) {
+ if(image == null){
+ bodyTextureMap.remove(new Long(bodyConfigurationID));
+ return;
+ }
+ bodyTextureMap.put(new Long(bodyConfigurationID), image);
+ }
+
public J3DTemplateData getTemplateData(long templateID, int lod) {
return (J3DTemplateData) templateDataMap.get(createTemplateGUID(templateID, lod));
}
- public void putBodyData(long bodyDataID, J3DBodyData data){
+ public void putBodyData(long bodyDataID, J3DBodyData data) {
bodyDataMap.put(new Long(bodyDataID), data);
}
-
- public J3DBodyData getBodyData(long bodyDataID){
- return (J3DBodyData)bodyDataMap.get(new Long(bodyDataID));
+
+ public J3DBodyData getBodyData(long bodyDataID) {
+ return (J3DBodyData) bodyDataMap.get(new Long(bodyDataID));
}
-
+
public void putTemplateData(long templateID, int lod, J3DTemplateData entry) {
templateDataMap.put(createTemplateGUID(templateID, lod), entry);
}
- private String createTemplateGUID(long id, int lod){
+ private String createTemplateGUID(long id, int lod) {
return id + "-" + lod;
}
-
- private long getIDFromGUID(String guid){
+
+ private long getIDFromGUID(String guid) {
return Long.parseLong(guid.split("-")[0]);
}
- private long getLODFromGUID(String guid){
+ private long getLODFromGUID(String guid) {
return Long.parseLong(guid.split("-")[1]);
}
- private J3DTemplateData[] getAllTemplateData(){
- return (J3DTemplateData[])templateDataMap.values().toArray(new J3DTemplateData[0]);
+ private J3DTemplateData[] getAllTemplateData() {
+ return (J3DTemplateData[]) templateDataMap.values().toArray(new J3DTemplateData[0]);
}
-
+
public void cleanup() {
J3DTemplateData[] data = getAllTemplateData();
for (int i = 0; i < data.length; i++) {
@@ -65,6 +80,6 @@
}
private J3DBodyData[] getAllBodyData() {
- return (J3DBodyData[])bodyDataMap.values().toArray(new J3DBodyData[0]);
+ return (J3DBodyData[]) bodyDataMap.values().toArray(new J3DBodyData[0]);
}
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataManager.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataManager.java 2007-10-15 13:04:48 UTC (rev 493)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataManager.java 2007-10-15 13:04:52 UTC (rev 494)
@@ -89,6 +89,25 @@
this.bodyDataProvider = bodyDataProvider;
}
+ public BufferedImage getBodyTexture(String username, long bodyConfigurationID){
+ BufferedImage image = dataCache.getBodyTexture(bodyConfigurationID);
+ if(image != null){
+ return image;
+ }
+ InputStream imageStream = bodyDataProvider.getBodyTexture(username, bodyConfigurationID);
+ if(imageStream == null){
+ return null;
+ }
+ try {
+ image = ImageIO.read(imageStream);
+ } catch (IOException e) {
+ Log.warn("Custom skin could not be read: " + e);
+ return null;
+ }
+ dataCache.putBodyTexture(bodyConfigurationID, image);
+ return image;
+ }
+
public J3DBodyData getBodyData(long bodyDataID) {
J3DBodyData data = dataCache.getBodyData(bodyDataID);
if (data != null) {
@@ -554,5 +573,4 @@
public void cleanup() {
dataCache.cleanup();
}
-
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java 2007-10-15 13:04:48 UTC (rev 493)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java 2007-10-15 13:04:52 UTC (rev 494)
@@ -18,6 +18,7 @@
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
+import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Enumeration;
@@ -625,8 +626,10 @@
throw new IllegalStateException("Cannot load body data");
}
+ BufferedImage customSkin = dataManager.getBodyTexture(user.getUsername(), bodyConfig.getBodyConfigurationID());
+
boolean isLocalUser = !offScreen && username != null && user.getUsername().equals(username);
- final J3DUserRenderable renderable = new J3DUserRenderable(user, bodyData);
+ final J3DUserRenderable renderable = new J3DUserRenderable(user, bodyData, customSkin);
renderable.setID(USER_ID_PREFIX + user.getUsername());
if (isLocalUser) {
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java 2007-10-15 13:04:48 UTC (rev 493)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java 2007-10-15 13:04:52 UTC (rev 494)
@@ -15,6 +15,7 @@
package com.ogoglio.viewer.j3d;
import java.awt.Font;
+import java.awt.image.BufferedImage;
import javax.media.j3d.Billboard;
import javax.media.j3d.BoundingSphere;
@@ -73,7 +74,7 @@
private float userHeight = 2; //meters
- public J3DUserRenderable(User user, J3DBodyData bodyData) {
+ public J3DUserRenderable(User user, J3DBodyData bodyData, BufferedImage customSkin) {
ArgumentUtils.assertNotNull(user);
this.user = user;
ArgumentUtils.assertNotNull(bodyData);
@@ -86,13 +87,13 @@
setCapabilities(bodyGroup);
transformGroup.addChild(bodyGroup);
- initBody(bodyData);
+ initBody(bodyData, customSkin);
}
- public void initBody(J3DBodyData bodyData) {
+ public void initBody(J3DBodyData bodyData, BufferedImage customSkin) {
bodyGroup.removeAllChildren();
this.bodyData = bodyData;
- skin = new SkinLoader(bodyData, user.getBodyConfiguration()).generateSkin();
+ skin = new SkinLoader(bodyData, user.getBodyConfiguration(), customSkin).generateSkin();
userHeight = skin.getHeight();
skinMap = bodyData.getSkinMap();
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/SkinLoader.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/SkinLoader.java 2007-10-15 13:04:48 UTC (rev 493)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/SkinLoader.java 2007-10-15 13:04:52 UTC (rev 494)
@@ -34,10 +34,14 @@
private MorphDeltaMap[] morphDeltaMaps = null;
- public SkinLoader(J3DBodyData bodyData, BodyConfiguration bodyConfiguration) {
+ public SkinLoader(J3DBodyData bodyData, BodyConfiguration bodyConfiguration, BufferedImage customSkin) {
this.geometry = bodyData.cloneBodyGeometry();
this.morphDeltaMaps = bodyData.getMorphDeltaMaps();
- this.baseImage = bodyData.getBaseTexture();
+ if(customSkin == null){
+ this.baseImage = bodyData.getBaseTexture();
+ } else {
+ this.baseImage = customSkin;
+ }
this.bodyConfiguration = bodyConfiguration;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-15 13:04:49
|
Revision: 493
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=493&view=rev
Author: trevorolio
Date: 2007-10-15 06:04:48 -0700 (Mon, 15 Oct 2007)
Log Message:
-----------
Added a body texture web resource, backed by the media service. This is used in conjunction with body configurations to provide users with skin customization.
Still to come in texture land:
the body editor UI needs some design love to incorporate the texture upload form
body loading takes too long and shows no progress information
a base skin texture with decal textures baked on top
Modified Paths:
--------------
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/AppletTestWindow.java
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
Added Paths:
-----------
maven/trunk/ogoglio-integration-test/src/test/resources/sample-art3d/TestBodyTexture-Mike.jpg
Modified: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/AppletTestWindow.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/AppletTestWindow.java 2007-10-15 13:04:46 UTC (rev 492)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/AppletTestWindow.java 2007-10-15 13:04:48 UTC (rev 493)
@@ -37,7 +37,7 @@
public class AppletTestWindow extends Frame {
Dimension appDimension = new Dimension(500, 500);
-
+
public ViewerApplet applet = null;
EnvironmentStub clientStub1 = null;
Modified: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2007-10-15 13:04:46 UTC (rev 492)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2007-10-15 13:04:48 UTC (rev 493)
@@ -15,6 +15,7 @@
import java.awt.Dimension;
import java.awt.Shape;
+import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
@@ -90,6 +91,8 @@
WebAPIDescriptor descriptor1 = null;
+ String mikeBodyTextureResourcePath = "sample-art3d/TestBodyTexture-Mike.jpg";
+
public void setUp() {
try {
PropStorage ps=new PropStorage();
@@ -102,6 +105,7 @@
linkURI1 = new URI("http://example.com/");
wire1 = new WebAPIClientWire();
descriptor1 = new WebAPIDescriptor(serviceURI1);
+
} catch (Throwable e) {
e.printStackTrace();
fail(e.getMessage());
@@ -255,6 +259,14 @@
assertEquals(0, configDoc.getBodySettingDocuments().length);
configDoc = basicWebClient.updateBodyConfiguration(configDoc);
assertEquals(0, configDoc.getBodySettingDocuments().length);
+
+ InputStream textureData = UIConstants.getResource(mikeBodyTextureResourcePath);
+ assertNotNull(textureData);
+ basicWebClient.setBodyTexture(basicAuthenticator.getUsername(), configDoc.getBodyConfigurationID(), textureData, "image/jpeg");
+ textureData = basicWebClient.getBodyTexture(basicAuthenticator.getUsername(), configDoc.getBodyConfigurationID());
+ assertStreamsEqual(UIConstants.getResource(mikeBodyTextureResourcePath), textureData);
+ basicWebClient.deleteBodyTexture(basicAuthenticator.getUsername(), configDoc.getBodyConfigurationID());
+ assertNull(basicWebClient.getBodyTexture(basicAuthenticator.getUsername(), configDoc.getBodyConfigurationID()));
}
public void testWebAPIClient() throws IOException {
@@ -912,6 +924,20 @@
return newTemplateDoc;
}
+ private void assertStreamsEqual(InputStream input1, InputStream input2) throws IOException {
+ if(input1 == null || input2 == null){
+ fail("Not equal, null inputs: " + input1 + ", " + input2);
+ return;
+ }
+ while(true){
+ int read = input1.read();
+ assertEquals(read, input2.read());
+ if(read == -1){
+ return;
+ }
+ }
+ }
+
private void consume(InputStream input) throws IOException {
byte[] buffer = new byte[2048];
while (input.read(buffer) != -1) {
Added: maven/trunk/ogoglio-integration-test/src/test/resources/sample-art3d/TestBodyTexture-Mike.jpg
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-integration-test/src/test/resources/sample-art3d/TestBodyTexture-Mike.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|