|
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.
|