|
From: <tre...@us...> - 2007-09-27 21:19:04
|
Revision: 452
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=452&view=rev
Author: trevorolio
Date: 2007-09-27 14:19:06 -0700 (Thu, 27 Sep 2007)
Log Message:
-----------
Fixed up the sim body so that it doesn't take much memory.
Added a handy script which uses the multiuser tests to run robots around in a space.
This is handy for testing avatars, but also looks cool.
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/MultiuserTests.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/MultiuserTests.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/MultiuserTests.java 2007-09-27 21:19:02 UTC (rev 451)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/MultiuserTests.java 2007-09-27 21:19:06 UTC (rev 452)
@@ -132,10 +132,14 @@
}
user = robot.spaceClient.getSpace().getUser(robot.spaceClient.getUsername());
}
+ Vector3d homePosition = new Vector3d(Math.abs(random.nextInt()) % 10, 0, Math.abs(random.nextInt()) % 10);
+ System.out.println("Home position " + homePosition);
Transform3D userPosition = new Transform3D();
+ userPosition.setTranslation(homePosition);
boolean lastSpun = true;
while(true) {
if(random.nextBoolean() || random.nextBoolean()){
+ userPosition.setTranslation(homePosition);
robot.spaceClient.viewpointMotionStopped(userPosition);
try {
sleep(1000 + Math.abs((random.nextInt() % 5000)));
@@ -143,8 +147,8 @@
break;
}
} else if(lastSpun) {
- userPosition.set(user.getPosition());
userPosition.rotY(random.nextFloat() % (2 * Math.PI));
+ userPosition.setTranslation(homePosition);
SplinePath path = J3DSplinePath.getSplinePath(userPosition, 1, 0, 0, 2);
robot.spaceClient.viewpointMotionChanged(path);
try {
@@ -154,7 +158,8 @@
}
lastSpun = false;
} else {
- SplinePath path = J3DSplinePath.getSplinePath(user.getPosition(), 0, 1, 0, 2);
+ userPosition.setTranslation(homePosition);
+ SplinePath path = J3DSplinePath.getSplinePath(userPosition, 0, 1, 0, 2);
robot.spaceClient.viewpointMotionChanged(path);
try {
sleep(1000 + Math.abs((random.nextInt() % 6000)));
@@ -169,7 +174,7 @@
public static void main(String[] args) {
if (args.length != 3) {
- Log.error("usage: ... spaceURI serviceURI numRobots");
+ Log.error("usage: ... spaceID serviceURI numRobots");
return;
}
MultiuserTests tests = null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|