|
From: <tre...@us...> - 2007-10-19 22:09:27
|
Revision: 521
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=521&view=rev
Author: trevorolio
Date: 2007-10-19 15:09:31 -0700 (Fri, 19 Oct 2007)
Log Message:
-----------
Fixed up the chairs so that they are populated as seats with reasonable seat positioning.
This required an addition of a template.properties file to template population dirs.
Tweaked template editor html to handle seat position editing keystrokes a little better.
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/MotionInputHandler.java
maven/trunk/ogoglio-common/src/main/java/nanoxml/XMLElement.java
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 22:09:27 UTC (rev 520)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java 2007-10-19 22:09:31 UTC (rev 521)
@@ -443,6 +443,7 @@
}
stopRenderableMotion(renderable, position);
renderable.stopAnimation();
+ renderable.playAnimation(BodyConstants.DEFAULT_ANIMATION_NAME, false, false);
}
public void userSat(User user, Thing seatThing) {
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/MotionInputHandler.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/MotionInputHandler.java 2007-10-19 22:09:27 UTC (rev 520)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/MotionInputHandler.java 2007-10-19 22:09:31 UTC (rev 521)
@@ -21,6 +21,7 @@
import javax.media.j3d.Transform3D;
import javax.vecmath.Point3d;
+import javax.vecmath.Quat4d;
import com.ogoglio.client.UserInputListener;
import com.ogoglio.client.model.SplinePath;
@@ -90,6 +91,18 @@
}
dirty = false;
+ if(userRenderable.getUser().getSeat() != null){
+ Transform3D standingPosition = new Transform3D();
+ standingPosition.set(userRenderable.getUser().getSeat().getPosition());
+ Quat4d seatRotation = userRenderable.getUser().getSeat().getTemplate().getSeatRotation();
+ Transform3D rotateTransform = new Transform3D();
+ rotateTransform.set(seatRotation);
+ standingPosition.mul(rotateTransform);
+
+ userInputListener.viewpointMotionStopped(standingPosition);
+ return;
+ }
+
Transform3D position = new Transform3D();
userRenderable.getPosition(position);
Modified: maven/trunk/ogoglio-common/src/main/java/nanoxml/XMLElement.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/nanoxml/XMLElement.java 2007-10-19 22:09:27 UTC (rev 520)
+++ maven/trunk/ogoglio-common/src/main/java/nanoxml/XMLElement.java 2007-10-19 22:09:31 UTC (rev 521)
@@ -27,7 +27,6 @@
*****************************************************************************/
// TFS added some basic functions. Look for the ones without Javadocs. :-O
-
package nanoxml;
import java.io.ByteArrayOutputStream;
@@ -592,7 +591,6 @@
}
}
-
/**
* Adds or modifies an attribute.
*
@@ -650,11 +648,13 @@
}
public void setAttribute(String name, double value) {
- setAttribute(name, value + "");
+ Object[] args = { new Double(value) };
+ setAttribute(name, String.format("%f", args));
}
public void setAttribute(String name, float value) {
- setAttribute(name, value + "");
+ Object[] args = { new Float(value) };
+ setAttribute(name, String.format("%f", args));
}
/**
@@ -1149,7 +1149,7 @@
* @see nanoxml.XMLElement#getStringAttribute(java.lang.String, java.util.Hashtable, java.lang.String, boolean) getStringAttribute(String, Hashtable, String, boolean)
*/
public String getStringAttribute(String name, String defaultValue) {
- return unencode((String)this.getAttribute(name, defaultValue));
+ return unencode((String) this.getAttribute(name, defaultValue));
}
/**
@@ -1653,7 +1653,7 @@
result.parseString(string);
return result;
}
-
+
/**
* Reads one XML element from a String and parses it.
*
@@ -2157,7 +2157,7 @@
}
public String unencode(String input) {
- if(input == null) {
+ if (input == null) {
return null;
}
StringBuffer result = new StringBuffer();
@@ -2165,24 +2165,24 @@
switch (input.charAt(i)) {
case '&':
int semiIndex = input.indexOf(';', i);
- if(semiIndex == -1) {
+ if (semiIndex == -1) {
result.append('&');
} else {
String entity = input.substring(i, semiIndex + 1);
- if("<".equals(entity)) {
+ if ("<".equals(entity)) {
result.append('<');
i = semiIndex;
- } else if(">".equals(entity)) {
+ } else if (">".equals(entity)) {
result.append('>');
i = semiIndex;
- } else if("&".equals(entity)) {
+ } else if ("&".equals(entity)) {
result.append('&');
i = semiIndex;
- } else if("'".equals(entity)) {
+ } else if ("'".equals(entity)) {
result.append('\'');
i = semiIndex;
- } else if(entity.startsWith("&#x")) {
- result.append((char)(Integer.parseInt(entity.substring(3, entity.length() - 1))));
+ } else if (entity.startsWith("&#x")) {
+ result.append((char) (Integer.parseInt(entity.substring(3, entity.length() - 1))));
i = semiIndex;
} else {
result.append('&');
@@ -2195,7 +2195,7 @@
}
return result.toString();
}
-
+
/**
* Scans an identifier from the current reader. The scanned identifier is appended to <code>result</code>.
*
@@ -2853,5 +2853,4 @@
return new XMLParseException(this.getName(), this.parserLineNr, msg);
}
-
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|