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-09-24 21:28:30
|
Revision: 439
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=439&view=rev
Author: trevorolio
Date: 2007-09-24 14:28:33 -0700 (Mon, 24 Sep 2007)
Log Message:
-----------
Added some memory hacks to ease Safari's lockups on applet deconstruction
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-09-24 21:26:54 UTC (rev 438)
+++ maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/ViewerApplet.java 2007-09-24 21:28:33 UTC (rev 439)
@@ -68,6 +68,8 @@
}
public void start() {
+ System.gc();
+ Runtime.getRuntime().runFinalization();
authCookie = getParameter("loginCookie");
if (authCookie == null) {
add(new ErrorPanel("Unfortunately, I can't authenticate. Perhaps you aren't logged in?"), BorderLayout.CENTER);
@@ -132,30 +134,40 @@
}
public void destroy() {
+ System.out.println("Destroying " + this + ": " + renderer + ", " + spaceClient);
if (renderer != null) {
renderer.stopRenderer();
}
if (spaceClient != null) {
spaceClient.cleanup();
}
+ System.gc();
+ Runtime.getRuntime().runFinalization();
+ System.out.println("Destroyed " + this + ": " + renderer + ", " + spaceClient);
}
public void stop() {
+ System.out.println("Stopping " + this + ": " + renderer + ", " + spaceClient);
if (renderer != null) {
renderer.stopRenderer();
}
if (spaceClient != null) {
spaceClient.cleanup();
}
+ renderer = null;
+ spaceClient = null;
+ System.gc();
+ Runtime.getRuntime().runFinalization();
+ System.out.println("Stopped " + this + ": " + renderer + ", " + spaceClient);
}
- public boolean completedInitialLoad(){
- if(renderer == null){
+ public boolean completedInitialLoad() {
+ if (renderer == null) {
return false;
}
return renderer.completedInitialLoad();
}
-
+
private float getFloatParameter(String name, float defaultValue) {
String stringValue = getParameter(name);
if (stringValue == null || stringValue.trim().length() == 0) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-09-24 21:26:50
|
Revision: 438
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=438&view=rev
Author: trevorolio
Date: 2007-09-24 14:26:54 -0700 (Mon, 24 Sep 2007)
Log Message:
-----------
Added the blender scripts we use for avatar munging
Modified Paths:
--------------
maven/trunk/ogoglio/src/main/resources/scripts/testApplet.sh
Added Paths:
-----------
maven/trunk/ogoglio/src/main/resources/blender/
maven/trunk/ogoglio/src/main/resources/blender/IKBaker.py
maven/trunk/ogoglio/src/main/resources/blender/ObjExporter.py
maven/trunk/ogoglio/src/main/resources/blender/ogoglio_avatar.py
Added: maven/trunk/ogoglio/src/main/resources/blender/IKBaker.py
===================================================================
--- maven/trunk/ogoglio/src/main/resources/blender/IKBaker.py (rev 0)
+++ maven/trunk/ogoglio/src/main/resources/blender/IKBaker.py 2007-09-24 21:26:54 UTC (rev 438)
@@ -0,0 +1,206 @@
+#!BPY
+
+"""
+Name: 'IK Capture (.bvh)...'
+Blender: 237
+Group: 'Export'
+Tip: 'Export a (.bvh) IK capture file'
+"""
+
+__author__ = "Jean-Baptiste PERIN"
+__url__ = ("blender", "elysiun")
+__version__ = "0.4 05/12/01"
+__email__= ["M. PERIN Jean-Baptiste, jb_...@ya...", "scripts"]
+__bpydoc__ = """\
+This script exports Empty animation to bvh file format.
+
+Supported: Poser 3.01<br>
+
+Missing:<br>
+
+Known issues:<br>
+
+Notes:<br>
+
+"""
+
+#----------------------------------------------
+# (c) Jean-Baptiste PERIN december 2005, released under Blender Artistic Licence
+#----------------------------------------------
+
+import Blender
+import math
+empty_rest_ori = {}
+
+
+def getRootBone(armature):
+ rootBone = None
+ for bone in armature.bones.values():
+ if bone.parent == None :
+ if rootBone == None:
+ rootBone = bone
+ else:
+ print"Multiple root armature not handled"
+ return rootBone
+
+def getBoneCurPos(armature, bone):
+ lempty = Blender.Object.Get(bone.name)
+ return (lempty.getLocation())
+
+def getBoneCurRot(armature, bone):
+ lempty = Blender.Object.Get(bone.name)
+ return (lempty.getMatrix('worldspace'))
+
+def getBoneRestPos(armature, bone):
+ return (bone.head)
+
+def getBoneRestRot(armature, bone):
+ lempty = Blender.Object.Get(bone.name)
+ return (bone.matrix)
+
+def indentString(i):
+ string = ""
+ for v in range(0,i):
+ string += "\t"
+ return string
+
+def printBoneHierarchie (armature, bone, level):
+ str = "%sJOINT %s\n"%(indentString(level), bone.name)
+ str += "%s{\n"%indentString(level)
+ restPos = getBoneRestPos(armature, bone);
+ parentRestPos = getBoneRestPos(armature, bone.parent);
+ str += "%s\tOFFSET %f %f %f\n"%(indentString(level),
+ restPos['ARMATURESPACE'][0] - parentRestPos['ARMATURESPACE'][0],
+ restPos['ARMATURESPACE'][1] - parentRestPos['ARMATURESPACE'][1],
+ restPos['ARMATURESPACE'][2] - parentRestPos['ARMATURESPACE'][2])
+ empty_rest_ori [bone.name] = getBoneRestRot(armature, bone)['ARMATURESPACE']
+ print empty_rest_ori [bone.name]
+ str += "%s\tCHANNELS 3 Zrotation Xrotation Yrotation\n"%indentString(level)
+ if bone.children != None:
+ for b in bone.children:
+ if bone.name == b.parent.name:
+ str += printBoneHierarchie (armature,b, level+1)
+ else:
+ str += "%s\tEnd Site\n"%indentString(level)
+ str += "%s\t{\n"%indentString(level)
+ str += "%s\t\tOFFSET %f %f %f\n"%(indentString(level),
+ bone.tail['ARMATURESPACE'][0]-bone.head['ARMATURESPACE'][0],
+ bone.tail['ARMATURESPACE'][1]-bone.head['ARMATURESPACE'][1],
+ bone.tail['ARMATURESPACE'][2]-bone.head['ARMATURESPACE'][2])
+ str += "%s\t}\n"%indentString(level)
+
+ str += "%s}\n"%indentString(level)
+ return (str)
+
+def printArmatureHierarchie(armature):
+ rootBone = getRootBone(armature)
+ str = "ROOT %s\n{\n"%rootBone.name
+ str += "\tOFFSET %f %f %f\n"%(getBoneRestPos(armature, rootBone)['ARMATURESPACE'][0],
+ getBoneRestPos(armature, rootBone)['ARMATURESPACE'][1],
+ getBoneRestPos(armature, rootBone)['ARMATURESPACE'][2])
+ str += "\tCHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation\n"
+ empty_rest_ori [rootBone.name] = getBoneRestRot(armature, rootBone)['ARMATURESPACE']
+ for b in rootBone.children:
+ if rootBone.name == b.parent.name:
+ str += printBoneHierarchie (armature,b,1)
+ str += "}\n"
+ return (str)
+
+
+def printBoneFrame (armature, bone, level):
+ result = Blender.Mathutils.Matrix(empty_rest_ori [bone.name][0], empty_rest_ori [bone.name][1], empty_rest_ori [bone.name][2], empty_rest_ori [bone.name][3])
+ result.invert()
+ boneRot = getBoneCurRot(armature, bone);
+ rot = Blender.Mathutils.Matrix(boneRot[0], boneRot[1], boneRot[2], boneRot[3])
+ result = result * rot
+
+ ancestor = bone.parent
+ while ancestor:
+ pos = Blender.Mathutils.Matrix(empty_rest_ori [ancestor.name][0], empty_rest_ori [ancestor.name][1], empty_rest_ori [ancestor.name][2], empty_rest_ori [ancestor.name][3])
+ boneRot = getBoneCurRot(armature, ancestor);
+ rotInv = Blender.Mathutils.Matrix(boneRot[0], boneRot[1], boneRot[2], boneRot[3])
+ rotInv.invert()
+ result = rotInv * pos * result
+ ancestor = ancestor.parent
+
+ eul = result.rotationPart().toEuler()
+
+ str = "%f %f %f "%(
+ eul[2],
+ eul[0],
+ eul[1])
+ if bone.children != None:
+ for b in bone.children:
+ if bone.name == b.parent.name:
+ str += printBoneFrame (armature, b, level+1)
+ return (str)
+
+def printArmatureFrame (armature):
+ rootBone = getRootBone(armature)
+ bonePos = getBoneCurPos(armature, rootBone)
+ boneRot = getBoneCurRot(armature, rootBone)
+
+ str = "%f %f %f %f %f %f "%(
+ bonePos[0],
+ bonePos[1],
+ bonePos[2],
+ boneRot.rotationPart().toEuler()[2],
+ boneRot.rotationPart().toEuler()[0],
+ boneRot.rotationPart().toEuler()[1]
+ )
+ for b in rootBone.children:
+ if rootBone.name == b.parent.name:
+ str += printBoneFrame (armature,b,1)
+ str += "\n"
+ return (str)
+
+def exportBVH(filename):
+ global armaturename
+ print "Exporting armature %s to file %s "%( armaturename, filename)
+ startFrame = Blender.Get('staframe')
+ endFrame = Blender.Get('endframe')
+
+ outputfile = file(filename,'w')
+
+ outputfile.write("HIERARCHY\n")
+
+ armData = Blender.Object.Get(armaturename).getData()
+
+ str_res = printArmatureHierarchie (armData)
+ outputfile.write(str_res)
+ outputfile.write("MOTION\n")
+ outputfile.write("Frames: %d\n"%(endFrame-startFrame))
+ outputfile.write("Frame Time: %f\n"%(1.0/Blender.Scene.getCurrent().getRenderingContext().framesPerSec()))
+
+ ctx = Blender.Scene.getCurrent().getRenderingContext()
+ Blender.Set('curframe', startFrame)
+ while Blender.Get('curframe') < endFrame:
+ print "frame : %d"%(Blender.Get('curframe'))
+ str_res = printArmatureFrame(armData)
+ outputfile.write(str_res)
+ Blender.Set('curframe',Blender.Get('curframe')+1)
+
+ outputfile.close()
+
+ Blender.Set('curframe', startFrame)
+
+ Blender.Redraw()
+
+print "**** START ****"
+
+bfilename = Blender.Get('filename')
+armaturename = ""
+nfilename = bfilename.replace('.blend', '.bvh')
+print nfilename
+obj_sel = Blender.Object.GetSelected()
+if (obj_sel != None) and (len (obj_sel) == 1) and (type(obj_sel[0].getData()) == Blender.Types.ArmatureType):
+ print obj_sel[0].getName()
+ print type(obj_sel[0].getData())
+ armaturename = obj_sel[0].getName()
+ Blender.Window.FileSelector(exportBVH, 'Export BVH',nfilename)
+else:
+ error_txt = "Error%t|Select one and only one armature before running this script"
+ Blender.Draw.PupMenu(error_txt)
+ print error_txt
+
+print "**** END ****"
\ No newline at end of file
Added: maven/trunk/ogoglio/src/main/resources/blender/ObjExporter.py
===================================================================
--- maven/trunk/ogoglio/src/main/resources/blender/ObjExporter.py (rev 0)
+++ maven/trunk/ogoglio/src/main/resources/blender/ObjExporter.py 2007-09-24 21:26:54 UTC (rev 438)
@@ -0,0 +1,1269 @@
+#!BPY
+"""Registration info for Blender menus:
+Name: 'OBJ...'
+Blender: 232
+Group: 'Import'
+Tip: 'Import Wavefront File Format (*.obj)'
+"""
+
+#=========================================================================
+# Wavefront OBJ Importer/Exporter v1.2
+# This is a complete OBJ importer and exporter script
+# All Rights Reserved
+# ch...@ar...
+#=========================================================================
+
+#=========================================================================
+# mise a jour pour Blender 228 et suivant jm soler
+# mise a jour pour importer zbrush obj avec uvmapping jm soler
+# mise a jour pour utiliser le selecteur de fichier jm soler
+# mise a jour pour importer les fichiers obj de forester/arboretum jm soler
+#=========================================================================
+
+#=========================================================================
+# DESCRIPTION: This script allows for full importing and exporting of
+# .obj files. uv texture coordinates and normals can be exported and
+# imported. .obj groups and materials can also be converted to and
+# from material indexes in Blender.
+#
+# INSTALLATION:
+# You need the FULL python installation to run this script. You can
+# down load the latest version of PYTHON from http://www.python.org.
+#
+# INSTRUCTIONS (You definitely want to read this!):
+# Once the script is loaded in Blender, hit alt-p. This will bring up
+# the main interface panel. You will have a choise of exporting or
+# importing an .obj module. If you are exporting you must have at least
+# one mesh selected in Blender, or you will get an error.
+# You can change the export filename by entering the path and filename
+# in the dialog. If you do not enter a path, the path will default to
+# your blender directory. You can change the default path in the script <==== NOTE
+# itself by modifying the variable 'Filename' at the top of the script.
+#
+# EXPORTING:
+# There are 4 different export options: Default, Groups, Material Layers,
+# and Standard. "Default" will export your mesh using Material Layers if
+# the mesh has material indexes. "Groups" and "Material Layers" are
+# logically equivalent, but are a different .obj format. If you are
+# exporting a Poser morph target, you must select "Material Layers". <===== NOTE
+# "Standard" will ignore grouping information, even if your mesh has
+# material indexes.
+#
+# There is also a choice between export using "mesh coordinates" or
+# "object coordinates". "Object coordinates" are any location, rotation,
+# or scaling values created outside of mesh edit. They belong to the object
+# rather than the mesh. If you export using mesh coordinates (the default)
+# the center of the object will always be at 0, 0, 0. Export using "mesh
+# coordinates is definintely what you want to use if you are working with
+# a Poser morph target. If you are exporting a group of objects, you will
+# automatically be placed in "object coordinate" mode.
+#
+# IMPORTING:
+# If your OBJ model has uv mapping coordinates, and you want to use them <===== NOTE
+# in Blender, you can access them in two ways. The best way is through Blender's
+# realtime UV coordinates which you enable simply by selecting the UV option in
+# the material edit window. This gives you an exact version of the uv coordinates.
+# An older method is to select the "stick" option in the material edit window. I
+# really don't know why anyone would want to use this option since it cannot handle
+# seams and texture overlap, but I left it in just in case someone could use it for
+# something.
+#
+# If your OBJ contains groups, once it has been imported, it may still appear
+# to lack any material indexes. If this happens, it can be remedied <=== NOTE
+# by going to the mesh editor window, clicking on the mesh selection button, and
+# reselecting the mesh you have just imported. You will now have as many
+# materials attached to your object as there are groups. You can then select
+# different groups by doing a material select when you are in edit mode.
+#
+# Finally, you might have problems with certain parts of the object not displaying
+# after you go in and out of edit mode the first time. To fix this, simply go into
+# edit mode again, and select the "remove doubles" option.
+#
+#
+# HISTORY:
+# Nov 13, 2001: Initial Release
+# Nov 16, 2001: Version 1.1 - no longer need to pre-define dummy materials
+# Dec 13, 2001: Version 1.2 - now imports into realtime UV (the UV button in the material edit window), and
+# exports realtime UV. This format is more compatible with the native .OBJ uv format. Should eliminate
+# texture misalignments and seams. Simply press the UV button in the material edit window after importing.
+#
+# GetRaw
+#================================
+
+
+# ===============================
+# Setup our runtime constants
+# ===============================
+
+DEBUG=1 #Set this to "1" to see extra messages
+MESHVERSION=3 # If the export file doesn't work,
+FILEVERSION=3 # try changing these to "2"
+
+EVENT_PATHCHANGE= 1
+EVENT_IMPORT= 2
+EVENT_IMPORT_CONT= 3
+EVENT_OPTIONS= 4
+EVENT_EXPORT= 7
+EVENT_EXPORT_CHK= 5
+EVENT_EXPORT_CANCEL= 6
+EVENT_QUIT= 8
+EVENT_EXPORT_ERR= 9
+EVENT_TYPE= 10
+EVENT_DONE= 11
+EVENT_IMPORT_SELECT= 12
+
+# ===============================
+# Import our libraries
+# ===============================
+
+#import string
+#import os
+#import struct
+
+try:
+ import nt
+ os=nt
+ os.sep='\\'
+except:
+ import posix
+ os=posix
+ os.sep='/'
+
+def isdir(path):
+ try:
+ st = os.stat(path)
+ return 1
+ except:
+ return 0
+
+def split(pathname):
+ PATHNAME=pathname
+ PATHNAME=PATHNAME.replace('\\','/')
+ k0=PATHNAME.split('/')
+ directory=pathname.replace(k0[len(k0)-1],'')
+ Name=k0[len(k0)-1]
+ return directory, Name
+
+def join(l0,l1):
+ return l0+os.sep+l1
+
+os.isdir=isdir
+os.split=split
+os.join=join
+
+import math
+import Blender
+#import Blender210
+from Blender import *
+from Blender import NMesh
+from Blender.Draw import *
+from Blender.BGL import *
+from Blender import Material
+from Blender import Window
+
+
+
+# ===============================
+# Input Variables
+# ===============================
+
+Filename = "/Users/trevor/Desktop/something.obj"
+
+gFilename=Create(Filename)
+gAlert = 0
+type = 1
+exporttype = 1
+returncode = 0
+operation = "Export"
+center = [0,0,0]
+rotation = [0,0,0]
+Transform = []
+multiflag = 0
+
+#================================
+# def Fileselect function:
+#================================
+def ImportFunctionselet(filename):
+ global gFilename
+ global ExportOptions
+ global ExportType
+ global type
+ global exporttype
+ global operation
+ global gAlert
+ gFilename.val=filename
+ ImportFunction(filename, type)
+ operation = "Import"
+
+#================================
+def ExitGUI ():
+#================================
+ Exit()
+
+#================================
+def EventGUI (event):
+#================================
+ global gFilename
+ global ExportOptions
+ global ExportType
+ global type
+ global exporttype
+ global operation
+ global gAlert
+
+ if (event==EVENT_IMPORT):
+ ImportFunction(gFilename.val, type)
+ operation = "Import"
+
+ if (event==EVENT_IMPORT_SELECT):
+ Window.FileSelector (ImportFunctionselet, 'IMPORT FILE')
+
+
+ if (event==EVENT_IMPORT_CONT):
+ gAlert = 0
+ operation = "Import"
+ Draw ()
+
+ if (event==EVENT_EXPORT):
+ ExportFunction(gFilename.val, type)
+ operation = "Export"
+
+ if (event==EVENT_EXPORT_CHK):
+ ExportFunctionOK(gFilename.val, type)
+ Draw ()
+ if (event==EVENT_EXPORT_CANCEL):
+ gAlert = 0
+ Draw ()
+ if (event==EVENT_OPTIONS):
+ type = ExportOptions.val
+ Draw ()
+ if (event==EVENT_TYPE):
+ exporttype = ExportType.val
+ Draw ()
+ if (event==EVENT_EXPORT_ERR):
+ gAlert = 0
+ Draw ()
+ if (event==EVENT_DONE):
+ gAlert = 0
+ Draw ()
+ if (event==EVENT_QUIT):
+ ExitGUI()
+
+#================================
+def DrawGUI():
+#================================
+ global type
+ global exporttype
+ global operation
+
+ glClearColor (0.6,0.6,0.6,0)
+ glClear (GL_COLOR_BUFFER_BIT)
+
+ global gFilename
+ global gAlert
+ global ExportOptions
+ global ExportType
+
+ if (gAlert==0):
+ # Add in the copyright notice and title
+ glRasterPos2d(32, 380)
+ Text("Wavefront OBJ Importer/Exporter")
+ glRasterPos2d(32, 350)
+ Text("Copyright (C) Chris Lynch 2001")
+
+ gFilename=String ("Filename: ",EVENT_PATHCHANGE,32,250,320,32,gFilename.val,255,"Full pathname and filename")
+ Button ("Export",EVENT_EXPORT,32,200,100,32)
+ Button ("Import",EVENT_IMPORT,252,200,100,32)
+ Button ("Select Import",EVENT_IMPORT_SELECT,355,200,100,32)
+ glRasterPos2d(32, 165)
+ Text("Select Export Options:")
+ options = "Export Options %t| Default %x1| Material Layers %x2| Obj Groups %x3| Standard %x4"
+ ExportOptions = Menu (options,EVENT_OPTIONS,200,150,150,32, type)
+ Button ("Done",EVENT_QUIT,142,50,100,32)
+ glRasterPos2d(32, 115)
+ Text("Export using ")
+ options = "Export Type %t| Mesh Coordinates %x1| Object Coordinates %x2"
+ ExportType = Menu (options,EVENT_TYPE,170,100,180,32, exporttype)
+ Button ("Done",EVENT_QUIT,142,50,100,32)
+
+ elif (gAlert==1):
+ glRasterPos2i (32,250)
+ Text (gFilename.val+ " already exists. Save anyway?")
+ Button ("Save",EVENT_EXPORT_CHK,150,200,50,32)
+ Button ("Cancel",EVENT_EXPORT_CANCEL,250,200,50,32)
+ gAlert = 0
+ elif (gAlert==2):
+ glRasterPos2i (32,250)
+ Text (gFilename.val+ " cannot be found. Check directory and filename.")
+ Button ("Continue",EVENT_IMPORT_CONT,32,190,70,32)
+ gAlert = 0
+ elif gAlert == 3:
+ glRasterPos2i (32,250)
+ Text ("No objects selected to export. You must select one or more objects.")
+ Button ("Continue",EVENT_EXPORT_ERR,192,200,70,32)
+ gAlert = 0
+ elif gAlert == 5:
+ glRasterPos2i (32,250)
+ Text ("Invalid directory path.")
+ Button ("Continue",EVENT_EXPORT_ERR,192,200,70,32)
+ gAlert = 0
+ else:
+ glRasterPos2i (32,250)
+ Text (str(operation)+ " of " +str(gFilename.val)+ " done.")
+ Button ("Continue",EVENT_DONE,192,200,70,32)
+
+#================================
+def RegisterGUI ():
+#================================
+ Register (DrawGUI,None,EventGUI)
+
+#================================
+# MAIN SCRIPT
+#================================
+# Opens a file, writes data in it
+# and closes it up.
+#================================
+RegisterGUI()
+
+#================================
+def ImportFunction (importName, type):
+#================================
+ global gFilename
+ global gAlert
+
+ try:
+ FILE=open (importName,"r")
+ directory, Name = os.split(gFilename.val)
+ print directory, Name
+ words = Name.split(".")
+ Name = words[0]
+ ObjImport(FILE, Name, gFilename.val)
+ FILE.close()
+ gAlert = 4
+ Draw ()
+ except IOError:
+ gAlert=2
+ Draw ()
+
+#================================
+def ExportFunction (exportName, type):
+#================================
+ global gFilename
+ global gAlert
+
+ try:
+ FILE=open (exportName,"r")
+ FILE.close()
+ gAlert = 1
+ Draw ()
+ except IOError:
+
+ directory, Name = os.split(gFilename.val)
+
+
+ if os.isdir(directory):
+ ExportFunctionOK(exportName, type)
+ Draw ()
+ else:
+ gAlert = 5
+ Draw ()
+
+#================================
+def ExportFunctionOK (exportName, type):
+#================================
+ global gFilename
+ global gAlert
+ global returncode
+
+ FILE=open (exportName,"w")
+
+ directory, Name = os.split(gFilename.val)
+
+ words = Name.split(".")
+ Name = words[0]
+ ObjExport(FILE, Name, type)
+ if returncode > 0:
+ gAlert = 3
+ else:
+ gAlert = 4
+ FILE.flush()
+ FILE.close()
+
+#=========================
+def ObjImport(file, Name, filename):
+#=========================
+ vcount = 0
+ vncount = 0
+ vtcount = 0
+ fcount = 0
+ gcount = 0
+ setcount = 0
+ groupflag = 0
+ objectflag = 0
+ mtlflag = 0
+ baseindex = 0
+ basevtcount = 0
+ basevncount = 0
+ matindex = 0
+
+ pointList = []
+ uvList = []
+ normalList = []
+ faceList = []
+ materialList = []
+ imagelist = []
+
+ uv = []
+ lines = file.readlines()
+ linenumber = 1
+
+ for line in lines:
+ words = line.split()
+ if words and words[0] == "#":
+ pass # ignore comments
+ elif words and words[0] == "v":
+ vcount = vcount + 1
+
+ for n_ in [1,2,3]:
+ if words[n_].find(',')!=-1:
+ words[n_]=words[n_].replace(',','.')
+
+ x = float(words[1])
+ y = float(words[2])
+ z = float(words[3])
+
+ pointList.append([x, y, z])
+
+ elif words and words[0] == "vt":
+ vtcount = vtcount + 1
+ for n_ in [1,2]:
+ if words[n_].find(',')!=-1:
+ words[n_]=words[n_].replace(',','.')
+
+ u = float(words[1])
+ v = float(words[2])
+ uvList.append([u, v])
+
+ elif words and words[0] == "vn":
+ vncount = vncount + 1
+
+ for n_ in [1,2,3]:
+ if words[n_].find(',')!=-1:
+ words[n_]=words[n_].replace(',','.')
+
+ i = float(words[1])
+ j = float(words[2])
+ k = float(words[3])
+ normalList.append([i, j, k])
+
+ elif words and words[0] == "f":
+ fcount = fcount + 1
+ vi = [] # vertex indices
+ ti = [] # texture indices
+ ni = [] # normal indices
+ words = words[1:]
+ lcount = len(words)
+ for index in (xrange(lcount)):
+ if words[index].find( "/") == -1:
+ vindex = int(words[index])
+ if vindex < 0: vindex = baseindex + vindex + 1
+ vi.append(vindex)
+ else:
+ vtn = words[index].split( "/")
+ vindex = int(vtn[0])
+ if vindex < 0: vindex = baseindex + vindex + 1
+ vi.append(vindex)
+
+ if len(vtn) > 1 and vtn[1]:
+ tindex = int(vtn[1])
+ if tindex < 0: tindex = basevtcount +tindex + 1
+ ti.append(tindex)
+
+ if len(vtn) > 2 and vtn[2]:
+ nindex = int(vtn[2])
+ if nindex < 0: nindex = basevncount +nindex + 1
+ ni.append(nindex)
+ faceList.append([vi, ti, ni, matindex])
+
+ elif words and words[0] == "o":
+ ObjectName = words[1]
+ objectflag = 1
+ #print "Name is %s" % ObjectName
+
+ elif words and words[0] == "g":
+ groupflag = 1
+ index = len(words)
+ if objectflag == 0:
+ objectflag = 1
+ if index > 1:
+ ObjectName = words[1].join("_")
+ GroupName = words[1].join("_")
+ else:
+ ObjectName = "Default"
+ GroupName = "Default"
+ #print "Object name is %s" % ObjectName
+ #print "Group name is %s" % GroupName
+ else:
+ if index > 1:
+ GroupName = join(words[1],"_")
+ else:
+ GroupName = "Default"
+ #print "Group name is %s" % GroupName
+
+ if mtlflag == 0:
+ matindex = AddMeshMaterial(GroupName,materialList, matindex)
+ gcount = gcount + 1
+
+ if fcount > 0:
+ baseindex = vcount
+ basevncount = vncount
+ basevtcount = vtcount
+
+ elif words and words[0] == "mtllib":
+ # try to export materials
+ directory, dummy = os.split(filename)
+ filename = os.join(directory, words[1])
+ print "try to import : ",filename
+
+ try:
+ file = open(filename, "r")
+ except:
+ print "no material file %s" % filename
+ else:
+ mtlflag = 0
+ #file = open(filename, "r")
+ line = file.readline()
+ mtlflag = 1
+ while line:
+ words = line.split()
+ if words and words[0] == "newmtl":
+ name = words[1]
+ line = file.readline() # Ns ?
+ words = line.split()
+ while words[0] not in ["Ka","Kd","Ks","map_Kd"]:
+ line = file.readline()
+ words = line.split()
+
+ if words[0] == "Ka":
+ Ka = [float(words[1]),
+ float(words[2]),
+ float(words[3])]
+ line = file.readline() # Kd
+ words = line.split()
+
+ if words[0] == "Kd":
+ Kd = [float(words[1]),
+ float(words[2]),
+ float(words[3])]
+ line = file.readline() # Ks
+ words = line.split()
+
+ if words[0] == "Ks":
+ Ks = [float(words[1]),
+ float(words[2]),
+ float(words[3])]
+ line = file.readline() # Ks
+ words = line.split()
+
+ if words[0] == "map_Kd":
+ Kmap= words[1]
+ img=os.join(directory, Kmap)
+ im=Blender.Image.Load(img)
+ line = file.readline() # Ks
+ words = line.split()
+
+ matindex = AddGlobalMaterial(name, matindex)
+ matlist = Material.Get()
+
+ if len(matlist) > 0:
+ if name!='defaultMat':
+ material = matlist[matindex]
+ material.R = Kd[0]
+ material.G = Kd[1]
+ material.B = Kd[2]
+ try:
+ material.specCol[0] = Ks[0]
+ material.specCol[1] = Ks[1]
+ material.specCol[2] = Ks[2]
+ except:
+ pass
+ try:
+ alpha = 1 - ((Ka[0]+Ka[1]+Ka[2])/3)
+ except:
+ pass
+ try:
+ material.alpha = alpha
+ except:
+ pass
+
+ try:
+
+ img=os.join(directory, Kmap)
+ im=Blender.Image.Load(img)
+ imagelist.append(im)
+
+ t=Blender.Texture.New(Kmap)
+ t.setType('Image')
+ t.setImage(im)
+
+ material.setTexture(0,t)
+ material.getTextures()[0].texco=16
+ except:
+ pass
+
+ else:
+ material = matlist[matindex]
+
+ material.R = 0.8
+ material.G = 0.8
+ material.B = 0.8
+ material.specCol[0] = 0.5
+ material.specCol[1] = 0.5
+ material.specCol[2] = 0.5
+
+ img=os.join(directory, Kmap)
+ im=Blender.Image.Load(img)
+ imagelist.append(im)
+
+ t=Blender.Texture.New(Kmap)
+ t.setType('Image')
+ t.setImage(im)
+
+ material.setTexture(0,t)
+ material.getTextures()[0].texco=16
+
+ else:
+ mtlflag = 0
+
+ line = file.readline()
+
+
+ file.close()
+
+ elif words and words[0] == "usemtl":
+ if mtlflag == 1:
+ name = words[1]
+ matindex = AddMeshMaterial(name, materialList, matindex)
+ elif words:
+ print "%s: %s" % (linenumber, words)
+ linenumber = linenumber + 1
+ file.close()
+
+ # import in Blender
+
+ print "import into Blender ..."
+ mesh = NMesh.GetRaw ()
+
+ i = 0
+ while i < vcount:
+ x, y, z = pointList[i]
+ vert=NMesh.Vert(x, y, z)
+ mesh.verts.append(vert)
+ i=i+1
+
+ if vtcount > 0:
+ #mesh.hasFaceUV() = 1
+ print ("Object has uv coordinates")
+
+ if len(materialList) > 0:
+ for m in materialList:
+ try:
+ M=Material.Get(m)
+ mesh.materials.append(M)
+ except:
+ pass
+
+ total = len(faceList)
+ i = 0
+
+ for f in faceList:
+ if i%1000 == 0:
+ print ("Progress = "+ str(i)+"/"+ str(total))
+
+ i = i + 1
+ vi, ti, ni, matindex = f
+ face=NMesh.Face()
+ if len(materialList) > 0:
+ face.mat = matindex
+
+ limit = len(vi)
+ setcount = setcount + len(vi)
+ c = 0
+
+ while c < limit:
+ m = vi[c]-1
+ if vtcount > 0 and len(ti) > c:
+ n = ti[c]-1
+ if vncount > 0 and len(ni) > c:
+ p = ni[c]-1
+
+ if vtcount > 0:
+ try:
+ u, v = uvList[n]
+ except:
+ pass
+
+ """
+ # multiply uv coordinates by 2 and add 1. Apparently blender uses uv range of 1 to 3 (not 0 to 1).
+ mesh.verts[m].uvco[0] = (u*2)+1
+ mesh.verts[m].uvco[1] = (v*2)+1
+ """
+
+ if vncount > 0:
+ if p > len(normalList):
+ print("normal len = " +str(len(normalList))+ " vector len = " +str(len(pointList)))
+ print("p = " +str(p))
+ x, y, z = normalList[p]
+ mesh.verts[m].no[0] = x
+ mesh.verts[m].no[1] = y
+ mesh.verts[m].no[2] = z
+ c = c+1
+
+ if len(vi) < 5:
+ for index in vi:
+ face.v.append (mesh.verts[index-1])
+
+ if vtcount > 0:
+ for index in ti:
+ u, v = uvList[index-1]
+ face.uv.append((u,v))
+
+ if len(imagelist)>0:
+ face.image=imagelist[0]
+ #print
+
+ if vcount>0:
+ face.smooth=1
+
+ mesh.faces.append(face)
+
+ print "all other (general) polygons ..."
+ for f in faceList:
+ vi, ti, ni, matindex = f
+ if len(vi) > 4:
+ # export the polygon as edges
+ print ("Odd face, vertices = "+ str(len(vi)))
+ for i in range(len(vi)-2):
+ face = NMesh.Face()
+ if len(materialList) > 0:
+ face.mat = matindex
+ face.v.append(mesh.verts[vi[0]-1])
+ face.v.append(mesh.verts[vi[i+1]-1])
+ face.v.append(mesh.verts[vi[i+2]-1])
+
+ if vtcount > 0:
+ if len(ti) > i+2:
+ u, v = uvList[ti[0]-1]
+ face.uv.append((u,v))
+ u, v = uvList[ti[i+1]-1]
+ face.uv.append((u,v))
+ u, v = uvList[ti[i+2]-1]
+ face.uv.append((u,v))
+
+ mesh.faces.append(face)
+
+ NMesh.PutRaw(mesh, Name,1)
+
+ print ("Total number of vertices is "+ str(vcount))
+ print ("Total number of faces is "+ str(len(faceList)))
+ print ("Total number of sets is "+ str(setcount))
+
+
+ print("Finished importing " +str(Name)+ ".obj")
+
+#=========================================
+def AddMeshMaterial(name, materialList, matindex):
+#=========================================
+
+ index = 0
+ found = 0
+ limit = len(materialList)
+
+ while index < limit:
+ if materialList[index] == name:
+ matindex = index
+ found = 1
+ index = limit
+ index = index + 1
+
+ if found == 0:
+ materialList.append(name)
+ matindex = len(materialList)-1
+
+ return matindex
+
+#=========================================
+def AddGlobalMaterial (name, matindex):
+#=========================================
+
+ index = 0
+ found = 0
+ matindex = 0
+ MatList = Material.Get()
+ limit = len(MatList)
+
+ while index < limit:
+ if MatList[index].name == name:
+ matindex = index
+ found = 1
+ index = limit
+ index = index + 1
+
+ if found == 0:
+ material = Material.New(name)
+ matindex = index
+
+ return matindex
+
+#================================
+def ObjExport(FILE, Name, type):
+#================================
+ global returncode
+ global vertexcount
+ global uvcount
+ global Transform
+ global multiflag
+ global exporttype
+
+ vertexcount = 0
+ uvcount = 0
+ returncode = 0
+ print("Writing %s..." % Name)
+ FILE.write("# Wavefront OBJ (1.0) exported by lynx's OBJ import/export script\n\n")
+
+ Objects = Object.GetSelected()
+ if Objects == []:
+ print("You have not selected an object!")
+ returncode = 4
+ else:
+ for object in Objects:
+ MtlList = []
+ if len(Objects) > 1 or exporttype > 1:
+ Transform = CreateMatrix(object, Transform)
+ multiflag = 1
+
+ mesh = NMesh.GetRawFromObject(object.name)
+ ObjName = mesh.name
+ has_uvco = mesh.hasVertexUV()
+
+ FILE.write("# Meshname:\t%s\n" % ObjName)
+
+ faces = mesh.faces
+ materials = mesh.materials
+ Vertices = mesh.verts
+ GlobalMaterials = Material.Get()
+
+ if len(materials) >= 1 and len(GlobalMaterials) > 0 and type < 4:
+ CreateMtlFile(Name, materials, MtlList)
+
+ # Total Vertices and faces; comment if not useful
+ FILE.write("# Total number of Faces:\t%s\n" % len(faces))
+ FILE.write("# Total number of Vertices:\t%s\n" % len(Vertices))
+
+ FILE.write("\n")
+
+ # print first image map for uvcoords to use
+ # to be updated when we get access to other textures
+ if mesh.hasFaceUV(): FILE.write("# UV Texture:\t%s\n\n" % mesh.hasFaceUV())
+
+ if len(materials) >= 1 and len(GlobalMaterials) > 0 and type < 3:
+ UseLayers(faces, Vertices, MtlList, has_uvco, FILE, ObjName, Name)
+ elif len(materials) >= 1 and len(GlobalMaterials) > 0 and type == 3:
+ UseMtl(faces, Vertices, MtlList, has_uvco, FILE, ObjName, Name)
+ else:
+ Standard(faces, Vertices, has_uvco, FILE, ObjName)
+
+#================================================
+def CreateMtlFile (name, MeshMaterials, MtlList):
+#================================================
+ global gFilename
+
+ # try to export materials
+ directory, mtlname = os.split(gFilename.val)
+ mtlname = name + ".mtl"
+ filename = os.join(directory, mtlname)
+ file = open(filename, "w")
+
+ file.write("# Materials for %s.\n" % (name + ".obj"))
+ file.write("# Created by Blender.\n")
+ file.write("# These files must be in the same directory for the materials to be read correctly.\n\n")
+
+ MatList = Material.Get()
+ print str(MeshMaterials)
+
+ MtlNList=[]
+ for m in MatList:
+ MtlNList.append(m.name)
+
+ counter = 1
+ found = 0
+
+ for material in MeshMaterials:
+ for mtl in MtlList:
+ if material == mtl:
+ found = 1
+
+ MtlList.append(material)
+
+ if found == 0:
+ file.write("newmtl %s \n" % material.name)
+ index = 0
+ print material, MatList
+ while index < len(MatList):
+ if material.name == MatList[index].name:
+ mtl = MatList[index]
+ index = len(MatList)
+ found = 1
+ index = index + 1
+
+ if found == 1:
+ alpha = mtl.getAlpha()
+ file.write(" Ka %s %s %s \n" % (round(1-alpha,5), round(1-alpha,5), round(1-alpha,5)))
+ file.write(" Kd %s %s %s \n" % (round(mtl.R,5), round(mtl.G,5), round(mtl.B,5)))
+ file.write(" Ks %s %s %s \n" % (round(mtl.specCol[0],5), round(mtl.specCol[1],5), round(mtl.specCol[2],5)))
+ mtextures = mtl.getTextures() # get a list of the MTex objects
+ #try:
+ #for mtex in mtextures:
+ # if mtex.tex.type == Texture.Types.IMAGE and (mtex.texco & Texture.TexCo.UV):
+ # file.write(" map_Kd %s \n" % Blender.sys.basename(mtex[0].tex.image.filename))
+ # break
+ #except:
+ # if mtextures[0].tex.type == Texture.Types.IMAGE and (mtextures[0].texco & Texture.TexCo.UV):
+ # file.write(" map_Kd %s \n" % Blender.sys.basename(mtextures[0].tex.image.filename))
+
+
+ file.write(" illum 1\n")
+
+ else:
+ file.write(" Ka %s %s %s \n" % (0, 0, 0))
+ file.write(" Kd %s %s %s \n" % (1, 1, 1))
+ file.write(" Ks %s %s %s \n" % (1, 1, 1))
+ file.write(" illum 1\n")
+
+ found = 0
+
+ file.flush()
+ file.close()
+
+#===========================================================
+def Standard(faces, Vertices, has_uvco, FILE, ObjName):
+#===========================================================
+ global vertexcount
+ global uvcount
+ global multiflag
+
+ uvPtrs = []
+ uvList = []
+
+ FILE.write("o %s\n\n" % (ObjName))
+ FILE.write("g %s\n\n" % (ObjName))
+
+ for v in Vertices:
+ vert = v.co
+ if multiflag == 1:
+ vert = Alter(vert, Transform)
+ x, y, z = vert
+
+ FILE.write("v %s %s %s\n" % (x, y, z))
+
+ uv_flag = 0
+ for face in faces:
+ for uv in face.uv:
+ found = 0
+ index = len(uvList)
+ limit = 0
+ if len(uvList)-200 > 0:
+ limit = len(uvList)-200
+ while index > limit and found == 0:
+ uv_value = uvList[index-1]
+ if uv[0] == uv_value[0] and uv[1] == uv_value[1]:
+ uvPtrs.append(index+uvcount)
+ found = 1
+ index = index - 1
+ if found == 0:
+ uvList.append(uv)
+ index = len(uvList)
+ uvPtrs.append(index+uvcount)
+ u, v = uv
+ FILE.write("vt %s %s\n" % (u, v))
+ uv_flag = 1
+
+ if has_uvco and uv_flag == 0:
+ for v in Vertices:
+ u, v, z = v.uvco
+ u = (u-1)/2
+ v = (v-1)/2
+ FILE.write("vt %s %s\n" % (u, v))
+
+ for v in Vertices:
+ x, y, z = v.no
+ FILE.write("vn %s %s %s\n" % (x, y, z))
+
+ p = 0
+ uvindex = 0
+ total = len(faces)
+
+ for face in faces:
+ p = p+1
+ if (p%1000) == 0:
+ print ("Progress = "+ str(p)+ " of "+ str(total) +" faces")
+
+ FILE.write("f ")
+ for index in range(len(face.v)):
+ v = face.v[index].index + vertexcount
+ if len(face.uv) > 0:
+ FILE.write("%s/%s/%s " % (v+1, uvPtrs[uvindex], v+1))
+ uvindex = uvindex+1
+ elif has_uvco:
+ FILE.write("%s/%s/%s " % (v+1, v+1, v+1))
+ else:
+ FILE.write("%s//%s " % (v+1, v+1))
+ FILE.write("\n")
+
+ vertexcount = vertexcount + len(Vertices)
+ uvcount = uvcount + len(uvList)
+
+ print("Export of " +str(ObjName)+ ".obj finished.\n")
+
+#=====================================================================
+def UseLayers(faces, Vertices, MtlList, has_uvco, FILE, ObjName, Name):
+#=====================================================================
+ global vertexcount
+ global uvcount
+ global multiflag
+
+ uvPtrs = []
+ uvList = []
+
+ FILE.write("mtllib %s\n\n" % (Name + ".mtl"))
+ FILE.write("g %s\n\n" % (ObjName))
+
+ for v in Vertices:
+ vert = v.co
+ if multiflag == 1:
+ vert = Alter(vert, Transform)
+ x, y, z = vert
+ FILE.write("v %s %s %s\n" % (x, y, z))
+
+ uv_flag = 0
+ for m in range(len(MtlList)):
+ for face in faces:
+ if face.mat == m:
+ for uv in face.uv:
+ found = 0
+ index = len(uvList)
+ limit = 0
+ if len(uvList)-200 > 0:
+ limit = len(uvList)-200
+ while index > limit and found == 0:
+ uv_value = uvList[index-1]
+ if uv[0] == uv_value[0] and uv[1] == uv_value[1]:
+ uvPtrs.append(index+uvcount)
+ found = 1
+ index = index - 1
+ if found == 0:
+ uvList.append(uv)
+ index = len(uvList)
+ uvPtrs.append(index+uvcount)
+ u, v = uv
+ FILE.write("vt %s %s\n" % (u, v))
+ uv_flag = 1
+
+ if has_uvco and uv_flag == 0:
+ for v in Vertices:
+ u, v, z = v.uvco
+ u = (u-1)/2
+ v = (v-1)/2
+ FILE.write("vt %s %s\n" % (u, v))
+
+ for v in Vertices:
+ x, y, z = v.no
+ FILE.write("vn %s %s %s\n" % (x, y, z))
+
+ total = len(faces)
+ p = 0
+ uvindex = 0
+ for m in range(len(MtlList)):
+ FILE.write("usemtl %s\n" % (MtlList[m].name))
+ for face in faces:
+ if face.mat == m:
+ p = p+1
+ if (p%1000) == 0:
+ print ("Progress = "+ str(p)+ " of "+ str(total) +" faces")
+
+ FILE.write("f ")
+ for index in range(len(face.v)):
+ v = face.v[index].index + vertexcount
+ if len(face.uv) > 0:
+ FILE.write("%s/%s/%s " % (v+1, uvPtrs[uvindex], v+1))
+ uvindex = uvindex+1
+ elif has_uvco:
+ FILE.write("%s/%s/%s " % (v+1, v+1, v+1))
+ else:
+ FILE.write("%s//%s " % (v+1, v+1))
+ FILE.write("\n")
+
+ vertexcount = vertexcount + len(Vertices)
+ print("Export of " +str(ObjName)+ ".obj using material layers finished.\n")
+
+#==================================================================
+def UseMtl(faces, Vertices, MtlList, has_uvco, FILE, ObjName, Name):
+#==================================================================
+ global vertexcount
+ global multiflag
+
+ FILE.write("mtllib %s\n\n" % (Name + ".mtl"))
+ FILE.write("o %s\n\n" % (ObjName))
+
+ index = 0
+ VertexList = []
+ for vertex in Vertices:
+ VertexList.append(-1)
+ index = index + 1
+ print("number of vertices is " +str(len(VertexList)))
+
+ Totalindex = 0
+ ix = 0
+ NewVertexList = []
+ NewVertexCo = []
+ for m in range(len(MtlList)):
+ # Group name is the name of the mesh
+ if MtlList[m]:
+ FILE.write("g %s\n" % (MtlList[m].name+str(m+1)))
+ else:
+ FILE.write("g %s\n" % ("Null"+str(m+1)))
+ FILE.write("s off\n\n")
+
+ FILE.write("usemtl %s\n\n" % (MtlList[m].name))
+
+ for face in faces:
+ if face.mat == m:
+ for vertex in face.v:
+ v = vertex.index
+ if VertexList[v] < 0:
+ VertexList[v] = Totalindex
+ NewVertexList.append(v)
+ Totalindex = Totalindex + 1
+
+ for v_old in NewVertexList:
+ vert = Vertices[v_old].co
+ if multiflag == 1:
+ vert = Alter(vert, Transform)
+ x, y, z = vert
+ FILE.write("v %s %s %s\n" % (x, y, z))
+ NewVertexCo.append([x,y,z])
+
+ if has_uvco:
+ for v_old in NewVertexList:
+ u, v, z = Vertices[v_old].uvco
+ u = (u-1)/2
+ v = (v-1)/2
+ FILE.write("vt %s %s\n" % (u, v))
+
+ for v_old in NewVertexList:
+ x, y, z = Vertices[v_old].no
+ FILE.write("vn %s %s %s\n" % (x, y, z))
+
+ for face in faces:
+ if face.mat == m:
+ FILE.write("f ")
+ for index in range(len(face.v)):
+ v = face.v[index].index
+ v_new = VertexList[v]
+ if has_uvco:
+ FILE.write("%s/%s/%s " % (v_new+1, v_new+1, v_new+1))
+ else:
+ FILE.write("%s//%s " % (v_new+1, v_new+1))
+ FILE.write("\n")
+
+ FILE.write("\n")
+
+ NewVertexList = []
+ print("Group " +str(m+1)+ " of " +str(len(MtlList))+ " finished.")
+
+ print("Export of " +str(ObjName)+ ".obj using groups finished.\n")
+
+#========================================
+def CreateMatrix(object, Transform):
+#========================================
+ Mx = []
+ My = []
+ Mz = []
+ T1 = []
+ Transform = []
+
+ angle = object.RotX
+ Mx.append([1, 0, 0])
+ y = math.cos(angle)
+ z = -math.sin(angle)
+ Mx.append([0, y, z])
+ y = math.sin(angle)
+ z = math.cos(angle)
+ Mx.append([0, y, z])
+
+ angle = object.RotY
+ x = math.cos(angle)
+ z = math.sin(angle)
+ My.append([x, 0, z])
+ My.append([0, 1, 0])
+ x = -math.sin(angle)
+ z = math.cos(angle)
+ My.append([x, 0, z])
+
+ angle = object.RotZ
+ x = math.cos(angle)
+ y = -math.sin(angle)
+ Mz.append([x, y, 0])
+ x = math.sin(angle)
+ y = math.cos(angle)
+ Mz.append([x, y, 0])
+ Mz.append([0, 0, 1])
+
+ m0 = Mx[0]
+ m1 = Mx[1]
+ m2 = Mx[2]
+ for row in My:
+ x, y, z = row
+ nx = x*m0[0] + y*m1[0] + z*m2[0]
+ ny = x*m0[1] + y*m1[1] + z*m2[1]
+ nz = x*m0[2] + y*m1[2] + z*m2[2]
+ T1.append([nx, ny, nz])
+
+ m0 = T1[0]
+ m1 = T1[1]
+ m2 = T1[2]
+ for row in Mz:
+ x, y, z = row
+ nx = x*m0[0] + y*m1[0] + z*m2[0]
+ ny = x*m0[1] + y*m1[1] + z*m2[1]
+ nz = x*m0[2] + y*m1[2] + z*m2[2]
+ Transform.append([nx, ny, nz])
+
+ Transform.append([object.SizeX, object.SizeY, object.SizeZ])
+ Transform.append([object.LocX, object.LocY, object.LocZ])
+
+ return Transform
+
+#======================================
+def Alter(vect, Transform):
+#======================================
+ v2 = []
+ nv = []
+
+ x, y, z = vect
+ sx, sy, sz = Transform[3]
+ lx, ly, lz = Transform[4]
+
+ v2.append(x*sx)
+ v2.append(y*sy)
+ v2.append(z*sz)
+
+ for index in range(len(vect)):
+ t = Transform[index]
+ nv.append(v2[0]*t[0] + v2[1]*t[1] +v2[2]*t[2])
+
+ nv[0] = nv[0]+lx
+ nv[1] = nv[1]+ly
+ nv[2] = nv[2]+lz
+
+ return nv
\ No newline at end of file
Added: maven/trunk/ogoglio/src/main/resources/blender/ogoglio_avatar.py
===================================================================
--- maven/trunk/ogoglio/src/main/resources/blender/ogoglio_avatar.py (rev 0)
+++ maven/trunk/ogoglio/src/main/resources/blender/ogoglio_avatar.py 2007-09-24 21:26:54 UTC (rev 438)
@@ -0,0 +1,691 @@
+#!BPY
+
+"""
+Name: 'Ogoglio Avatar (.obj, .mlt, .smap)...'
+Blender: 243
+Group: 'Export'
+Tooltip: 'Save As Ogoglio Avatar files'
+"""
+
+__author__ = "Campbell Barton, Jiri Hnidek (modded by Trevor F. Smith)"
+__url__ = ['www.blender.org', 'blenderartists.org', 'ogoglio.com']
+__version__ = "1.0"
+
+__bpydoc__ = """\
+This script is an avatar exporter to OBJ and SMAP file formats.
+
+Usage:
+
+Select the objects you wish to export and run this script from "File->Export" menu.
+Selecting the default options from the popup box will be good in most cases.
+All objects that can be represented as a mesh (mesh, curve, metaball, surface, text3d)
+will be exported as mesh data.
+"""
+
+
+# --------------------------------------------------------------------------
+# OBJ Export v1.1 by Campbell Barton (AKA Ideasman)
+# --------------------------------------------------------------------------
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# ***** END GPL LICENCE BLOCK *****
+# --------------------------------------------------------------------------
+
+
+import Blender
+from Blender import Mesh, Scene, Window, sys, Image, Draw
+import BPyMesh
+import BPyObject
+
+import BPyMessages
+
+# Returns a tuple - path,extension.
+# 'hello.obj' > ('hello', '.obj')
+def splitExt(path):
+ dotidx = path.rfind('.')
+ if dotidx == -1:
+ return path, ''
+ else:
+ return path[:dotidx], path[dotidx:]
+
+def fixName(name):
+ if name == None:
+ return 'None'
+ else:
+ return name.replace(' ', '_')
+
+# Used to add the scene name into the filename without using odd chars
+def saneFilechars(name):
+ for ch in ' /\\~!@#$%^&*()+=[];\':",./<>?\t\r\n':
+ name = name.replace(ch, '_')
+ return name
+
+global MTL_DICT
+
+# A Dict of Materials
+# (material.name, image.name):matname_imagename # matname_imagename has gaps removed.
+MTL_DICT = {}
+
+def write_mtl(filename):
+ global MTL_DICT
+
+ world = Blender.World.GetCurrent()
+ if world:
+ worldAmb = world.getAmb()
+ else:
+ worldAmb = (0,0,0) # Default value
+
+ file = open(filename, "w")
+ file.write('# Blender3D MTL File: %s\n' % Blender.Get('filename').split('\\')[-1].split('/')[-1])
+ file.write('# Material Count: %i\n' % len(MTL_DICT))
+ # Write material/image combinations we have used.
+ for key, mtl_mat_name in MTL_DICT.iteritems():
+
+ # Get the Blender data for the material and the image.
+ # Having an image named None will make a bug, dont do it :)
+
+ file.write('newmtl %s\n' % mtl_mat_name) # Define a new material: matname_imgname
+
+ if key[0] == None:
+ #write a dummy material here?
+ file.write('Ns 0\n')
+ file.write('Ka %.6f %.6f %.6f\n' % tuple([c for c in worldAmb]) ) # Ambient, uses mirror colour,
+ file.write('Kd 0.8 0.8 0.8\n')
+ file.write('Ks 0.8 0.8 0.8\n')
+ file.write('d 1\n') # No alpha
+ file.write('illum 2\n') # light normaly
+ else:
+ mat = Blender.Material.Get(key[0])
+ file.write('Ns %.6f\n' % ((mat.getHardness()-1) * 1.9607843137254901) ) # Hardness, convert blenders 1-511 to MTL's
+ file.write('Ka %.6f %.6f %.6f\n' % tuple([c*mat.amb for c in worldAmb]) ) # Ambient, uses mirror colour,
+ file.write('Kd %.6f %.6f %.6f\n' % tuple([c*mat.ref for c in mat.rgbCol]) ) # Diffuse
+ file.write('Ks %.6f %.6f %.6f\n' % tuple([c*mat.spec for c in mat.specCol]) ) # Specular
+ file.write('Ni %.6f\n' % mat.IOR) # Refraction index
+ file.write('d %.6f\n' % mat.alpha) # Alpha (obj uses 'd' for dissolve)
+
+ # 0 to disable lighting, 1 for ambient & diffuse only (specular color set to black), 2 for full lighting.
+ if mat.getMode() & Blender.Material.Modes['SHADELESS']:
+ file.write('illum 0\n') # ignore lighting
+ elif mat.getSpec() == 0:
+ file.write('illum 1\n') # no specular.
+ else:
+ file.write('illum 2\n') # light normaly
+
+
+ # Write images!
+ if key[1] != None: # We have an image on the face!
+ img = Image.Get(key[1])
+ file.write('map_Kd %s\n' % img.filename.split('\\')[-1].split('/')[-1]) # Diffuse mapping image
+
+ elif key[0] != None: # No face image. if we havea material search for MTex image.
+ for mtex in mat.getTextures():
+ if mtex and mtex.tex.type == Blender.Texture.Types.IMAGE:
+ try:
+ filename = mtex.tex.image.filename.split('\\')[-1].split('/')[-1]
+ file.write('map_Kd %s\n' % filename) # Diffuse mapping image
+ break
+ except:
+ # Texture has no image though its an image type, best ignore.
+ pass
+
+ file.write('\n\n')
+
+ file.close()
+
+def copy_file(source, dest):
+ file = open(source, 'rb')
+ data = file.read()
+ file.close()
+
+ file = open(dest, 'wb')
+ file.write(data)
+ file.close()
+
+
+def copy_images(dest_dir):
+ if dest_dir[-1] != sys.sep:
+ dest_dir += sys.sep
+
+ # Get unique image names
+ uniqueImages = {}
+ for matname, imagename in MTL_DICT.iterkeys(): # Only use image name
+ # Get Texface images
+ if imagename != None:
+ uniqueImages[imagename] = None # Should use sets here. wait until Python 2.4 is default.
+
+ # Get MTex images
+ if matname != None:
+ mat= Material.Get(matname)
+ for mtex in mat.getTextures():
+ if mtex and mtex.tex.type == Blender.Texture.Types.IMAGE:
+ try:
+ uniqueImages[mtex.tex.image.name] = None
+ except:
+ pass
+
+ # Now copy images
+ copyCount = 0
+
+ for imageName in uniqueImages.iterkeys():
+ bImage = Image.Get(imageName)
+ image_path = sys.expandpath(bImage.filename)
+ if sys.exists(image_path):
+ # Make a name for the target path.
+ dest_image_path = dest_dir + image_path.split('\\')[-1].split('/')[-1]
+ if not sys.exists(dest_image_path): # Image isnt alredy there
+ print '\tCopying "%s" > "%s"' % (image_path, dest_image_path)
+ copy_file(image_path, dest_image_path)
+ copyCount+=1
+ print '\tCopied %d images' % copyCount
+
+def veckey3d(v):
+ return round(v.x, 6), round(v.y, 6), round(v.z, 6)
+
+def veckey2d(v):
+ return round(v.x, 6), round(v.y, 6)
+
+def write(filename, objects,\
+EXPORT_TRI=False, EXPORT_EDGES=False, EXPORT_NORMALS=False, EXPORT_NORMALS_HQ=False,\
+EXPORT_UV=True, EXPORT_MTL=True, EXPORT_COPY_IMAGES=False,\
+EXPORT_APPLY_MODIFIERS=True, EXPORT_ROTX90=True, EXPORT_BLEN_OBS=True,\
+EXPORT_GROUP_BY_OB=False, EXPORT_GROUP_BY_MAT=False, EXPORT_MORPH_TARGET=False):
+ '''
+ Basic write function. The context and options must be alredy set
+ This can be accessed externaly
+ eg.
+ write( 'c:\\test\\foobar.obj', Blender.Object.GetSelected() ) # Using default options.
+ '''
+ print 'OBJ Export path: "%s"' % filename
+ global MTL_DICT
+ temp_mesh_name = '~tmp-mesh'
+
+ time1 = sys.time()
+ scn = Scene.GetCurrent()
+
+ file = open(filename, "w")
+
+ # Write Header
+ file.write('# Blender3D v%s OBJ File: %s\n' % (Blender.Get('version'), Blender.Get('filename').split('/')[-1].split('\\')[-1] ))
+ file.write('# www.blender3d.org\n')
+
+ # Tell the obj file what material file to use.
+ if EXPORT_MTL:
+ mtlfilename = '%s.mtl' % '.'.join(filename.split('.')[:-1])
+ file.write('mtllib %s\n' % ( mtlfilename.split('\\')[-1].split('/')[-1] ))
+
+ # Get the container mesh. - used for applying modifiers and non mesh objects.
+ containerMesh = meshName = tempMesh = None
+
+ for meshName in Blender.NMesh.GetNames():
+ if meshName.startswith(temp_mesh_name):
+ tempMesh = Mesh.Get(meshName)
+ if not tempMesh.users:
+ containerMesh = tempMesh
+ if not containerMesh:
+ containerMesh = Mesh.New(temp_mesh_name)
+
+ if EXPORT_ROTX90:
+ mat_xrot90= Blender.Mathutils.RotationMatrix(-90, 4, 'x')
+
+ del meshName
+ del tempMesh
+
+ # Initialize totals, these are updated each object
+ totverts = totuvco = totno = 1
+
+ face_vert_index = 1 # used for uvs now
+
+ globalNormals = {}
+
+ # Get all meshs
+ for ob_main in objects:
+ for ob, ob_mat in BPyObject.getDerivedObjects(ob_main):
+ # Will work for non meshes now! :)
+ # getMeshFromObject(ob, container_mesh=None, apply_modifiers=True, vgroups=True, scn=None)
+ me= BPyMesh.getMeshFromObject(ob, containerMesh, EXPORT_APPLY_MODIFIERS, True, scn)
+ if not me:
+ continue
+
+ faceuv= me.faceUV
+
+ # We have a valid mesh
+ if EXPORT_TRI and me.faces:
+ # Add a dummy object to it.
+ has_quads = False
+ for f in me.faces:
+ if len(f) == 4:
+ has_quads = True
+ break
+
+ if has_quads:
+ oldmode = Mesh.Mode()
+ Mesh.Mode(Mesh.SelectModes['FACE'])
+
+ me.sel = True
+ tempob = scn.objects.new(me)
+ me.quadToTriangle(0) #...
[truncated message content] |
|
From: <ian...@us...> - 2007-09-24 19:01:28
|
Revision: 437
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=437&view=rev
Author: iansmith
Date: 2007-09-24 12:01:30 -0700 (Mon, 24 Sep 2007)
Log Message:
-----------
Added support for having sim run on a different machine.
Modified Paths:
--------------
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/AppletTestWindow.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceInitializationPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SimPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/Sim.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java
maven/trunk/ogoglio-server/src/main/webapp/META-INF/context.xml
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/persist/test/PersistTest.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-09-24 18:34:16 UTC (rev 436)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java 2007-09-24 19:01:30 UTC (rev 437)
@@ -224,7 +224,7 @@
outputStream.flush();
outputStream.close();
}
-
+ System.out.println("FART ABOUT TOSET STATUS:"+connection.getResponseCode());
response.setStatus(connection.getResponseCode());
Map headers = connection.getHeaderFields();
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-09-24 18:34:16 UTC (rev 436)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/AppletTestWindow.java 2007-09-24 19:01:30 UTC (rev 437)
@@ -21,7 +21,6 @@
import java.awt.Frame;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
-import java.lang.management.ManagementFactory;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
@@ -34,7 +33,6 @@
import com.ogoglio.util.ArgumentUtils;
import com.ogoglio.util.PropStorage;
import com.ogoglio.viewer.applet.ViewerApplet;
-import com.sun.tools.javac.util.List;
public class AppletTestWindow extends Frame {
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java 2007-09-24 18:34:16 UTC (rev 436)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java 2007-09-24 19:01:30 UTC (rev 437)
@@ -59,7 +59,6 @@
ServiceInitializationPersistTasks.initializeBootstrapAccount(sessionFactory, uri.getHost(), userList[i], pwList[i], cookiesList[i]);
}
- ServiceInitializationPersistTasks.initializeLocalSim(uri, sessionFactory);
ServiceInitializationPersistTasks.initializeServiceState(sessionFactory);
return true;
} catch (Exception e) {
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceInitializationPersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceInitializationPersistTasks.java 2007-09-24 18:34:16 UTC (rev 436)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceInitializationPersistTasks.java 2007-09-24 19:01:30 UTC (rev 437)
@@ -29,7 +29,7 @@
public static final String DEFAULT_DOOR_DISPLAY_NAME = "Default Door";
- public static void initializeLocalSim(URI serviceURI, SessionFactory sessionFactory) throws PersistException {
+ public static void DEAD_CODE_initializeLocalSim(URI serviceURI, SessionFactory sessionFactory) throws PersistException {
SimRecord[] simRecords = SimPersistTasks.findSims(sessionFactory);
URI ourURI=WebAPIUtil.appendToURI(serviceURI, "sim/");
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SimPersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SimPersistTasks.java 2007-09-24 18:34:16 UTC (rev 436)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SimPersistTasks.java 2007-09-24 19:01:30 UTC (rev 437)
@@ -25,8 +25,11 @@
public class SimPersistTasks {
public static final String SIM_BY_URI = "com.ogoglio.persist.simByURI";
+
public static final String SIM_BY_ID = "com.ogoglio.persist.simBySimID";
+
public static final String SIMS_BY_ACTIVE = "com.ogoglio.persist.simsByActive";
+
public static final String SIMS = "com.ogoglio.persist.sims";
public static SimRecord[] findSims(SessionFactory sessionFactory) throws PersistException {
@@ -40,7 +43,6 @@
return (SimRecord[]) task.execute();
}
-
public static SimRecord findSimsBySimURI(final URI simURI, SessionFactory sessionFactory) throws PersistException {
HibernateTask task = new HibernateTask() {
public Object run(Session hibernateSession) {
@@ -76,7 +78,6 @@
task.execute();
}
-
public static void delete(final SimRecord simRecord, SessionFactory sessionFactory) throws PersistException {
HibernateTask task = new HibernateTask() {
public Object run(Session hibernateSession) {
@@ -87,4 +88,16 @@
task.setSessionFactory(sessionFactory);
task.execute();
}
+
+ public static SimRecord findSimByID(final long simID, SessionFactory sessionFactory) throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session hibernateSession) {
+ Query query = hibernateSession.getNamedQuery(SIM_BY_ID);
+ query.setLong("simID", simID);
+ return query.uniqueResult();
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return (SimRecord) task.execute();
+ }
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/Sim.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/Sim.java 2007-09-24 18:34:16 UTC (rev 436)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/Sim.java 2007-09-24 19:01:30 UTC (rev 437)
@@ -272,7 +272,7 @@
simulator = new SpaceSimulator(spaceDoc, spaceSimulatorListener);
spaceSimulators.put(new Long(record.getSpaceID()), simulator);
simulator.startSim();
- Log.info("Starting space sim " + record.getSpaceID() + ": " + record.getDisplayName());
+ Log.info("Starting space sim " + record.getSpaceID() + ": " + record.getDisplayName() + "( on sim "+ record.getSimID()+")");
return simulator;
}
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java 2007-09-24 18:34:16 UTC (rev 436)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java 2007-09-24 19:01:30 UTC (rev 437)
@@ -21,6 +21,8 @@
import java.util.HashMap;
import java.util.Map;
+import javax.naming.Context;
+import javax.naming.NamingException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -32,8 +34,8 @@
import com.ogoglio.appdev.servlet.SiteResource;
import com.ogoglio.client.DecoratedInputStream;
import com.ogoglio.media.MediaService;
-import com.ogoglio.persist.AccountPersistTasks;
import com.ogoglio.persist.AccountRecord;
+import com.ogoglio.persist.ServiceInitializationPersistTasks;
import com.ogoglio.persist.SimPersistTasks;
import com.ogoglio.persist.SimRecord;
import com.ogoglio.persist.SpacePersistTasks;
@@ -72,28 +74,45 @@
public void init(ServletConfig config) throws ServletException {
super.init(config);
+ System.out.println("IN INIT:"+config.getServletName()+","+config.getServletContext().getServletContextName());
try {
- simURI = new URI(getSiteInfo().getBaseUrl() + "sim/");
+ Context envCtx = (Context) initCtx.lookup("java:comp/env");
+ simURI = new URI((String) envCtx.lookup("ogoglio/baseSimURL"));
+
SimRecord simRecord = SimPersistTasks.findSimsBySimURI(simURI, getSessionFactory());
- if (simRecord == null) {
- throw new ServletException("Configuration error, no sim record for " + simURI);
+ if (simRecord != null) {
+ //error
+ Log.warn("Restarting the sim server @ "+simRecord.getSimURI()+" but it was already in the database! Ignored.");
+ } else {
+ Log.info("Starting up sim @ " +simURI);
+ simRecord = SimPersistTasks.createSim(ServiceInitializationPersistTasks.LOCAL_SIM_DISPLAY_NAME, simURI, SimRecord.DEFAULT_EVENT_PORT, true, getSessionFactory());
+ sim = new Sim(simRecord, getMediaService(), getSessionFactory());
+ localIP = InetAddress.getByName(simURI.getHost()).getHostAddress();
}
- sim = new Sim(simRecord, getMediaService(), getSessionFactory());
- localIP = InetAddress.getByName(simURI.getHost()).getHostAddress();
- } catch (ServletException e) {
- throw e; //lame
+ } catch (NamingException e) {
+ throw new ServletException("Couldn't find the baseSimURL:"+e.getMessage(),e);
} catch (Exception e) {
- e.printStackTrace();
- throw new ServletException("SimServlet error: " + e);
- }
+ throw new ServletException("Couldn't start sim servlet:"+e.getMessage(),e);
+ }
ScriptContextFactory.setTimedContextAsGlobalContext();
}
public void destroy() {
- super.destroy();
- sim.cleanup();
- Log.info("Destroy called on SimServlet. Cleaning up sim...");
+ try {
+ super.destroy();
+ sim.cleanup();
+ SimRecord rec=SimPersistTasks.findSimsBySimURI(simURI, getSessionFactory());
+ if (rec==null) {
+ System.out.println("FART: CAN'T FIND SIM REC!");
+ } else {
+ System.out.println("FART: DESTROYING SIM REC!");
+ SimPersistTasks.delete(rec, getSessionFactory());
+ }
+ Log.info("Cleaned up sim record in database:"+simURI);
+ } catch (PersistException e) {
+ Log.error("Can't clean up Sim record in database:"+e.getMessage(),e);
+ }
}
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
@@ -108,6 +127,7 @@
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
return;
}
+ System.out.println("FART: SERVICE:"+request.getPathInfo());
super.service(request, response);
}
@@ -232,8 +252,10 @@
public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
long spaceID = Long.parseLong(pathElements[2]);
try {
+
SpaceRecord spaceRecord = SpacePersistTasks.findSpaceBySpaceID(spaceID, getSessionFactory());
if (spaceRecord == null) {
+ System.out.println("FART: no space!");
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
}
@@ -244,6 +266,7 @@
return;
}
+ System.out.println("FART: authed:"+authedAccount.getUsername());
SpaceSimulator simulator = sim.getOrCreateSpaceSimulator(spaceRecord);
Map settings = simulator.getSettings();
@@ -267,8 +290,10 @@
public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
long spaceID = Long.parseLong(pathElements[2]);
+ System.out.println("FART: do get:"+spaceID);
try {
SpaceRecord spaceRecord = SpacePersistTasks.findSpaceBySpaceID(spaceID, getSessionFactory());
+ System.out.println("FART: do get:"+spaceID+" w/"+spaceRecord.getSimID());
if (spaceRecord == null) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
@@ -330,6 +355,7 @@
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
}
+ System.out.println("FART: do post:"+spaceID+","+spaceRecord.getSimID());
AccountRecord authedAccount = AuthServlet.getAuthedAccountRecord(request, getSessionFactory());
if (authedAccount != null && !authedAccount.getUsername().equals(spaceRecord.getOwnerUsername())) {
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
@@ -456,7 +482,6 @@
return;
}
-
AccountRecord authedAccount = AuthServlet.getAuthedAccountRecord(request, getSessionFactory());
if (!SpacePersistTasks.canReadSpace(authedAccount, spaceID, getSessionFactory())) {
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java 2007-09-24 18:34:16 UTC (rev 436)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java 2007-09-24 19:01:30 UTC (rev 437)
@@ -481,8 +481,10 @@
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
return;
}
+ System.out.println("FART: PROXY authed:"+authedAccount.getUsername());
SimRecord simRecord = SpacePersistTasks.findOrAssignSim(spaceRecord, getSessionFactory());
+ System.out.println("FART PROXY: "+simRecord.getSimID()+","+simRecord.getSimURI());
if (simRecord == null) {
Log.error("Could not assign a sim to space " + spaceRecord.getSpaceID());
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
@@ -494,6 +496,7 @@
proxyURI += pathElements[i] + "/";
}
+ System.out.println("FART: PROXY URI ABOUT TO GO:"+proxyURI);
proxy(new URI(proxyURI), method, request, response);
} catch (PersistException e) {
Modified: maven/trunk/ogoglio-server/src/main/webapp/META-INF/context.xml
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/META-INF/context.xml 2007-09-24 18:34:16 UTC (rev 436)
+++ maven/trunk/ogoglio-server/src/main/webapp/META-INF/context.xml 2007-09-24 19:01:30 UTC (rev 437)
@@ -8,6 +8,7 @@
<ResourceLink name="ogoglio/mediaURL" global="mediaURL" type="java.lang.String"/>
<ResourceLink name="ogoglio/baseURL" global="baseURL" type="java.lang.String"/>
+ <ResourceLink name="ogoglio/baseSimURL" global="baseSimURL" type="java.lang.String"/>
<ResourceLink name="ogoglio/oktoZapDB" global="oktoZapDB" type="java.lang.String"/>
<ResourceLink name="ogoglio/okMigrateDB" global="oktoMigrateDB" type="java.lang.String"/>
Modified: maven/trunk/ogoglio-server/src/test/java/com/ogoglio/persist/test/PersistTest.java
===================================================================
--- maven/trunk/ogoglio-server/src/test/java/com/ogoglio/persist/test/PersistTest.java 2007-09-24 18:34:16 UTC (rev 436)
+++ maven/trunk/ogoglio-server/src/test/java/com/ogoglio/persist/test/PersistTest.java 2007-09-24 19:01:30 UTC (rev 437)
@@ -126,7 +126,7 @@
verifyTemplateProps(templateName1, templateRec1);
SpaceRecord spaceRecord1 = checkSpaceAndSimTasks();
-
+
BodyRecord bodyRec1 = BodyPersistTasks.createBody(displayName1, "bogosity", sessionFactory);
assertNull("created body with bogus username", bodyRec1);
bodyRec1 = BodyPersistTasks.createBody(displayName1, username1, sessionFactory);
@@ -151,6 +151,19 @@
assertNotNull(possRecs1);
assertEquals(username1, possRecs1[0].getOwnerUsername());
+
+ //clean up
+ long runningOnSimID=spaceRecord1.getSimID();
+ SpacePersistTasks.deleteSpace(spaceRecord1, sessionFactory);
+ SimRecord condemnedSim = SimPersistTasks.findSimByID(runningOnSimID,sessionFactory);
+ assertNotNull(condemnedSim);
+ SimPersistTasks.delete(condemnedSim, sessionFactory);
+
+ //sanity
+ assertEquals(0, SpacePersistTasks.findAllSpaces(sessionFactory).length);
+ assertEquals(0, SimPersistTasks.findSims(sessionFactory).length);
+
+
} catch (PersistException e) {
e.printStackTrace();
fail();
@@ -218,6 +231,7 @@
SimRecord assignedSimRecord = SpacePersistTasks.findOrAssignSim(spaceRecord2, sessionFactory);
assertNotNull(assignedSimRecord);
+
//System.out.println("XXX ASSIGNED TO SIM:"
// + assignedSimRecord.getSimID() + ","
// + assignedSimRecord.getSimURI() + " -->\n" + "space was "
@@ -237,7 +251,10 @@
* assignedSimRecord.getSimID()); assertEquals(simRecord1,
* assignedSimRecord);
*/
- return spaceRecord1;
+
+ //subtle: need to return 2 ... because these differ in the assignment of the simid
+ //since we assigned the spaceRecord2 version to a sim
+ return spaceRecord2;
}
private void verifySimProps(SimRecord rec, String name, URI uri, int not_id, int port) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-09-24 18:34:14
|
Revision: 436
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=436&view=rev
Author: trevorolio
Date: 2007-09-24 11:34:16 -0700 (Mon, 24 Sep 2007)
Log Message:
-----------
Added some memory logging to applet
Modified Paths:
--------------
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/AppletTestWindow.java
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-09-24 18:33:21 UTC (rev 435)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/AppletTestWindow.java 2007-09-24 18:34:16 UTC (rev 436)
@@ -21,6 +21,7 @@
import java.awt.Frame;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
+import java.lang.management.ManagementFactory;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
@@ -33,6 +34,7 @@
import com.ogoglio.util.ArgumentUtils;
import com.ogoglio.util.PropStorage;
import com.ogoglio.viewer.applet.ViewerApplet;
+import com.sun.tools.javac.util.List;
public class AppletTestWindow extends Frame {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-09-24 18:33:18
|
Revision: 435
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=435&view=rev
Author: trevorolio
Date: 2007-09-24 11:33:21 -0700 (Mon, 24 Sep 2007)
Log Message:
-----------
Added a test for memory usage and refuses to load template data when we reach a (magic) limit.
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/Log.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
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/Log.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/Log.java 2007-09-24 07:32:04 UTC (rev 434)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/Log.java 2007-09-24 18:33:21 UTC (rev 435)
@@ -1,5 +1,8 @@
package com.ogoglio.util;
+import java.lang.management.ManagementFactory;
+import java.lang.management.MemoryMXBean;
+
public class Log {
private static class Logger {
@@ -31,6 +34,12 @@
public void error(Object msg, Throwable t) {
System.err.println(msg + ": " + t);
}
+
+ public void logMemoryUsage() {
+ MemoryMXBean memoryBean = ManagementFactory.getMemoryMXBean();
+ System.out.println("\tHeap: " + (memoryBean.getHeapMemoryUsage().getUsed() / 1024 / 1024f) + "MB / " + (memoryBean.getHeapMemoryUsage().getCommitted() / 1024 / 1024f) + "MB / " + (memoryBean.getHeapMemoryUsage().getMax() / 1024 / 1024f) + "MB");
+ System.out.println("\tNon: " + (memoryBean.getNonHeapMemoryUsage().getUsed() / 1024 / 1024f) + "MB / " + (memoryBean.getNonHeapMemoryUsage().getCommitted() / 1024 / 1024f) + "MB / " + (memoryBean.getNonHeapMemoryUsage().getMax() / 1024 / 1024f) + "MB");
+ }
}
static Logger log = new Logger();
@@ -66,4 +75,8 @@
public static void test(Object msg) {
log.debug("TEST:" + msg);
}
+
+ public static void logMemoryUsage(){
+ log.logMemoryUsage();
+ }
}
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-09-24 07:32:04 UTC (rev 434)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataManager.java 2007-09-24 18:33:21 UTC (rev 435)
@@ -3,6 +3,8 @@
import java.awt.Image;
import java.io.BufferedInputStream;
import java.io.InputStream;
+import java.lang.management.ManagementFactory;
+import java.lang.management.MemoryMXBean;
import java.util.HashMap;
import java.util.Vector;
@@ -33,6 +35,8 @@
public class J3DDataManager {
+ public static final float MINIMUM_REMAINING_HEAP = 20 * 1024 * 1024; //if we lower this, Firefox crashes when the heap limit is reached
+
public static Appearance DEFAULT_APPEARANCE = new Appearance();
private static Material DEFAULT_MATERIAL = new Material();
@@ -52,8 +56,11 @@
private boolean loadAppearances = true;
- public J3DDataManager(boolean loadAppearances) {
+ private boolean complainedAboutMemory = false;
+
+ public J3DDataManager(boolean loadAppearances, GeometryProvider errorGeometryProvider) {
this.loadAppearances = loadAppearances;
+ this.errorGeometryProvider = errorGeometryProvider;
}
public J3DTemplateData[] getTemplateData(long templateID, GeometryProvider geoProvider, boolean useCache) {
@@ -270,12 +277,12 @@
return appearance;
}
-
+
private Obj[] getObjs(GeometryProvider geoProvider, long templateID) {
boolean gotObj = false;
Obj[] objs = new Obj[GeometryProvider.LOD_DISTANCES.length + 1];
try {
- for (int i = 0; i < objs.length; i++) {
+ for (int i = 0; !atMaxMemory() && i < objs.length; i++) {
objs[i] = getObj(geoProvider, i);
if (objs[i] != null && objs[i].getGroups().length == 0) {
Log.error("Got obj with no groups for template " + templateID);
@@ -302,6 +309,25 @@
return objs;
}
+ private long getHeapRemaining(){
+ MemoryMXBean memoryBean = ManagementFactory.getMemoryMXBean();
+ return memoryBean.getHeapMemoryUsage().getMax() - memoryBean.getHeapMemoryUsage().getUsed();
+ }
+
+ private boolean atMaxMemory(){
+ boolean atMax = getHeapRemaining() < MINIMUM_REMAINING_HEAP;
+ if(atMax){
+ Runtime.getRuntime().runFinalization();
+ System.gc();
+ }
+ atMax = getHeapRemaining() < MINIMUM_REMAINING_HEAP;
+ if(atMax && !complainedAboutMemory){
+ complainedAboutMemory = true;
+ Log.error("Reached maximum memory use. Try raising your max heap size.");
+ }
+ return atMax;
+ }
+
private Obj getObj(GeometryProvider provider, int lodIndex) throws ObjParseException {
if (lodIndex != 0) {
return null;
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-09-24 07:32:04 UTC (rev 434)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java 2007-09-24 18:33:21 UTC (rev 435)
@@ -123,7 +123,7 @@
this.username = username;
this.userInputListener = userInputListener;
this.offScreen = offScreen;
- this.dataManager = new J3DDataManager(!offScreen);
+ this.dataManager = new J3DDataManager(!offScreen, errorGeometryProvider);
setCapabilities(sceneRoot);
setCapabilities(usersGroup);
@@ -528,7 +528,10 @@
}
}
- public void stopRenderer() {
+ public synchronized void stopRenderer() {
+ if(rendererStopped){
+ return;
+ }
rendererStopped = true;
physicsBehavior.cleanup();
universe.removeAllLocales();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-09-24 07:32:05
|
Revision: 434
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=434&view=rev
Author: trevorolio
Date: 2007-09-24 00:32:04 -0700 (Mon, 24 Sep 2007)
Log Message:
-----------
Make the data manager respect the server's flag to not load textures
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/J3DRenderer.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DTemplateData.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-09-24 06:53:23 UTC (rev 433)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataCache.java 2007-09-24 07:32:04 UTC (rev 434)
@@ -38,4 +38,15 @@
private long getLODFromGUID(String guid){
return Long.parseLong(guid.split("-")[1]);
}
+
+ 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++) {
+ data[i].cleanup();
+ }
+ }
}
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-09-24 06:53:23 UTC (rev 433)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataManager.java 2007-09-24 07:32:04 UTC (rev 434)
@@ -158,7 +158,6 @@
gi.setTextureCoordinates(0, texCoords);
new NormalGenerator(-1.0f).generateNormals(gi);
- new Stripifier().stripify(gi);
GeometryArray geometryArray = gi.getGeometryArray(false, false, false);
geometryArray.setCapability(GeometryArray.ALLOW_COORDINATE_READ);
geometryArray.setCapability(GeometryArray.ALLOW_COUNT_READ);
@@ -182,6 +181,10 @@
}
private Appearance generateAppearance(GeometryProvider geoProvider, Obj.Group group, HashMap textures) {
+ if (!loadAppearances) {
+ return DEFAULT_APPEARANCE;
+ }
+
Obj.Range[] ranges = group.getRanges();
ObjMtl.Material material = group.getObj().getMaterialForFace(ranges[0].getLower());
if (material == null) {
@@ -312,4 +315,8 @@
}
}
+ 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-09-24 06:53:23 UTC (rev 433)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java 2007-09-24 07:32:04 UTC (rev 434)
@@ -536,6 +536,7 @@
canvas.stopRenderer();
Log.info("Stopped renderer");
}
+ dataManager.cleanup();
}
private DoorRenderable createDoorRenderable(Door door) throws IOException, RenderableParseException {
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DTemplateData.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DTemplateData.java 2007-09-24 06:53:23 UTC (rev 433)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DTemplateData.java 2007-09-24 07:32:04 UTC (rev 434)
@@ -30,8 +30,13 @@
}
public String[] getShapeNames() {
- return (String[])geometries.keySet().toArray(new String[0]);
-
+ return (String[]) geometries.keySet().toArray(new String[0]);
+
}
+ public void cleanup() {
+ geometries.clear();
+ appearances.clear();
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-09-24 06:53:27
|
Revision: 433
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=433&view=rev
Author: trevorolio
Date: 2007-09-23 23:53:23 -0700 (Sun, 23 Sep 2007)
Log Message:
-----------
Added a data manager which holds all template geometry and appearance in a cache for reuse, and eventually for smarter memory management. Firefox really likes to crash the entire browser when its JVM stack is full so we're going to need to prevent that from happening. We can't just catch the OutOfMemoryExceptions because by then it has segfaulted. *sigh*
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderableLoader.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/BodyAnimator.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/obj/MtlParser.java
maven/trunk/ogoglio-common/src/main/resources/avatar/female.obj
maven/trunk/ogoglio-common/src/main/resources/avatar/female.smap
Added 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/J3DTemplateData.java
Added: 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 (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataCache.java 2007-09-24 06:53:23 UTC (rev 433)
@@ -0,0 +1,41 @@
+/* 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.viewer.j3d;
+
+import java.util.HashMap;
+
+public class J3DDataCache {
+
+ private HashMap templateDataMap = new HashMap(); //maps template guid to GeometryCacheEntry objects
+
+ public J3DTemplateData getTemplateData(long templateID, int lod) {
+ return (J3DTemplateData) templateDataMap.get(createGUID(templateID, lod));
+ }
+
+ public void putTemplateData(long templateID, int lod, J3DTemplateData entry) {
+ templateDataMap.put(createGUID(templateID, lod), entry);
+ }
+
+ private String createGUID(long id, int lod){
+ return id + "-" + lod;
+ }
+
+ private long getIDFromGUID(String guid){
+ return Long.parseLong(guid.split("-")[0]);
+ }
+
+ private long getLODFromGUID(String guid){
+ return Long.parseLong(guid.split("-")[1]);
+ }
+}
Added: 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 (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDataManager.java 2007-09-24 06:53:23 UTC (rev 433)
@@ -0,0 +1,315 @@
+package com.ogoglio.viewer.j3d;
+
+import java.awt.Image;
+import java.io.BufferedInputStream;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Vector;
+
+import javax.imageio.ImageIO;
+import javax.media.j3d.Appearance;
+import javax.media.j3d.Geometry;
+import javax.media.j3d.GeometryArray;
+import javax.media.j3d.ImageComponent;
+import javax.media.j3d.Material;
+import javax.media.j3d.RenderingAttributes;
+import javax.media.j3d.Texture;
+import javax.media.j3d.TextureAttributes;
+import javax.media.j3d.TransparencyAttributes;
+import javax.vecmath.Color3f;
+import javax.vecmath.Point3f;
+import javax.vecmath.TexCoord2f;
+
+import com.ogoglio.client.model.GeometryProvider;
+import com.ogoglio.util.Log;
+import com.ogoglio.viewer.j3d.obj.Obj;
+import com.ogoglio.viewer.j3d.obj.ObjMtl;
+import com.ogoglio.viewer.j3d.obj.ObjParseException;
+import com.ogoglio.viewer.j3d.obj.ObjParser;
+import com.sun.j3d.utils.geometry.GeometryInfo;
+import com.sun.j3d.utils.geometry.NormalGenerator;
+import com.sun.j3d.utils.geometry.Stripifier;
+import com.sun.j3d.utils.image.TextureLoader;
+
+public class J3DDataManager {
+
+ public static Appearance DEFAULT_APPEARANCE = new Appearance();
+
+ private static Material DEFAULT_MATERIAL = new Material();
+ static {
+ DEFAULT_MATERIAL.setAmbientColor(new Color3f(1, 1, 1));
+ DEFAULT_MATERIAL.setDiffuseColor(new Color3f(0.1f, 0.1f, 0.1f));
+ DEFAULT_MATERIAL.setSpecularColor(new Color3f(1, 1, 1));
+ DEFAULT_MATERIAL.setShininess(1);
+ DEFAULT_MATERIAL.setLightingEnable(true);
+
+ DEFAULT_APPEARANCE.setMaterial(DEFAULT_MATERIAL);
+ }
+
+ private GeometryProvider errorGeometryProvider = null;
+
+ private J3DDataCache dataCache = new J3DDataCache();
+
+ private boolean loadAppearances = true;
+
+ public J3DDataManager(boolean loadAppearances) {
+ this.loadAppearances = loadAppearances;
+ }
+
+ public J3DTemplateData[] getTemplateData(long templateID, GeometryProvider geoProvider, boolean useCache) {
+ J3DTemplateData[] results = new J3DTemplateData[GeometryProvider.LOD_DISTANCES.length + 1];
+ if (useCache) {
+ boolean hitCache = false;
+ for (int i = 0; i < results.length; i++) {
+ results[i] = dataCache.getTemplateData(templateID, i);
+ hitCache = hitCache || results[i] != null;
+ }
+ if (hitCache) {
+ return results;
+ }
+ }
+
+ fetchTemplateData(templateID, geoProvider, results);
+ for (int i = 0; i < results.length; i++) {
+ if (results[i] == null) {
+ continue;
+ }
+ dataCache.putTemplateData(templateID, i, results[i]);
+ }
+
+ return results;
+ }
+
+ private void fetchTemplateData(long templateID, GeometryProvider geoProvider, J3DTemplateData[] results) {
+ Obj[] objs = getObjs(geoProvider, templateID);
+
+ HashMap textures = new HashMap();
+ for (int i = 0; i < objs.length; i++) {
+ if (objs[i] == null) {
+ continue;
+ }
+ results[i] = new J3DTemplateData();
+
+ Obj.Group[] groups = objs[i].getGroups();
+ for (int g = 0; g < groups.length; g++) {
+ Geometry geometry = generateGeometry(geoProvider, groups[g]);
+ results[i].putGeometry(groups[g].getName(), geometry);
+ Appearance appearance = generateAppearance(geoProvider, groups[g], textures);
+ results[i].putAppearances(groups[g].getName(), appearance);
+ }
+ }
+ textures.clear();
+ }
+
+ private Geometry generateGeometry(GeometryProvider geoProvider, Obj.Group group) {
+ //TODO consider a more memory efficient way to load shapes
+ Obj.Range[] ranges = group.getRanges();
+ if (ranges.length == 0) {
+ Log.error("Zero range group: " + group.getName());
+ return null;
+ }
+
+ Vector textureVertices = new Vector();
+ Vector vertices = new Vector();
+ Vector stripCounts = new Vector();
+ for (int i = 0; i < ranges.length; i++) { //for each range
+ for (int j = ranges[i].getLower(); j <= ranges[i].getUpper(); j++) { //for each face in range
+ stripCounts.add(new Integer(addFaceVertices(group.getObj(), j, vertices, textureVertices)));
+ }
+ }
+
+ if (vertices.size() == 0) {
+ Log.error("Empty group: " + group.getName());
+ return null;
+ }
+
+ Point3f[] vertexPoints = (Point3f[]) vertices.toArray(new Point3f[0]);
+ int[] stripCountInts = new int[stripCounts.size()];
+ int total = 0;
+ for (int i = 0; i < stripCounts.size(); i++) {
+ stripCountInts[i] = ((Integer) stripCounts.get(i)).intValue();
+ total += stripCountInts[i];
+ }
+
+ int[] coordinateIndices = new int[vertexPoints.length];
+ for (int i = 0; i < coordinateIndices.length; i++) {
+ coordinateIndices[i] = i;
+ }
+
+ GeometryInfo gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);
+ gi.setStripCounts(stripCountInts);
+ gi.setCoordinates(vertexPoints);
+ gi.setCoordinateIndices(coordinateIndices);
+
+ TexCoord2f[] texCoords = new TexCoord2f[vertexPoints.length];
+ int[] texCoordIndices = new int[vertexPoints.length];
+ for (int i = 0; i < texCoordIndices.length; i++) {
+ texCoordIndices[i] = i;
+ }
+
+ Point3f textVertex = null;
+ for (int i = 0; i < texCoords.length; i++) {
+ textVertex = (Point3f) textureVertices.get(i);
+ texCoords[i] = new TexCoord2f(textVertex.x, textVertex.y);
+ }
+
+ gi.setTextureCoordinateParams(1, 2); //one set with two dimensions
+ gi.setTextureCoordinateIndices(0, texCoordIndices);
+ gi.setTextureCoordinates(0, texCoords);
+
+ new NormalGenerator(-1.0f).generateNormals(gi);
+ new Stripifier().stripify(gi);
+ GeometryArray geometryArray = gi.getGeometryArray(false, false, false);
+ geometryArray.setCapability(GeometryArray.ALLOW_COORDINATE_READ);
+ geometryArray.setCapability(GeometryArray.ALLOW_COUNT_READ);
+ geometryArray.setCapability(GeometryArray.ALLOW_FORMAT_READ);
+ geometryArray.setCapability(GeometryArray.ALLOW_INTERSECT);
+
+ return geometryArray;
+ }
+
+ private int addFaceVertices(Obj obj, int faceIndex, Vector vertices, Vector textureCoordinates) {
+ int[][] faceIndices = obj.getFaceIndices(faceIndex);
+ for (int i = 0; i < faceIndices.length; i++) {
+ vertices.add(obj.getVertex(faceIndices[i][0]));
+ if (faceIndices[i].length > 1 && faceIndices[i][1] != -1) {
+ textureCoordinates.add(obj.getTextureVertex(faceIndices[i][1]));
+ } else {
+ textureCoordinates.add(new Point3f());
+ }
+ }
+ return faceIndices.length;
+ }
+
+ private Appearance generateAppearance(GeometryProvider geoProvider, Obj.Group group, HashMap textures) {
+ Obj.Range[] ranges = group.getRanges();
+ ObjMtl.Material material = group.getObj().getMaterialForFace(ranges[0].getLower());
+ if (material == null) {
+ return DEFAULT_APPEARANCE;
+ }
+
+ Appearance appearance = new Appearance();
+ appearance.setCapability(Appearance.ALLOW_TEXTURE_WRITE);
+ Material j3dMaterial = new Material();
+ appearance.setMaterial(j3dMaterial);
+
+ Color3f ambientColor = new Color3f();
+ material.getAmbientColor(ambientColor);
+ j3dMaterial.setAmbientColor(ambientColor);
+
+ Color3f diffuseColor = new Color3f();
+ material.getDiffuseColor(diffuseColor);
+ j3dMaterial.setDiffuseColor(diffuseColor);
+
+ Color3f specularColor = new Color3f();
+ material.getSpecularColor(specularColor);
+ j3dMaterial.setSpecularColor(specularColor);
+
+ if (material.getDissolve() != 1) {
+ TransparencyAttributes tAttribs = new TransparencyAttributes(TransparencyAttributes.BLENDED, material.getDissolve());
+ appearance.setTransparencyAttributes(tAttribs);
+ }
+
+ if (material.getSpecularExponent() != -1) {
+ //TODO figure out why shininess appears to have no effect
+ }
+
+ if (material.getDiffuseMapName() != null) { //Woot, texture!
+ try {
+ Texture texImage = (Texture) textures.get(material.getDiffuseMapName());
+
+ if (texImage == null) {
+ InputStream imageStream = geoProvider.getSubGeometryStream(material.getDiffuseMapName());
+ if (imageStream != null) {
+ Image image = ImageIO.read(new BufferedInputStream(imageStream));
+ if (image != null) {
+ //I don't really care for any of these formats
+ // LUMINANCE is nice for a film noir effect
+ if (material.getDiffuseMapName().startsWith("transparent_")) {
+ texImage = new TextureLoader(image, "RGBA", null).getTexture();
+ } else {
+ texImage = new TextureLoader(image, "RGB", null).getTexture();
+ }
+ textures.put(material.getDiffuseMapName(), texImage);
+ }
+ imageStream.close();
+ }
+ }
+ if (texImage != null) {
+ texImage.getImage(0).setCapability(ImageComponent.ALLOW_SIZE_READ);
+ texImage.getImage(0).setCapability(ImageComponent.ALLOW_IMAGE_READ);
+ texImage.getImage(0).setCapability(ImageComponent.ALLOW_IMAGE_WRITE);
+ appearance.setTexture(texImage);
+
+ TextureAttributes textureAttributes = new TextureAttributes();
+ textureAttributes.setTextureMode(TextureAttributes.MODULATE);
+ appearance.setTextureAttributes(textureAttributes);
+
+ // this is a hack so that only textures named transparent_* get these attributes set
+ // otherwise we get all kinds of bad ordering problems
+ //TODO figure out what the right thing is for transparent texture attributes
+ if (material.getDiffuseMapName().startsWith("transparent_")) {
+ TextureAttributes textureAtts = new TextureAttributes();
+ textureAtts.setTextureMode(TextureAttributes.REPLACE);
+ appearance.setTextureAttributes(textureAtts);
+
+ TransparencyAttributes tAttribs = new TransparencyAttributes(TransparencyAttributes.BLENDED, 0, TransparencyAttributes.BLEND_SRC_ALPHA, TransparencyAttributes.BLEND_ONE_MINUS_SRC_ALPHA);
+ appearance.setTransparencyAttributes(tAttribs);
+ appearance.setRenderingAttributes(new RenderingAttributes());
+ }
+
+ }
+
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+ }
+
+ return appearance;
+ }
+
+ private Obj[] getObjs(GeometryProvider geoProvider, long templateID) {
+ boolean gotObj = false;
+ Obj[] objs = new Obj[GeometryProvider.LOD_DISTANCES.length + 1];
+ try {
+ for (int i = 0; i < objs.length; i++) {
+ objs[i] = getObj(geoProvider, i);
+ if (objs[i] != null && objs[i].getGroups().length == 0) {
+ Log.error("Got obj with no groups for template " + templateID);
+ objs[i] = null;
+ }
+ if (!gotObj && objs[i] != null) {
+ gotObj = true;
+ }
+ }
+ } catch (ObjParseException e) {
+ Log.error("Error parsing obj: " + e);
+ }
+ if (!gotObj) {
+ try {
+ objs[0] = getObj(errorGeometryProvider, 0);
+ } catch (ObjParseException e) {
+ throw new IllegalStateException("Error parsing the error template?!?");
+ }
+
+ }
+ if (objs[0] == null) {
+ throw new IllegalStateException("Where's my error template?");
+ }
+ return objs;
+ }
+
+ private Obj getObj(GeometryProvider provider, int lodIndex) throws ObjParseException {
+ if (lodIndex != 0) {
+ return null;
+ }
+ try {
+ ObjParser parser = new ObjParser(provider, lodIndex);
+ return parser.parse();
+ } catch (Exception e) {
+ System.err.println("Could not load obj: " + e);
+ return null;
+ }
+ }
+
+}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderableLoader.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderableLoader.java 2007-09-23 00:32:43 UTC (rev 432)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderableLoader.java 2007-09-24 06:53:23 UTC (rev 433)
@@ -14,289 +14,88 @@
package com.ogoglio.viewer.j3d;
-import java.awt.Image;
-import java.io.BufferedInputStream;
-import java.io.InputStream;
import java.util.HashMap;
import java.util.Vector;
-import javax.imageio.ImageIO;
import javax.media.j3d.Appearance;
-import javax.media.j3d.GeometryArray;
-import javax.media.j3d.ImageComponent;
-import javax.media.j3d.Material;
-import javax.media.j3d.RenderingAttributes;
+import javax.media.j3d.Geometry;
import javax.media.j3d.Shape3D;
-import javax.media.j3d.Texture;
-import javax.media.j3d.TextureAttributes;
-import javax.media.j3d.TransparencyAttributes;
-import javax.vecmath.Color3f;
-import javax.vecmath.Point3f;
-import javax.vecmath.TexCoord2f;
import com.ogoglio.client.model.Door;
import com.ogoglio.client.model.GeometryProvider;
import com.ogoglio.client.model.Shape;
import com.ogoglio.client.model.Thing;
-import com.ogoglio.util.Log;
-import com.ogoglio.viewer.j3d.obj.Obj;
-import com.ogoglio.viewer.j3d.obj.ObjMtl;
+import com.ogoglio.util.ArgumentUtils;
import com.ogoglio.viewer.render.Renderable;
-import com.sun.j3d.utils.geometry.GeometryInfo;
-import com.sun.j3d.utils.geometry.NormalGenerator;
-import com.sun.j3d.utils.image.TextureLoader;
public class J3DRenderableLoader {
- public static Appearance DEFAULT_APPEARANCE = new Appearance();
+ private J3DTemplateData[] templateData = null;
- private static Material DEFAULT_MATERIAL = new Material();
- static {
- DEFAULT_MATERIAL.setAmbientColor(new Color3f(1, 1, 1));
- DEFAULT_MATERIAL.setDiffuseColor(new Color3f(0.1f, 0.1f, 0.1f));
- DEFAULT_MATERIAL.setSpecularColor(new Color3f(1, 1, 1));
- DEFAULT_MATERIAL.setShininess(1);
- DEFAULT_MATERIAL.setLightingEnable(true);
-
- DEFAULT_APPEARANCE.setMaterial(DEFAULT_MATERIAL);
+ public J3DRenderableLoader(J3DTemplateData[] templateData) {
+ this.templateData = templateData;
}
- private Obj[] objs = null;
-
- private HashMap textures = new HashMap();
-
- boolean loadMaterials = true;
-
- public J3DRenderableLoader(Obj[] objs, boolean loadMaterials) {
- this.objs = objs;
- this.loadMaterials = loadMaterials;
- }
-
- private J3DShapeRenderable generateShape(GeometryProvider geoProvider, Renderable renderable, Obj.Group group) {
- //TODO consider a more memory efficient way to load shapes
- Obj.Range[] ranges = group.getRanges();
- if (ranges.length == 0) {
- Log.error("Zero range group: " + group.getName());
- return null;
- }
-
- Vector textureVertices = new Vector();
- Vector vertices = new Vector();
- Vector stripCounts = new Vector();
- for (int i = 0; i < ranges.length; i++) { //for each range
- for (int j = ranges[i].getLower(); j <= ranges[i].getUpper(); j++) { //for each face in range
- stripCounts.add(new Integer(addFaceVertices(group.getObj(), j, vertices, textureVertices)));
- }
- }
-
- if (vertices.size() == 0) {
- Log.error("Empty group: " + group.getName());
- return null;
- }
-
- Point3f[] vertexPoints = (Point3f[]) vertices.toArray(new Point3f[0]);
- int[] stripCountInts = new int[stripCounts.size()];
- int total = 0;
- for (int i = 0; i < stripCounts.size(); i++) {
- stripCountInts[i] = ((Integer) stripCounts.get(i)).intValue();
- total += stripCountInts[i];
- }
-
- int[] coordinateIndices = new int[vertexPoints.length];
- for (int i = 0; i < coordinateIndices.length; i++) {
- coordinateIndices[i] = i;
- }
-
- GeometryInfo gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);
- gi.setStripCounts(stripCountInts);
- gi.setCoordinates(vertexPoints);
- gi.setCoordinateIndices(coordinateIndices);
-
- TexCoord2f[] texCoords = new TexCoord2f[vertexPoints.length];
- int[] texCoordIndices = new int[vertexPoints.length];
- for (int i = 0; i < texCoordIndices.length; i++) {
- texCoordIndices[i] = i;
- }
-
- Point3f textVertex = null;
- for (int i = 0; i < texCoords.length; i++) {
- textVertex = (Point3f) textureVertices.get(i);
- texCoords[i] = new TexCoord2f(textVertex.x, textVertex.y);
- }
-
- gi.setTextureCoordinateParams(1, 2); //one set with two dimensions
- gi.setTextureCoordinateIndices(0, texCoordIndices);
- gi.setTextureCoordinates(0, texCoords);
-
- new NormalGenerator(-1.0f).generateNormals(gi);
- GeometryArray geometryArray = gi.getGeometryArray(false, false, false);
- geometryArray.setCapability(GeometryArray.ALLOW_COORDINATE_READ);
- geometryArray.setCapability(GeometryArray.ALLOW_COUNT_READ);
- geometryArray.setCapability(GeometryArray.ALLOW_FORMAT_READ);
- geometryArray.setCapability(GeometryArray.ALLOW_INTERSECT);
-
- Shape shape = null;
- if (renderable instanceof J3DThingRenderable) {
- Thing thing = ((J3DThingRenderable) renderable).getThing();
- shape = thing.getShape(group.getName());
- if (shape == null) {
- shape = new Shape(thing, group.getName());
- ((J3DThingRenderable) renderable).getThing().addShape(shape);
- }
- }
-
- J3DShapeRenderable shapeRenderable = new J3DShapeRenderable(renderable, shape);
- shapeRenderable.getInnerShape().setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);
- shapeRenderable.getInnerShape().setCapability(Shape3D.ALLOW_GEOMETRY_READ);
- shapeRenderable.getInnerShape().setCapability(Shape3D.ALLOW_PICKABLE_READ);
- shapeRenderable.getInnerShape().addGeometry(geometryArray);
-
- ObjMtl.Material objMat = group.getObj().getMaterialForFace(ranges[0].getLower());
- if (loadMaterials && objMat != null) {
- shapeRenderable.getInnerShape().setAppearance(getAppearance(geoProvider, objMat));
- } else {
- shapeRenderable.getInnerShape().setAppearance(DEFAULT_APPEARANCE);
- }
- shapeRenderable.setCapability(Shape3D.ALLOW_APPEARANCE_READ);
- shapeRenderable.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);
- return shapeRenderable;
- }
-
- private Appearance getAppearance(GeometryProvider geoProvider, ObjMtl.Material material) {
-
- Appearance appearance = new Appearance();
- appearance.setCapability(Appearance.ALLOW_TEXTURE_WRITE);
- Material j3dMaterial = new Material();
- appearance.setMaterial(j3dMaterial);
-
- Color3f ambientColor = new Color3f();
- material.getAmbientColor(ambientColor);
- j3dMaterial.setAmbientColor(ambientColor);
-
- Color3f diffuseColor = new Color3f();
- material.getDiffuseColor(diffuseColor);
- j3dMaterial.setDiffuseColor(diffuseColor);
-
- Color3f specularColor = new Color3f();
- material.getSpecularColor(specularColor);
- j3dMaterial.setSpecularColor(specularColor);
-
- if (material.getDissolve() != 1) {
- TransparencyAttributes tAttribs = new TransparencyAttributes(TransparencyAttributes.BLENDED, material.getDissolve());
- appearance.setTransparencyAttributes(tAttribs);
- }
-
- if (material.getSpecularExponent() != -1) {
- //TODO figure out why shininess appears to have no effect
- }
-
- if (material.getDiffuseMapName() != null) { //Woot, texture!
- try {
- Texture texImage = (Texture) textures.get(material.getDiffuseMapName());
- if (texImage == null) {
- InputStream imageStream = geoProvider.getSubGeometryStream(material.getDiffuseMapName());
- if (imageStream != null) {
- Image image = ImageIO.read(new BufferedInputStream(imageStream));
- if (image != null) {
- //I don't really care for any of these formats
- // LUMINANCE is nice for a film noir effect
- if (material.getDiffuseMapName().startsWith("transparent_")) {
- texImage = new TextureLoader(image, "RGBA", null).getTexture();
- } else {
- texImage = new TextureLoader(image, "RGB", null).getTexture();
- }
- textures.put(material.getDiffuseMapName(), texImage);
- }
- imageStream.close();
- }
- }
- if (texImage != null) {
- texImage.getImage(0).setCapability(ImageComponent.ALLOW_SIZE_READ);
- texImage.getImage(0).setCapability(ImageComponent.ALLOW_IMAGE_READ);
- texImage.getImage(0).setCapability(ImageComponent.ALLOW_IMAGE_WRITE);
- appearance.setTexture(texImage);
- // this is a hack so that only textures named transparent_* get these attributes set
- // otherwise we get all kinds of bad ordering problems
- //TODO figure out what the right thing is for transparent texture attributes
- if (material.getDiffuseMapName().startsWith("transparent_")) {
- TextureAttributes textureAtts = new TextureAttributes();
- textureAtts.setTextureMode(TextureAttributes.REPLACE);
- appearance.setTextureAttributes(textureAtts);
-
- TransparencyAttributes tAttribs = new TransparencyAttributes(TransparencyAttributes.BLENDED, 0, TransparencyAttributes.BLEND_SRC_ALPHA, TransparencyAttributes.BLEND_ONE_MINUS_SRC_ALPHA);
- appearance.setTransparencyAttributes(tAttribs);
- appearance.setRenderingAttributes(new RenderingAttributes());
- }
-
- }
-
- } catch (Throwable e) {
- e.printStackTrace();
- }
- }
-
- return appearance;
- }
-
- private int addFaceVertices(Obj obj, int faceIndex, Vector vertices, Vector textureCoordinates) {
- int[][] faceIndices = obj.getFaceIndices(faceIndex);
- for (int i = 0; i < faceIndices.length; i++) {
- vertices.add(obj.getVertex(faceIndices[i][0]));
- if (faceIndices[i].length > 1 && faceIndices[i][1] != -1) {
- textureCoordinates.add(obj.getTextureVertex(faceIndices[i][1]));
- } else {
- textureCoordinates.add(new Point3f());
- }
- }
- return faceIndices.length;
- }
-
public J3DThingRenderable loadThing(Thing thing) {
J3DThingRenderable renderable = new J3DThingRenderable(thing);
Vector lodDistances = new Vector();
Vector lodGroups = new Vector();
-
- for (int i = 0; i < objs.length; i++) {
- if (objs[i] == null) {
+ for (int i = 0; i < templateData.length; i++) {
+ if (templateData[i] == null) {
continue;
}
HashMap shapeGroup = new HashMap();
- Obj.Group[] groups = objs[i].getGroups();
- for (int g = 0; g < groups.length; g++) {
- J3DShapeRenderable shape = generateShape(thing, renderable, groups[g]);
- if (shape != null) {
- shapeGroup.put(shape.getName(), shape);
+ String[] shapeNames = templateData[i].getShapeNames();
+ for (int g = 0; g < shapeNames.length; g++) {
+ Shape shape = thing.getShape(shapeNames[g]);
+ if (shape == null) {
+ shape = new Shape(thing, shapeNames[g]);
+ thing.addShape(shape);
}
+ Geometry geometry = templateData[i].getGeometry(shapeNames[g]);
+ Appearance appearance = templateData[i].getAppearance(shapeNames[g]);
+ J3DShapeRenderable shapeRenderable = generateShapeRenderable(renderable, shape, geometry, appearance);
+ shapeGroup.put(shape.getName(), shapeRenderable);
}
- if (shapeGroup.size() > 0) {
- if (lodGroups.size() > 0) { //there is one less distance than shapeGroup
- lodDistances.add(new Float(GeometryProvider.LOD_DISTANCES[i - 1]));
- }
- lodGroups.add(shapeGroup);
+ if (lodGroups.size() > 0) { //there is one less distance than shapeGroup
+ lodDistances.add(new Float(GeometryProvider.LOD_DISTANCES[i - 1]));
}
+ lodGroups.add(shapeGroup);
}
float[] distances = new float[lodDistances.size()];
for (int i = 0; i < distances.length; i++) {
distances[i] = ((Float) lodDistances.elementAt(i)).floatValue();
}
renderable.setGeometries(distances, (HashMap[]) lodGroups.toArray(new HashMap[0]));
- textures.clear();
return renderable;
}
public J3DDoorRenderable loadDoor(Door door) {
+ ArgumentUtils.assertNotNull(templateData[0]); //doors completely ignore LODs other than 0
+
J3DDoorRenderable renderable = new J3DDoorRenderable(door);
-
- Obj.Group[] groups = objs[0].getGroups();
- for (int i = 0; i < groups.length; i++) {
- J3DShapeRenderable shape = generateShape(door, renderable, groups[i]);
- if (shape != null) {
- renderable.addShapeRenderable(shape, 0);
- }
+ String[] shapeNames = templateData[0].getShapeNames();
+ for (int g = 0; g < shapeNames.length; g++) {
+ Geometry geometry = templateData[0].getGeometry(shapeNames[g]);
+ Appearance appearance = templateData[0].getAppearance(shapeNames[g]);
+ J3DShapeRenderable shapeRenderable = generateShapeRenderable(renderable, null, geometry, appearance);
+ renderable.addShapeRenderable(shapeRenderable, 0);
}
- textures.clear();
return renderable;
}
+ private J3DShapeRenderable generateShapeRenderable(Renderable renderable, Shape shape, Geometry geometry, Appearance appearance) {
+
+ J3DShapeRenderable shapeRenderable = new J3DShapeRenderable(renderable, shape);
+ shapeRenderable.getInnerShape().setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);
+ shapeRenderable.getInnerShape().setCapability(Shape3D.ALLOW_GEOMETRY_READ);
+ shapeRenderable.getInnerShape().setCapability(Shape3D.ALLOW_PICKABLE_READ);
+ shapeRenderable.getInnerShape().addGeometry(geometry);
+ shapeRenderable.getInnerShape().setAppearance(appearance);
+
+ shapeRenderable.setCapability(Shape3D.ALLOW_APPEARANCE_READ);
+ shapeRenderable.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);
+ return shapeRenderable;
+ }
}
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-09-23 00:32:43 UTC (rev 432)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java 2007-09-24 06:53:23 UTC (rev 433)
@@ -98,8 +98,6 @@
private String username = null; //may be null if we're rendering in the sim
- private GeometryProvider errorGeometryProvider = null;
-
private boolean offScreen = false;
private boolean movable = true;
@@ -114,6 +112,8 @@
private boolean completedInitialLoad = false;
+ private J3DDataManager dataManager = null;
+
public J3DRenderer(SpaceClient spaceClient, boolean offScreen) {
this(spaceClient.getSpace(), spaceClient.getUsername(), spaceClient, spaceClient.getErrorGeometryProvider(), offScreen);
}
@@ -122,8 +122,8 @@
super(space);
this.username = username;
this.userInputListener = userInputListener;
- this.errorGeometryProvider = errorGeometryProvider;
this.offScreen = offScreen;
+ this.dataManager = new J3DDataManager(!offScreen);
setCapabilities(sceneRoot);
setCapabilities(usersGroup);
@@ -307,7 +307,7 @@
return;
}
try {
- ThingRenderable renderable = createThingRenderable(thing);
+ ThingRenderable renderable = createThingRenderable(thing, true);
addThingRenderable(renderable);
Shape[] shapes = thing.getShapes();
for (int i = 0; i < shapes.length; i++) {
@@ -358,7 +358,7 @@
}
removeWorldObject(renderable);
}
- renderable = (J3DThingRenderable) createThingRenderable(thing);
+ renderable = (J3DThingRenderable) createThingRenderable(thing, false);
addThingRenderable(renderable);
Shape[] shapes = thing.getShapes();
@@ -539,27 +539,11 @@
}
private DoorRenderable createDoorRenderable(Door door) throws IOException, RenderableParseException {
- try {
- Obj[] objs = new Obj[GeometryProvider.LOD_DISTANCES.length];
- for (int i = 1; i < objs.length; i++) {
- objs[i] = null;
- }
- objs[0] = getObj(door, 0);
- if (objs[0] == null) {
- Log.error("Could not load the door geometry!");
- objs[0] = getObj(errorGeometryProvider, 0);
- }
- if (objs[0] == null) {
- throw new IllegalStateException("Where's my error?");
- }
- J3DRenderableLoader loader = new J3DRenderableLoader(objs, !offScreen);
- J3DDoorRenderable renderable = loader.loadDoor(door);
- renderable.setID(DOOR_ID_PREFIX + door.getDoorID());
- renderable.setPosition(door.getPosition());
- return renderable;
- } catch (ObjParseException e) {
- throw new RenderableParseException("Error parsing geometry: " + e.getMessage());
- }
+ J3DRenderableLoader loader = new J3DRenderableLoader(dataManager.getTemplateData(door.getTemplate().getTemplateID(), door, true));
+ J3DDoorRenderable renderable = loader.loadDoor(door);
+ renderable.setID(DOOR_ID_PREFIX + door.getDoorID());
+ renderable.setPosition(door.getPosition());
+ return renderable;
}
private void addDoorRenderable(DoorRenderable renderable) {
@@ -694,53 +678,18 @@
worldGroup.addChild(cameraBranch);
}
- private Obj getObj(GeometryProvider provider, int lodIndex) throws ObjParseException {
- if (lodIndex != 0) {
- return null;
- }
- try {
- ObjParser parser = new ObjParser(provider, lodIndex);
- return parser.parse();
- } catch (Exception e) {
- return null;
- }
- }
+ private ThingRenderable createThingRenderable(Thing thing, boolean useCache) throws IOException, RenderableParseException {
+ J3DRenderableLoader loader = new J3DRenderableLoader(dataManager.getTemplateData(thing.getTemplate().getTemplateID(), thing, useCache));
+ J3DThingRenderable renderable = loader.loadThing(thing);
+ renderable.setPosition(thing.getPosition());
- private ThingRenderable createThingRenderable(Thing thing) throws IOException, RenderableParseException {
- try {
- boolean gotObj = false;
- Obj[] objs = new Obj[GeometryProvider.LOD_DISTANCES.length + 1];
- for (int i = 0; i < objs.length; i++) {
- objs[i] = getObj(thing, i);
- if (objs[i] != null && objs[i].getGroups().length == 0) {
- Log.error("Got obj with no groups for thing " + thing.getThingID() + ": " + thing.getName());
- objs[i] = null;
- }
- if (!gotObj && objs[i] != null) {
- gotObj = true;
- }
- }
- if (!gotObj) {
- objs[0] = getObj(errorGeometryProvider, 0);
- }
- if (objs[0] == null) {
- throw new IllegalStateException("Where's my error template?");
- }
- J3DRenderableLoader loader = new J3DRenderableLoader(objs, !offScreen);
- J3DThingRenderable renderable = loader.loadThing(thing);
- renderable.setPosition(thing.getPosition());
-
- Page[] pages = thing.getPages();
- for (int i = 0; i < pages.length; i++) {
- J3DPageRenderable pageRenderable = new J3DPageRenderable(renderable/*not used!*/, pages[i]);
- renderable.addPageRenderable(pageRenderable);
- }
-
- return renderable;
- } catch (ObjParseException e) {
- e.printStackTrace();
- throw new RenderableParseException("Error parsing geometry: " + e.getMessage());
+ Page[] pages = thing.getPages();
+ for (int i = 0; i < pages.length; i++) {
+ J3DPageRenderable pageRenderable = new J3DPageRenderable(renderable/*not used!*/, pages[i]);
+ renderable.addPageRenderable(pageRenderable);
}
+
+ return renderable;
}
private static GraphicsConfiguration getGraphicsConfiguration() {
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DTemplateData.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DTemplateData.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DTemplateData.java 2007-09-24 06:53:23 UTC (rev 433)
@@ -0,0 +1,37 @@
+package com.ogoglio.viewer.j3d;
+
+import java.util.HashMap;
+
+import javax.media.j3d.Appearance;
+import javax.media.j3d.Geometry;
+
+public class J3DTemplateData {
+ private HashMap geometries = new HashMap(); //maps String shape names to Geometry objects
+
+ private HashMap appearances = new HashMap();
+
+ public J3DTemplateData() {
+ }
+
+ public Geometry getGeometry(String shapeName) {
+ return (Geometry) geometries.get(shapeName);
+ }
+
+ public void putGeometry(String shapeName, Geometry geometry) {
+ geometries.put(shapeName, geometry);
+ }
+
+ public Appearance getAppearance(String shapeName) {
+ return (Appearance) appearances.get(shapeName);
+ }
+
+ public void putAppearances(String shapeName, Appearance appearance) {
+ appearances.put(shapeName, appearance);
+ }
+
+ public String[] getShapeNames() {
+ return (String[])geometries.keySet().toArray(new String[0]);
+
+ }
+
+}
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-09-23 00:32:43 UTC (rev 432)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java 2007-09-24 06:53:23 UTC (rev 433)
@@ -138,6 +138,9 @@
float bvhHeight = bvh.getHeight();
if (bvhHeight != userHeight) {
skeletonScale = userHeight / bvhHeight / MAGIC_SKELETON_SCALE; //TODO figure out why we need this magic scale number
+ if(skeletonScale == 1){
+ return;
+ }
bvh.scale(skeletonScale, skeletonScale, skeletonScale);
}
}
@@ -256,7 +259,6 @@
if (animator != null) {
animator.cleanup();
}
-
if (skeleton != null && bvh != null && skin != null) {
scaleBVH(bvh);
animator = new BodyAnimator(skeleton, bvh, skin, bodyAnimatorListener);
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/BodyAnimator.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/BodyAnimator.java 2007-09-23 00:32:43 UTC (rev 432)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/BodyAnimator.java 2007-09-24 06:53:23 UTC (rev 433)
@@ -90,8 +90,8 @@
if (loop) {
frameIndex = 0;
} else {
+ listener.bodyAnimationCompleted(this);
cleanup();
- listener.bodyAnimationCompleted(this);
return;
}
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/obj/MtlParser.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/obj/MtlParser.java 2007-09-23 00:32:43 UTC (rev 432)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/obj/MtlParser.java 2007-09-24 06:53:23 UTC (rev 433)
@@ -112,7 +112,7 @@
if (tokens.length != 2) {
throw new ObjParseException("bad specular exponent: " + toString(tokens));
}
- workingMaterial.setIlluminationModel(parseInt(tokens[1], 1, 10, true));
+ workingMaterial.setIlluminationModel(parseInt(tokens[1], 0, 10, true));
}
private void parseNs(String[] tokens) throws ObjParseException {
@@ -142,7 +142,7 @@
if (tokens.length != 4) {
throw new ObjParseException("bad color: " + toString(tokens));
}
- workingMaterial.setAmbient(new Color3f(parseFloat(tokens[1], 0, 1, true), parseFloat(tokens[2], 0, 1, true), parseFloat(tokens[3], 0, 1, true)));
+ workingMaterial.setAmbient(new Color3f(parseFloat(tokens[1], 0, 2, true), parseFloat(tokens[2], 0, 2, true), parseFloat(tokens[3], 0, 2, true)));
}
private void parseKd(String[] tokens) throws ObjParseException {
@@ -152,7 +152,7 @@
if (tokens.length != 4) {
throw new ObjParseException("bad color: " + toString(tokens));
}
- workingMaterial.setDiffuse(new Color3f(parseFloat(tokens[1], 0, 1, true), parseFloat(tokens[2], 0, 1, true), parseFloat(tokens[3], 0, 1, true)));
+ workingMaterial.setDiffuse(new Color3f(parseFloat(tokens[1], 0, 2, true), parseFloat(tokens[2], 0, 2, true), parseFloat(tokens[3], 0, 2, true)));
}
private void parseKs(String[] tokens) throws ObjParseException {
@@ -162,7 +162,7 @@
if (tokens.length != 4) {
throw new ObjParseException("bad color: " + toString(tokens));
}
- workingMaterial.setSpecular(new Color3f(parseFloat(tokens[1], 0, 1, true), parseFloat(tokens[2], 0, 1, true), parseFloat(tokens[3], 0, 1, true)));
+ workingMaterial.setSpecular(new Color3f(parseFloat(tokens[1], 0, 2, true), parseFloat(tokens[2], 0, 2, true), parseFloat(tokens[3], 0, 2, true)));
}
private void parseNewmtl(String[] tokens) throws ObjParseException {
Modified: maven/trunk/ogoglio-common/src/main/resources/avatar/female.obj
===================================================================
--- maven/trunk/ogoglio-common/src/main/resources/avatar/female.obj 2007-09-23 00:32:43 UTC (rev 432)
+++ maven/trunk/ogoglio-common/src/main/resources/avatar/female.obj 2007-09-24 06:53:23 UTC (rev 433)
@@ -1,15324 +1,23186 @@
-# Blender3D v244 OBJ File: andrea.blend
+# Blender3D v245 OBJ File: fem.blend
# www.blender3d.org
-o Andrea
-v 0.072444 0.431344 -0.019903
-v 0.068896 0.420338 0.003628
-v 0.105751 0.423702 -0.018323
-v -0.105751 0.423702 -0.018323
-v -0.068896 0.420338 0.003628
-v -0.072444 0.431344 -0.019903
-v 0.000000 -0.393034 0.007298
-v 0.000000 -0.372789 0.043782
-v -0.012783 -0.385010 0.045911
-v 0.012783 -0.385010 0.045911
-v 0.000000 -0.008021 0.094634
-v 0.000000 -0.089941 0.089685
-v 0.057792 -0.089020 0.084403
-v 0.058209 -0.013620 0.089661
-v -0.057792 -0.089020 0.084403
-v -0.058209 -0.013620 0.089661
-v 0.000000 0.094034 0.098980
-v 0.050715 0.092738 0.094812
-v -0.050715 0.092738 0.094812
-v 0.000000 0.164555 0.102934
-v 0.041652 0.171488 0.118493
-v -0.041652 0.171488 0.118493
-v 0.000000 0.223170 0.115909
-v 0.050379 0.231945 0.134207
-v -0.050379 0.231945 0.134207
-v 0.000000 0.270250 0.109425
-v 0.054861 0.281394 0.123434
-v -0.054861 0.281394 0.123434
-v 0.000000 0.298406 0.093584
-v 0.053147 0.304501 0.107590
-v -0.053147 0.304501 0.107590
-v 0.000000 0.337909 0.072363
-v 0.058648 0.331418 0.084937
-v -0.058648 0.331418 0.084937
-v 0.000000 0.374800 0.051486
-v 0.065565 0.367155 0.054023
-v -0.065565 0.367155 0.054023
-v 0.112832 -0.080882 0.069332
-v 0.104618 -0.017584 0.075114
-v -0.112832 -0.080882 0.069332
-v -0.104618 -0.017584 0.075114
-v 0.098308 0.080239 0.078745
-v -0.098308 0.080239 0.078745
-v 0.102195 0.169117 0.101175
-v -0.102195 0.169117 0.101175
-v 0.102112 0.330140 0.060913
-v 0.106231 0.370701 0.039329
-v -0.102112 0.330140 0.060913
-v -0.106231 0.370701 0.039329
-v 0.069847 0.403127 0.028194
-v 0.106717 0.402655 0.018780
-v -0.069847 0.403127 0.028194
-v -0.106717 0.402655 0.018780
-v 0.135726 -0.079896 0.047087
-v 0.123153 -0.026271 0.050171
-v -0.135726 -0.079896 0.047087
-v -0.123153 -0.026271 0.050171
-v 0.116639 0.077631 0.053781
-v -0.116639 0.077631 0.053781
-v 0.125536 0.157508 0.063685
-v -0.125536 0.157508 0.063685
-v 0.111490 0.211376 0.105764
-v 0.130803 0.200028 0.064521
-v -0.111490 0.211376 0.105764
-v -0.130803 0.200028 0.064521
-v 0.120670 0.255090 0.089817
-v 0.136371 0.233204 0.056783
-v -0.120670 0.255090 0.089817
-v -0.136371 0.233204 0.056783
-v 0.138667 0.297800 0.067260
-v 0.155276 0.277073 0.042864
-v -0.138667 0.297800 0.067260
-v -0.155276 0.277073 0.042864
-v 0.132172 -0.084556 -0.005840
-v 0.125661 -0.035915 0.000978
-v -0.132172 -0.084556 -0.005840
-v -0.125661 -0.035915 0.000978
-v 0.118146 0.071094 -0.001888
-v -0.118146 0.071094 -0.001888
-v 0.127805 0.148104 0.000387
-v -0.127805 0.148104 0.000387
-v 0.133882 0.192800 0.005342
-v -0.133882 0.192800 0.005342
-v 0.138960 0.223855 0.004306
-v -0.138960 0.223855 0.004306
-v 0.145903 0.264764 -0.002847
-v -0.145903 0.264764 -0.002847
-v 0.122883 -0.089829 -0.038321
-v 0.118085 -0.039110 -0.030806
-v -0.122883 -0.089829 -0.038321
-v -0.118085 -0.039110 -0.030806
-v 0.108614 0.072554 -0.026710
-v -0.108614 0.072554 -0.026710
-v 0.116975 0.148400 -0.033306
-v -0.116975 0.148400 -0.033306
-v 0.128076 0.196613 -0.030121
-v -0.128076 0.196613 -0.030121
-v 0.135916 0.228366 -0.031156
-v -0.135916 0.228366 -0.031156
-v 0.152495 0.267770 -0.037227
-v -0.152495 0.267770 -0.037227
-v 0.104679 -0.096463 -0.059816
-v 0.100855 -0.038797 -0.047297
-v -0.104679 -0.096463 -0.059816
-v -0.100855 -0.038797 -0.047297
-v 0.092459 0.074649 -0.041860
-v -0.092459 0.074649 -0.041860
-v 0.097363 0.153283 -0.051233
-v -0.097363 0.153283 -0.051233
-v 0.103373 0.205267 -0.057511
-v -0.103373 0.205267 -0.057511
-v 0.116110 0.247952 -0.062148
-v -0.116110 0.247952 -0.062148
-v 0.125405 0.290520 -0.067071
-v -0.125405 0.290520 -0.067071
-v 0.068164 -0.102327 -0.070171
-v 0.061873 -0.041381 -0.052230
-v -0.068164 -0.102327 -0.070171
-v -0.061873 -0.041381 -0.052230
-v 0.055306 0.073755 -0.047743
-v -0.055306 0.073755 -0.047743
-v 0.052221 0.153746 -0.054210
-v -0.052221 0.153746 -0.054210
-v 0.053126 0.207744 -0.060426
-v -0.053126 0.207744 -0.060426
-v 0.059103 0.256004 -0.065803
-v -0.059103 0.256004 -0.065803
-v 0.070452 0.314732 -0.083436
-v -0.070452 0.314732 -0.083436
-v 0.000000 -0.105634 -0.069203
-v 0.000000 -0.040280 -0.052491
-v 0.000000 0.072419 -0.048181
-v 0.000000 0.151638 -0.054129
-v 0.000000 0.208307 -0.060015
-v 0.000000 0.254949 -0.070937
-v 0.000000 0.316027 -0.084885
-v 0.073417 0.359692 -0.087206
-v 0.120339 0.352896 -0.078341
-v -0.073417 0.359692 -0.087206
-v -0.120339 0.352896 -0.078341
-v 0.000000 0.363071 -0.086311
-v 0.071927 0.411779 -0.071083
-v 0.117045 0.401216 -0.062277
-v -0.071927 0.411779 -0.071083
-v -0.117045 0.401216 -0.062277
-v 0.072444 0.431344 -0.019903
-v 0.105751 0.423702 -0.018323
-v -0.072444 0.431344 -0.019903
-v -0.105751 0.423702 -0.018323
-v 0.092854 0.224217 0.125561
-v 0.091015 0.272517 0.112949
-v -0.091015 0.272517 0.112949
-v -0.092854 0.224217 0.125561
-v 0.096625 0.300218 0.087818
-v -0.096625 0.300218 0.087818
-v 0.166400 0.322243 0.045884
-v 0.160419 0.347146 0.040013
-v -0.166400 0.322243 0.045884
-v -0.160419 0.347146 0.040013
-v 0.155416 0.378447 0.031719
-v -0.155416 0.378447 0.031719
-v 0.152422 0.401623 0.014026
-v -0.152422 0.401623 0.014026
-v 0.171227 0.297964 0.026533
-v -0.171227 0.297964 0.026533
-v 0.164801 0.308772 -0.004621
-v -0.164801 0.308772 -0.004621
-v 0.173611 0.295002 -0.030238
-v -0.173611 0.295002 -0.030238
-v 0.165293 0.323442 -0.063805
-v -0.165293 0.323442 -0.063805
-v 0.161076 0.356632 -0.069383
-v -0.161076 0.356632 -0.069383
-v 0.154754 0.399035 -0.056921
-v -0.154754 0.399035 -0.056921
-v 0.150386 0.418480 -0.017331
-v -0.150386 0.418480 -0.017331
-v 0.216401 0.339678 0.034547
-v 0.214465 0.356975 0.032762
-v -0.216401 0.339678 0.034547
-v -0.214465 0.356975 0.032762
-v 0.210018 0.381776 0.027264
-v -0.210018 0.381776 0.027264
-v 0.204425 0.404079 0.011413
-v -0.204425 0.404079 0.011413
-v 0.216476 0.324061 0.021081
-v -0.216476 0.324061 0.021081
-v 0.214426 0.329137 -0.002652
-v -0.214426 0.329137 -0.002652
-v 0.216295 0.320349 -0.024596
-v -0.216295 0.320349 -0.024596
-v 0.214267 0.336599 -0.045264
-v -0.214267 0.336599 -0.045264
-v 0.213328 0.366624 -0.059141
-v -0.213328 0.366624 -0.059141
-v 0.208223 0.404733 -0.047266
-v -0.208223 0.404733 -0.047266
-v 0.203466 0.419033 -0.012613
-v -0.203466 0.419033 -0.012613
-v 0.488831 0.356390 0.023890
-v 0.489977 0.345045 0.021617
-v 0.520610 0.345124 0.024929
-v 0.521134 0.357213 0.018884
-v -0.520610 0.345124 0.024929
-v -0.489977 0.345045 0.021617
-v -0.488831 0.356390 0.023890
-v -0.521134 0.357213 0.018884
-v 0.487437 0.374388 0.018113
-v 0.521405 0.372480 0.014779
-v -0.487437 0.374388 0.018113
-v -0.521405 0.372480 0.014779
-v 0.486707 0.386003 0.008811
-v 0.521428 0.386809 0.008662
-v -0.486707 0.386003 0.008811
-v -0.521428 0.386809 0.008662
-v 0.493371 0.335005 0.015946
-v 0.521196 0.333077 0.018413
-v -0.521196 0.333077 0.018413
-v -0.493371 0.335005 0.015946
-v 0.494359 0.330594 -0.002983
-v 0.518669 0.325532 -0.003920
-v -0.518669 0.325532 -0.003920
-v -0.494359 0.330594 -0.002983
-v 0.494024 0.334879 -0.022015
-v 0.518389 0.329385 -0.022644
-v -0.518389 0.329385 -0.022644
-v -0.494024 0.334879 -0.022015
-v 0.492412 0.341375 -0.038531
-v 0.518372 0.341479 -0.041156
-v -0.518372 0.341479 -0.041156
-v -0.492412 0.341375 -0.038531
-v 0.489828 0.368057 -0.042244
-v 0.518233 0.364301 -0.045253
-v -0.518233 0.364301 -0.045253
-v -0.489828 0.368057 -0.042244
-v 0.488771 0.383914 -0.037272
-v 0.519243 0.380672 -0.037743
-v -0.519243 0.380672 -0.037743
-v -0.488771 0.383914 -0.037272
-v 0.488865 0.390568 -0.013032
-v 0.520728 0.393244 -0.015684
-v -0.520728 0.393244 -0.015684
-v -0.488865 0.390568 -0.013032
-v 0.692376 0.341604 0.019592
-v 0.691333 0.349349 0.021623
-v -0.692376 0.341604 0.019592
-v -0.691333 0.349349 0.021623
-v 0.691961 0.360002 0.018008
-v -0.691961 0.360002 0.018008
-v 0.692377 0.367216 0.008419
-v -0.692377 0.367216 0.008419
-v 0.690457 0.332916 0.009755
-v -0.690457 0.332916 0.009755
-v 0.689124 0.329597 -0.003385
-v -0.689124 0.329597 -0.003385
-v 0.688861 0.332637 -0.016127
-v -0.688861 0.332637 -0.016127
-v 0.687995 0.340210 -0.030483
-v -0.687995 0.340210 -0.030483
-v 0.688442 0.353105 -0.033631
-v -0.688442 0.353105 -0.033631
-v 0.690693 0.364958 -0.026027
-v -0.690693 0.364958 -0.026027
-v 0.693298 0.365888 -0.008105
-v -0.693298 0.365888 -0.008105
-v 0.806378 0.340617 0.025688
-v -0.806378 0.340617 0.025688
-v 0.806820 0.356133 0.026379
-v -0.806820 0.356133 0.026379
-v 0.806221 0.362954 0.017113
-v -0.806221 0.362954 0.017113
-v 0.805809 0.333323 0.016058
-v -0.805809 0.333323 0.016058
-v 0.804907 0.331306 0.004464
-v -0.804907 0.331306 0.004464
-v 0.804885 0.331186 -0.007792
-v -0.804885 0.331186 -0.007792
-v 0.806006 0.335533 -0.021118
-v -0.806006 0.335533 -0.021118
-v 0.807614 0.350365 -0.027273
-v -0.807614 0.350365 -0.027273
-v 0.807693 0.359023 -0.020037
-v -0.807693 0.359023 -0.020037
-v 0.806064 0.362992 -0.000051
-v -0.806064 0.362992 -0.000051
-v 0.000000 -0.186187 0.101558
-v 0.069624 -0.171457 0.096532
-v -0.069624 -0.171457 0.096532
-v 0.127068 -0.141359 0.070270
-v -0.127068 -0.141359 0.070270
-v 0.153729 -0.129082 0.048406
-v -0.153729 -0.129082 0.048406
-v 0.149725 -0.134013 -0.010278
-v -0.149725 -0.134013 -0.010278
-v 0.138767 -0.151550 -0.050662
-v -0.138767 -0.151550 -0.050662
-v 0.116209 -0.168172 -0.087439
-v -0.116209 -0.168172 -0.087439
-v 0.077981 -0.186699 -0.106863
-v -0.077981 -0.186699 -0.106863
-v 0.000000 -0.202136 -0.098890
-v 0.000000 -0.243467 0.102964
-v 0.079334 -0.207165 0.094609
-v -0.079334 -0.207165 0.094609
-v 0.137730 -0.179296 0.079383
-v -0.137730 -0.179296 0.079383
-v 0.170517 -0.165461 0.045509
-v -0.170517 -0.165461 0.045509
-v 0.167940 -0.172402 -0.007351
-v -0.167940 -0.172402 -0.007351
-v 0.158518 -0.198068 -0.047313
-v -0.158518 -0.198068 -0.047313
-v 0.129888 -0.226457 -0.083776
-v -0.129888 -0.226457 -0.083776
-v 0.080208 -0.253490 -0.109962
-v -0.080208 -0.253490 -0.109962
-v 0.000000 -0.258291 -0.106410
-v 0.000000 -0.311995 0.094923
-v 0.093020 -0.258325 0.099785
-v -0.093020 -0.258325 0.099785
-v 0.143769 -0.233862 0.080608
-v -0.143769 -0.233862 0.080608
-v 0.174905 -0.223524 0.049887
-v -0.174905 -0.223524 0.049887
-v 0.177616 -0.226994 -0.002974
-v -0.177616 -0.226994 -0.002974
-v 0.169730 -0.254398 -0.044118
-v -0.169730 -0.254398 -0.044118
-v 0.136650 -0.283899 -0.070695
-v -0.136650 -0.283899 -0.070695
-v 0.083666 -0.310461 -0.091053
-v -0.083666 -0.310461 -0.091053
-v 0.000000 -0.331772 -0.084989
-v 0.103268 -0.423815 0.090462
-v 0.065629 -0.423751 0.086896
-v 0.076433 -0.557391 0.057693
-v 0.102900 -0.551560 0.061142
-v -0.076433 -0.557391 0.057693
-v -0.065629 -0.423751 0.086896
-v -0.103268 -0.423815 0.090462
-v -0.102900 -0.551560 0.061142
-v 0.140697 -0.421586 0.068706
-v 0.132262 -0.543893 0.041001
-v -0.140697 -0.421586 0.068706
-v -0.132262 -0.543893 0.041001
-v 0.163602 -0.421783 0.039912
-v 0.155167 -0.539764 0.016662
-v -0.163602 -0.421783 0.039912
-v -0.155167 -0.539764 0.016662
-v 0.166559 -0.424371 -0.004855
-v 0.158124 -0.537545 -0.028330
-v -0.166559 -0.424371 -0.004855
-v -0.158124 -0.537545 -0.028330
-v 0.156671 -0.427175 -0.043549
-v 0.148236 -0.539045 -0.067626
-v -0.156671 -0.427175 -0.043549
-v -0.148236 -0.539045 -0.067626
-v 0.133496 -0.431901 -0.066263
-v 0.125062 -0.544528 -0.082891
-v -0.133496 -0.431901 -0.066263
-v -0.125062 -0.544528 -0.082891
-v 0.088396 -0.437785 -0.071549
-v 0.079962 -0.553541 -0.087463
-v -0.088396 -0.437785 -0.071549
-v -0.079962 -0.553541 -0.087463
-v 0.048401 -0.439291 -0.071294
-v 0.055434 -0.557113 -0.076402
-v -0.048401 -0.439291 -0.071294
-v -0.055434 -0.557113 -0.076402
-v 0.078320 -0.632359 0.039968
-v 0.103072 -0.626232 0.041520
-v -0.078320 -0.632359 0.039968
-v -0.103072 -0.626232 0.041520
-v 0.131713 -0.621652 0.023575
-v -0.131713 -0.621652 0.023575
-v 0.152979 -0.617556 -0.000565
-v -0.152979 -0.617556 -0.000565
-v 0.155712 -0.618497 -0.044676
-v -0.155712 -0.618497 -0.044676
-v 0.146520 -0.622028 -0.072679
-v -0.146520 -0.622028 -0.072679
-v 0.124977 -0.632606 -0.094791
-v -0.124977 -0.632606 -0.094791
-v 0.083156 -0.641483 -0.098322
-v -0.083156 -0.641483 -0.098322
-v 0.087826 -0.734290 0.013064
-v 0.103760 -0.735007 0.015215
-v -0.087826 -0.734290 0.013064
-v -0.103760 -0.735007 0.015215
-v 0.131006 -0.737313 0.005287
-v -0.131006 -0.737313 0.005287
-v 0.147233 -0.741317 -0.018640
-v -0.147233 -0.741317 -0.018640
-v 0.154056 -0.744697 -0.053215
-v -0.154056 -0.744697 -0.053215
-v 0.141099 -0.739783 -0.085196
-v -0.141099 -0.739783 -0.085196
-v 0.125548 -0.735819 -0.103837
-v -0.125548 -0.735819 -0.103837
-v 0.087572 -0.733156 -0.105790
-v -0.087572 -0.733156 -0.105790
-v 0.028208 -0.430363 0.039591
-v 0.042134 -0.565713 0.021245
-v -0.042134 -0.565713 0.021245
-v -0.028208 -0.430363 0.039591
-v 0.022680 -0.429541 -0.020282
-v 0.034753 -0.562994 -0.037362
-v -0.034753 -0.562994 -0.037362
-v -0.022680 -0.429541 -0.020282
-v 0.060216 -0.644380 -0.078672
-v -0.060216 -0.644380 -0.078672
-v 0.073062 -0.732420 -0.086498
-v -0.073062 -0.732420 -0.086498
-v 0.045699 -0.638742 -0.046610
-v -0.045699 -0.638742 -0.046610
-v 0.049570 -0.639812 -0.000320
-v -0.049570 -0.639812 -0.000320
-v 0.059220 -0.730183 -0.060637
-v -0.059220 -0.730183 -0.060637
-v 0.061322 -0.731764 -0.013247
-v -0.061322 -0.731764 -0.013247
-v 0.174386 -0.283555 0.045101
-v 0.177794 -0.284006 -0.006727
-v -0.177794 -0.284006 -0.006727
-v -0.174386 -0.283555 0.045101
-v 0.164694 -0.303724 -0.045351
-v -0.164694 -0.303724 -0.045351
-v 0.087619 -0.341069 -0.076522
-v 0.019462 -0.361788 -0.074514
-v -0.019462 -0.361788 -0.074514
-v -0.087619 -0.341069 -0.076522
-v 0.000000 -0.365169 -0.058059
-v 0.138006 -0.321613 -0.068252
-v -0.138006 -0.321613 -0.068252
-v 0.000000 -0.393034 0.007298
-v 0.046978 -0.344842 0.094157
-v 0.098144 -0.311260 0.100673
-v -0.046978 -0.344842 0.094157
-v -0.098144 -0.311260 0.100673
-v 0.000000 -0.342486 0.080007
-v 0.026180 -0.366067 0.084524
-v -0.026180 -0.366067 0.084524
-v 0.148279 -0.285636 0.075962
-v -0.148279 -0.285636 0.075962
-v 0.083111 -0.826219 0.010766
-v 0.106922 -0.826375 0.012166
-v -0.106922 -0.826375 0.012166
-v -0.083111 -0.826219 0.010766
-v 0.079469 -0.893976 0.012477
-v 0.106418 -0.896411 0.018160
-v -0.106418 -0.896411 0.018160
-v -0.079469 -0.893976 0.012477
-v 0.132188 -0.828770 0.005815
-v -0.132188 -0.828770 0.005815
-v 0.132514 -0.898475 0.010654
-v -0.132514 -0.898475 0.010654
-v 0.161708 -0.834564 -0.015031
-v -0.161708 -0.834564 -0.015031
-v 0.161360 -0.904617 -0.009743
-v -0.161360 -0.904617 -0.009743
-v 0.166054 -0.835136 -0.053750
-v -0.166054 -0.835136 -0.053750
-v 0.170493 -0.900871 -0.051503
-v -0.170493 -0.900871 -0.051503
-v 0.153633 -0.832713 -0.083566
-v -0.153633 -0.832713 -0.083566
-v 0.155576 -0.900182 -0.079390
-v -0.155576 -0.900182 -0.079390
-v 0.124894 -0.828009 -0.102885
-v -0.124894 -0.828009 -0.102885
-v 0.129381 -0.896004 -0.100691
-v -0.129381 -0.896004 -0.100691
-v 0.092745 -0.824780 -0.109876
-v -0.092745 -0.824780 -0.109876
-v 0.094862 -0.892207 -0.110491
-v -0.094862 -0.892207 -0.110491
-v 0.074839 -0.823463 -0.092812
-v -0.074839 -0.823463 -0.092812
-v 0.077633 -0.889320 -0.093210
-v -0.077633 -0.889320 -0.093210
-v 0.065963 -0.822783 -0.018036
-v -0.065963 -0.822783 -0.018036
-v 0.065918 -0.888732 -0.012730
-v -0.065918 -0.888732 -0.012730
-v 0.060040 -0.820384 -0.064480
-v -0.060040 -0.820384 -0.064480
-v 0.061383 -0.884859 -0.063527
-v -0.061383 -0.884859 -0.063527
-v 0.074989 -0.971918 0.016239
-v 0.100867 -0.976108 0.028397
-v -0.100867 -0.976108 0.028397
-v -0.074989 -0.971918 0.016239
-v 0.074166 -1.072515 0.030019
-v 0.099655 -1.066070 0.049588
-v -0.099655 -1.066070 0.049588
-v -0.074166 -1.072515 0.030019
-v 0.134041 -0.978316 0.016510
-v -0.134041 -0.978316 0.016510
-v 0.134743 -1.064431 0.03462...
[truncated message content] |
|
From: <tre...@us...> - 2007-09-23 00:32:40
|
Revision: 432
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=432&view=rev
Author: trevorolio
Date: 2007-09-22 17:32:43 -0700 (Sat, 22 Sep 2007)
Log Message:
-----------
Added a metric ton of Creative Commons licensed art from http://www.lowpolycoop.com/ and a space to demo it.
Added Paths:
-----------
maven/trunk/ogoglio-server/src/main/resources/populate/space-2
maven/trunk/ogoglio-server/src/main/resources/populate/template-43/
maven/trunk/ogoglio-server/src/main/resources/populate/template-43/BikeRack.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-43/BikeRack.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-43/BikeRack.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-43/bike_rack_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-43/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-44/
maven/trunk/ogoglio-server/src/main/resources/populate/template-44/Balloons.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-44/Balloons.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-44/Balloons.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-44/Balloons.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-44/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-45/
maven/trunk/ogoglio-server/src/main/resources/populate/template-45/Broom.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-45/Broom.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-45/Broom.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-45/Broom.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-45/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-46/
maven/trunk/ogoglio-server/src/main/resources/populate/template-46/CafeTable.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-46/CafeTable.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-46/CafeTable.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-46/CafeTable.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-46/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-47/
maven/trunk/ogoglio-server/src/main/resources/populate/template-47/CinderBlock.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-47/CinderBlock.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-47/CinderBlock.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-47/CinderBlock.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-47/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-48/
maven/trunk/ogoglio-server/src/main/resources/populate/template-48/CrosswalkButton.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-48/CrosswalkButton.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-48/CrosswalkButton.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-48/crosswalk_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-48/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-49/
maven/trunk/ogoglio-server/src/main/resources/populate/template-49/Fence.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-49/Fence.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-49/Fence.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-49/fence_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-49/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-50/
maven/trunk/ogoglio-server/src/main/resources/populate/template-50/PipeFence.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-50/PipeFence.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-50/PipeFence.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-50/fence_pipe_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-50/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-51/
maven/trunk/ogoglio-server/src/main/resources/populate/template-51/Floodlight.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-51/Floodlight.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-51/Floodlight.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-51/floodlight_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-51/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-52/
maven/trunk/ogoglio-server/src/main/resources/populate/template-52/GardenBorder.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-52/GardenBorder.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-52/GardenBorder.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-52/garden_border_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-52/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-53/
maven/trunk/ogoglio-server/src/main/resources/populate/template-53/Hydrant.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-53/Hydrant.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-53/Hydrant.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-53/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-53/hydrant_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-54/
maven/trunk/ogoglio-server/src/main/resources/populate/template-54/Lamp.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-54/Lamp.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-54/Lamp.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-54/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-54/lamp_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-55/
maven/trunk/ogoglio-server/src/main/resources/populate/template-55/GasLamp.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-55/GasLamp.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-55/GasLamp.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-55/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-55/lamp_002_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-56/
maven/trunk/ogoglio-server/src/main/resources/populate/template-56/LawnLight.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-56/LawnLight.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-56/LawnLight.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-56/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-56/lawn_light_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-57/
maven/trunk/ogoglio-server/src/main/resources/populate/template-57/LightPole.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-57/LightPole.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-57/LightPole.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-57/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-57/lightpole_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-58/
maven/trunk/ogoglio-server/src/main/resources/populate/template-58/Mailbox.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-58/Mailbox.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-58/Mailbox.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-58/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-58/mailbox_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-59/
maven/trunk/ogoglio-server/src/main/resources/populate/template-59/PrivateMailbox.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-59/PrivateMailbox.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-59/PrivateMailbox.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-59/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-59/mailbox_002_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-60/
maven/trunk/ogoglio-server/src/main/resources/populate/template-60/ShortMailbox.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-60/ShortMailbox.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-60/ShortMailbox.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-60/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-60/mailbox_003_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-61/
maven/trunk/ogoglio-server/src/main/resources/populate/template-61/GasMeter.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-61/GasMeter.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-61/GasMeter.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-61/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-61/meter_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-61/meter_001_tex_a.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-62/
maven/trunk/ogoglio-server/src/main/resources/populate/template-62/Palette.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-62/Palette.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-62/Palette.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-62/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-62/palette_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-63/
maven/trunk/ogoglio-server/src/main/resources/populate/template-63/ParkingBarrier.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-63/ParkingBarrier.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-63/ParkingBarrier.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-63/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-63/parking_barrier_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-64/
maven/trunk/ogoglio-server/src/main/resources/populate/template-64/PipeCage.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-64/PipeCage.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-64/PipeCage.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-64/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-64/pipe_cage_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-65/
maven/trunk/ogoglio-server/src/main/resources/populate/template-65/FlowerPot.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-65/FlowerPot.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-65/FlowerPot.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-65/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-65/pot_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-66/
maven/trunk/ogoglio-server/src/main/resources/populate/template-66/Rail.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-66/Rail.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-66/Rail.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-66/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-66/rail_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-67/
maven/trunk/ogoglio-server/src/main/resources/populate/template-67/RailEndcap.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-67/RailEndcap.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-67/RailEndcap.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-67/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-67/rail_end_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-68/
maven/trunk/ogoglio-server/src/main/resources/populate/template-68/SandwichBoard.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-68/SandwichBoard.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-68/SandwichBoard.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-68/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-68/sandwich_bd_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-69/
maven/trunk/ogoglio-server/src/main/resources/populate/template-69/SidewalkBarrier.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-69/SidewalkBarrier.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-69/SidewalkBarrier.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-69/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-69/sidewalk_barr_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-70/
maven/trunk/ogoglio-server/src/main/resources/populate/template-70/Sign25MilesPerHour.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-70/Sign25MilesPerHour.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-70/Sign25MilesPerHour.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-70/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-70/sign_25mph_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-71/
maven/trunk/ogoglio-server/src/main/resources/populate/template-71/SignBump.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-71/SignBump.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-71/SignBump.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-71/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-71/sign_bump_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-72/
maven/trunk/ogoglio-server/src/main/resources/populate/template-72/SignBusStop.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-72/SignBusStop.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-72/SignBusStop.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-72/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-72/sign_bus_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-73/
maven/trunk/ogoglio-server/src/main/resources/populate/template-73/SignCrossing.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-73/SignCrossing.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-73/SignCrossing.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-73/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-73/sign_crossing_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-74/
maven/trunk/ogoglio-server/src/main/resources/populate/template-74/Spigot.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-74/Spigot.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-74/Spigot.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-74/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-74/spigot_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-75/
maven/trunk/ogoglio-server/src/main/resources/populate/template-75/Sprinkler.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-75/Sprinkler.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-75/Sprinkler.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-75/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-75/sprinkler_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-76/
maven/trunk/ogoglio-server/src/main/resources/populate/template-76/StopSign.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-76/StopSign.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-76/StopSign.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-76/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-76/stop_sign_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-76/street_bench_tex.png
maven/trunk/ogoglio-server/src/main/resources/populate/template-77/
maven/trunk/ogoglio-server/src/main/resources/populate/template-77/StreetBench.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-77/StreetBench.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-77/StreetBench.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-77/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-77/street_bench_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-78/
maven/trunk/ogoglio-server/src/main/resources/populate/template-78/StreetSign.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-78/StreetSign.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-78/StreetSign.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-78/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-78/street_sign_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-79/
maven/trunk/ogoglio-server/src/main/resources/populate/template-79/Streetlight.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-79/Streetlight.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-79/Streetlight.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-79/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-79/streetlight_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-80/
maven/trunk/ogoglio-server/src/main/resources/populate/template-80/DoubleStreetlight.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-80/DoubleStreetlight.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-80/DoubleStreetlight.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-80/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-80/streetlight_002_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-81/
maven/trunk/ogoglio-server/src/main/resources/populate/template-81/OldFashionedStreetlight.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-81/OldFashionedStreetlight.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-81/OldFashionedStreetlight.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-81/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-81/streetlight_003_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-82/
maven/trunk/ogoglio-server/src/main/resources/populate/template-82/Switchbox.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-82/Switchbox.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-82/Switchbox.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-82/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-82/switchbox_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-83/
maven/trunk/ogoglio-server/src/main/resources/populate/template-83/Pylon.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-83/Pylon.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-83/Pylon.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-83/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-83/traffic_cone_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-84/
maven/trunk/ogoglio-server/src/main/resources/populate/template-84/TrashCan1.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-84/TrashCan1.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-84/TrashCan1.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-84/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-84/trash_can_001_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-85/
maven/trunk/ogoglio-server/src/main/resources/populate/template-85/TrashCan2.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-85/TrashCan2.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-85/TrashCan2.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-85/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-85/trash_can_002_tex.jpg
maven/trunk/ogoglio-server/src/main/resources/populate/template-86/
maven/trunk/ogoglio-server/src/main/resources/populate/template-86/WireConduit.blend
maven/trunk/ogoglio-server/src/main/resources/populate/template-86/WireConduit.mtl
maven/trunk/ogoglio-server/src/main/resources/populate/template-86/WireConduit.obj
maven/trunk/ogoglio-server/src/main/resources/populate/template-86/gilman_license.txt
maven/trunk/ogoglio-server/src/main/resources/populate/template-86/wire_cond_001_tex.jpg
Added: maven/trunk/ogoglio-server/src/main/resources/populate/space-2
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/populate/space-2 (rev 0)
+++ maven/trunk/ogoglio-server/src/main/resources/populate/space-2 2007-09-23 00:32:43 UTC (rev 432)
@@ -0,0 +1 @@
+<space ownerusername="library" sealevel="0.0" simid="1" displayname="Testville" maxguests="0" displaysea="false" spaceid="1" published="true"><thing templateid="57" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Light Pole" scaley="1.0" templateowner="library" scalex="1.0" possessionid="1" thingid="1" z="6.0" y="1.0" x="0.0" ownerusername="library"/><thing templateid="70" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Sign25 Miles Per Hour" scaley="1.0" templateowner="library" scalex="1.0" possessionid="2" thingid="2" z="-19.0" y="0.0" x="2.0" ownerusername="library"/><thing templateid="50" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Pipe Fence" scaley="1.0" templateowner="library" scalex="1.0" possessionid="3" thingid="3" z="0.0" y="0.0" x="2.0" ownerusername="library"/><thing templateid="64" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Pipe Cage" scaley="1.0" templateowner="library" scalex="1.0" possessionid="4" thingid="4" z="-13.0" y="0.0" x="-3.0" ownerusername="library"/><thing templateid="82" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Switchbox" scaley="1.0" templateowner="library" scalex="1.0" possessionid="5" thingid="5" z="-25.0" y="0.0" x="4.0" ownerusername="library"/><thing templateid="58" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Mailbox" scaley="1.0" templateowner="library" scalex="1.0" possessionid="6" thingid="6" z="-12.0" y="0.0" x="8.0" ownerusername="library"/><thing templateid="71" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Sign Bump" scaley="1.0" templateowner="library" scalex="1.0" possessionid="7" thingid="7" z="-17.0" y="0.0" x="0.0" ownerusername="library"/><thing templateid="75" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Sprinkler" scaley="1.0" templateowner="library" scalex="1.0" possessionid="8" thingid="8" z="-5.0" y="0.0" x="5.0" ownerusername="library"/><thing templateid="49" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Fence" scaley="1.0" templateowner="library" scalex="1.0" possessionid="9" thingid="9" z="-6.0" y="0.0" x="-5.0" ownerusername="library"/><thing templateid="63" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Parking Barrier" scaley="1.0" templateowner="library" scalex="1.0" possessionid="10" thingid="10" z="-17.0" y="0.0" x="3.0" ownerusername="library"/><thing templateid="72" rz="0.0" ry="-0.1081951345301089" rx="0.0" rw="0.9941296760805463" scalez="1.0000000000000016" displayname="Sign Bus Stop" scaley="1.0000000000000016" templateowner="library" scalex="1.0000000000000016" possessionid="11" thingid="11" z="-35.0" y="0.0" x="12.0" ownerusername="library"/><thing templateid="74" rz="0.0" ry="-0.6816387600233345" rx="0.0" rw="0.7316888688738207" scalez="1.0" displayname="Spigot" scaley="1.0" templateowner="library" scalex="1.0" possessionid="12" thingid="12" z="-5.0" y="1.0" x="-3.0" ownerusername="library"/><thing templateid="80" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Double Streetlight" scaley="1.0" templateowner="library" scalex="1.0" possessionid="13" thingid="13" z="0.0" y="0.0" x="-9.0" ownerusername="library"/><thing templateid="51" rz="0.0" ry="0.6816387600233345" rx="0.0" rw="0.7316888688738207" scalez="1.0" displayname="Floodlight" scaley="1.0" templateowner="library" scalex="1.0" possessionid="14" thingid="14" z="-8.0" y="3.0" x="-4.0" ownerusername="library"/><thing templateid="73" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Sign Crossing" scaley="1.0" templateowner="library" scalex="1.0" possessionid="15" thingid="15" z="-20.0" y="0.0" x="-2.0" ownerusername="library"/><thing templateid="62" rz="-0.2422096054295765" ry="-0.4519453132273099" rx="0.6039063177273147" rw="0.6102270891221998" scalez="0.9999999999999997" displayname="Palette" scaley="0.9999999999999997" templateowner="library" scalex="0.9999999999999997" possessionid="16" thingid="16" z="-40.0" y="1.0" x="3.0" ownerusername="library"/><thing templateid="48" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Crosswalk Button" scaley="1.0" templateowner="library" scalex="1.0" possessionid="17" thingid="17" z="2.0" y="2.0" x="2.0" ownerusername="library"/><thing templateid="43" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Bike Rack" scaley="1.0" templateowner="library" scalex="1.0" possessionid="18" thingid="18" z="-37.0" y="0.0" x="11.0" ownerusername="library"/><thing templateid="56" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Lawn Light" scaley="1.0" templateowner="library" scalex="1.0" possessionid="19" thingid="19" z="0.0" y="0.0" x="-2.0" ownerusername="library"/><thing templateid="81" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Old Fashioned Streetlight" scaley="1.0" templateowner="library" scalex="1.0" possessionid="20" thingid="20" z="-11.0" y="0.0" x="11.0" ownerusername="library"/><thing templateid="65" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Flower Pot" scaley="1.0" templateowner="library" scalex="1.0" possessionid="21" thingid="21" z="-16.0" y="1.0" x="-3.0" ownerusername="library"/><thing templateid="86" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Wire Conduit" scaley="1.0" templateowner="library" scalex="1.0" possessionid="22" thingid="22" z="0.0" y="0.0" x="-17.0" ownerusername="library"/><thing templateid="46" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Cafe Table" scaley="1.0" templateowner="library" scalex="1.0" possessionid="23" thingid="23" z="0.0" y="0.0" x="6.0" ownerusername="library"/><thing templateid="60" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Short Mailbox" scaley="1.0" templateowner="library" scalex="1.0" possessionid="24" thingid="24" z="-6.0" y="3.0" x="-2.0" ownerusername="library"/><thing templateid="76" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Stop Sign" scaley="1.0" templateowner="library" scalex="1.0" possessionid="25" thingid="25" z="-35.0" y="0.0" x="0.0" ownerusername="library"/><thing templateid="67" rz="0.0" ry="-0.9974949866040559" rx="0.0" rw="0.07073720166769953" scalez="1.0" displayname="Rail Endcap" scaley="1.0" templateowner="library" scalex="1.0" possessionid="26" thingid="26" z="-5.0" y="0.0" x="0.0" ownerusername="library"/><thing templateid="53" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Hydrant" scaley="1.0" templateowner="library" scalex="1.0" possessionid="27" thingid="27" z="-11.0" y="0.0" x="3.0" ownerusername="library"/><thing templateid="45" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Broom" scaley="1.0" templateowner="library" scalex="1.0" possessionid="28" thingid="28" z="-13.0" y="1.0" x="-1.0" ownerusername="library"/><thing templateid="79" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Streetlight" scaley="1.0" templateowner="library" scalex="1.0" possessionid="29" thingid="29" z="0.0" y="0.0" x="-4.0" ownerusername="library"/><thing templateid="54" rz="0.0" ry="-0.4794255386042033" rx="0.0" rw="0.8775825618903726" scalez="1.0" displayname="Lamp" scaley="1.0" templateowner="library" scalex="1.0" possessionid="30" thingid="30" z="-5.0" y="4.0" x="2.0" ownerusername="library"/><thing templateid="68" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Sandwich Board" scaley="1.0" templateowner="library" scalex="1.0" possessionid="31" thingid="31" z="-20.0" y="0.0" x="1.0" ownerusername="library"/><thing templateid="83" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Pylon" scaley="1.0" templateowner="library" scalex="1.0" possessionid="32" thingid="32" z="-6.0" y="0.0" x="4.0" ownerusername="library"/><thing templateid="59" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Private Mailbox" scaley="1.0" templateowner="library" scalex="1.0" possessionid="33" thingid="33" z="-12.0" y="0.0" x="9.0" ownerusername="library"/><thing templateid="84" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Trash Can1" scaley="1.0" templateowner="library" scalex="1.0" possessionid="34" thingid="34" z="0.0" y="0.0" x="-3.0" ownerusername="library"/><thing templateid="44" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Balloons" scaley="1.0" templateowner="library" scalex="1.0" possessionid="35" thingid="35" z="-9.0" y="3.0" x="7.0" ownerusername="library"/><thing templateid="55" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Gas Lamp" scaley="1.0" templateowner="library" scalex="1.0" possessionid="36" thingid="36" z="0.0" y="3.0" x="3.0" ownerusername="library"/><thing templateid="69" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Sidewalk Barrier" scaley="1.0" templateowner="library" scalex="1.0" possessionid="37" thingid="37" z="-2.0" y="0.0" x="1.0" ownerusername="library"/><thing templateid="78" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Street Sign" scaley="1.0" templateowner="library" scalex="1.0" possessionid="38" thingid="38" z="-22.0" y="0.0" x="-3.0" ownerusername="library"/><thing templateid="61" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Gas Meter" scaley="1.0" templateowner="library" scalex="1.0" possessionid="39" thingid="39" z="-5.0" y="0.0" x="-4.0" ownerusername="library"/><thing templateid="85" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Trash Can2" scaley="1.0" templateowner="library" scalex="1.0" possessionid="40" thingid="40" z="-12.0" y="0.0" x="4.0" ownerusername="library"/><thing templateid="66" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Rail" scaley="1.0" templateowner="library" scalex="1.0" possessionid="41" thingid="41" z="-5.0" y="0.0" x="-1.0" ownerusername="library"/><thing templateid="77" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Street Bench" scaley="1.0" templateowner="library" scalex="1.0" possessionid="42" thingid="42" z="-15.0" y="0.0" x="7.0" ownerusername="library"/><thing templateid="52" rz="0.0" ry="0.0" rx="0.0" rw="1.0" scalez="1.0" displayname="Garden Border" scaley="1.0" templateowner="library" scalex="1.0" possessionid="43" thingid="43" z="-1.0" y="0.0" x="4.0" ownerusername="library"/><thing templateid="47" rz="-5.378544397142389E-17" ry="-1.373367859738978E-17" rx="0.24740395925452296" rw="0.9689124217106448" scalez="1.0" displayname="Cinder Block" scaley="1.0" templateowner="library" scalex="1.0" possessionid="44" thingid="44" z="-5.0" y="0.0" x="-2.0" ownerusername="library"/></space>
\ No newline at end of file
Added: maven/trunk/ogoglio-server/src/main/resources/populate/template-43/BikeRack.blend
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/resources/populate/template-43/BikeRack.blend
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/resources/populate/template-43/BikeRack.mtl
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/populate/template-43/BikeRack.mtl (rev 0)
+++ maven/trunk/ogoglio-server/src/main/resources/populate/template-43/BikeRack.mtl 2007-09-23 00:32:43 UTC (rev 432)
@@ -0,0 +1,12 @@
+# Blender3D MTL File: BikeRack.blend
+# Material Count: 1
+newmtl None_bike_rack_tex.jpg
+Ns 0
+Ka 0.000000 0.000000 0.000000
+Kd 0.8 0.8 0.8
+Ks 0.8 0.8 0.8
+d 1
+illum 2
+map_Kd bike_rack_tex.jpg
+
+
Added: maven/trunk/ogoglio-server/src/main/resources/populate/template-43/BikeRack.obj
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/populate/template-43/BikeRack.obj (rev 0)
+++ maven/trunk/ogoglio-server/src/main/resources/populate/template-43/BikeRack.obj 2007-09-23 00:32:43 UTC (rev 432)
@@ -0,0 +1,560 @@
+# Blender3D v245 OBJ File: BikeRack.blend
+# www.blender3d.org
+mtllib BikeRack.mtl
+o bike_rack
+v -0.166481 0.002994 -0.013962
+v -0.166481 0.002994 0.013962
+v -0.186226 0.002994 0.033707
+v -0.214150 0.002994 0.033707
+v -0.233895 0.002994 0.013962
+v -0.233895 0.002994 -0.013962
+v -0.214150 0.002994 -0.033707
+v -0.186226 0.002994 -0.033707
+v -0.166481 0.736449 -0.013962
+v -0.166481 0.736449 0.013962
+v -0.186226 0.736449 0.033707
+v -0.214150 0.736449 0.033707
+v -0.233895 0.736449 0.013962
+v -0.233895 0.736449 -0.013962
+v -0.214150 0.736449 -0.033707
+v -0.186226 0.736449 -0.033707
+v -0.200188 0.002994 -0.000000
+v -0.174599 0.793985 -0.033707
+v -0.200869 0.803452 -0.033707
+v -0.219444 0.810147 -0.013962
+v -0.219444 0.810147 0.013962
+v -0.200869 0.803452 0.033707
+v -0.174599 0.793985 0.033707
+v -0.156024 0.787290 0.013962
+v -0.156024 0.787290 -0.013962
+v -0.110106 0.843777 -0.013962
+v -0.110106 0.843777 0.013962
+v -0.124966 0.856778 0.033707
+v -0.145982 0.875165 0.033707
+v -0.160842 0.888166 0.013962
+v -0.160842 0.888166 -0.013962
+v -0.145982 0.875165 -0.033707
+v -0.124966 0.856778 -0.033707
+v -0.047841 0.886460 -0.033707
+v -0.059009 0.912054 -0.033707
+v -0.066906 0.930151 -0.013962
+v -0.066906 0.930151 0.013962
+v -0.059009 0.912054 0.033707
+v -0.047841 0.886460 0.033707
+v -0.039944 0.868363 0.013962
+v -0.039944 0.868364 -0.013962
+v 0.007064 0.877011 -0.013962
+v 0.007064 0.877011 0.013962
+v 0.007064 0.896385 0.033707
+v 0.007064 0.923784 -0.033707
+v 0.007064 0.896385 -0.033707
+v 0.007064 0.943158 -0.013962
+v 0.007064 0.943159 0.013962
+v 0.007064 0.923785 0.033707
+v 0.054072 0.868364 -0.013962
+v 0.054072 0.868363 0.013962
+v 0.061969 0.886460 0.033707
+v 0.073137 0.912054 0.033707
+v 0.081034 0.930151 0.013962
+v 0.081034 0.930151 -0.013962
+v 0.073137 0.912054 -0.033707
+v 0.061969 0.886460 -0.033707
+v 0.139094 0.856778 -0.033707
+v 0.160110 0.875165 -0.033707
+v 0.174970 0.888166 -0.013962
+v 0.174970 0.888166 0.013962
+v 0.160110 0.875165 0.033707
+v 0.139094 0.856778 0.033707
+v 0.124234 0.843777 0.013962
+v 0.124234 0.843777 -0.013962
+v 0.170152 0.787290 -0.013962
+v 0.170152 0.787290 0.013962
+v 0.188728 0.793985 0.033707
+v 0.214997 0.803452 0.033707
+v 0.233572 0.810147 0.013962
+v 0.233572 0.810147 -0.013962
+v 0.214997 0.803452 -0.033707
+v 0.188728 0.793985 -0.033707
+v 0.214316 0.002994 -0.000000
+v 0.200355 0.736449 -0.033707
+v 0.228278 0.736449 -0.033707
+v 0.248023 0.736449 -0.013962
+v 0.248023 0.736449 0.013962
+v 0.228278 0.736449 0.033707
+v 0.200355 0.736449 0.033707
+v 0.180610 0.736449 0.013962
+v 0.180610 0.736449 -0.013962
+v 0.200355 0.002994 -0.033707
+v 0.228278 0.002994 -0.033707
+v 0.248023 0.002994 -0.013962
+v 0.248023 0.002994 0.013962
+v 0.228278 0.002994 0.033707
+v 0.200355 0.002994 0.033707
+v 0.180610 0.002994 0.013962
+v 0.180610 0.002994 -0.013962
+vt 0.913183 0.430134 0.0
+vt 0.968117 0.452888 0.0
+vt 0.935938 0.485068 0.0
+vt 0.913183 0.430134 0.0
+vt 0.935938 0.485068 0.0
+vt 0.890429 0.485068 0.0
+vt 0.913183 0.430134 0.0
+vt 0.890429 0.485068 0.0
+vt 0.858249 0.452888 0.0
+vt 0.913183 0.430134 0.0
+vt 0.858249 0.452888 0.0
+vt 0.858249 0.407379 0.0
+vt 0.913183 0.430134 0.0
+vt 0.858249 0.407379 0.0
+vt 0.890429 0.375200 0.0
+vt 0.913183 0.430134 0.0
+vt 0.890429 0.375200 0.0
+vt 0.935938 0.375200 0.0
+vt 0.913183 0.430134 0.0
+vt 0.935938 0.375200 0.0
+vt 0.968117 0.407379 0.0
+vt 0.968117 0.407379 0.0
+vt 0.968117 0.452888 0.0
+vt 0.913183 0.430134 0.0
+vt 0.077176 0.015137 0.0
+vt 0.077176 0.715219 0.0
+vt 0.025544 0.715219 0.0
+vt 0.025544 0.015137 0.0
+vt 0.406818 0.015137 0.0
+vt 0.406818 0.715219 0.0
+vt 0.356479 0.715219 0.0
+vt 0.356479 0.015137 0.0
+vt 0.356479 0.015137 0.0
+vt 0.356479 0.715219 0.0
+vt 0.310731 0.715219 0.0
+vt 0.310731 0.015137 0.0
+vt 0.310731 0.015137 0.0
+vt 0.310731 0.715219 0.0
+vt 0.265070 0.715219 0.0
+vt 0.265070 0.015137 0.0
+vt 0.265070 0.015137 0.0
+vt 0.265070 0.715219 0.0
+vt 0.218923 0.715219 0.0
+vt 0.218923 0.015137 0.0
+vt 0.218923 0.015137 0.0
+vt 0.218923 0.715219 0.0
+vt 0.173605 0.715219 0.0
+vt 0.173605 0.015137 0.0
+vt 0.173605 0.015137 0.0
+vt 0.173605 0.715219 0.0
+vt 0.127125 0.715219 0.0
+vt 0.127125 0.015137 0.0
+vt 0.077176 0.715219 0.0
+vt 0.077176 0.015137 0.0
+vt 0.127125 0.015137 0.0
+vt 0.127125 0.715219 0.0
+vt 0.077176 0.715219 0.0
+vt 0.127125 0.715219 0.0
+vt 0.127125 0.776192 0.0
+vt 0.077176 0.776192 0.0
+vt 0.127125 0.715219 0.0
+vt 0.173605 0.715219 0.0
+vt 0.173605 0.776192 0.0
+vt 0.127125 0.776192 0.0
+vt 0.173605 0.715219 0.0
+vt 0.218923 0.715219 0.0
+vt 0.218923 0.776192 0.0
+vt 0.173605 0.776192 0.0
+vt 0.218923 0.715219 0.0
+vt 0.265070 0.715219 0.0
+vt 0.265070 0.776192 0.0
+vt 0.218923 0.776192 0.0
+vt 0.265070 0.715219 0.0
+vt 0.310731 0.715219 0.0
+vt 0.310731 0.776192 0.0
+vt 0.265070 0.776192 0.0
+vt 0.310731 0.715219 0.0
+vt 0.356479 0.715219 0.0
+vt 0.356479 0.776192 0.0
+vt 0.310731 0.776192 0.0
+vt 0.356479 0.715219 0.0
+vt 0.406818 0.715219 0.0
+vt 0.406818 0.776192 0.0
+vt 0.356479 0.776192 0.0
+vt 0.025544 0.715219 0.0
+vt 0.077176 0.715219 0.0
+vt 0.077176 0.776192 0.0
+vt 0.025544 0.776192 0.0
+vt 0.025544 0.776192 0.0
+vt 0.077176 0.776192 0.0
+vt 0.077176 0.852599 0.0
+vt 0.025544 0.852599 0.0
+vt 0.356479 0.776192 0.0
+vt 0.406818 0.776192 0.0
+vt 0.406818 0.852599 0.0
+vt 0.356479 0.852599 0.0
+vt 0.310731 0.776192 0.0
+vt 0.356479 0.776192 0.0
+vt 0.356479 0.852599 0.0
+vt 0.310731 0.852599 0.0
+vt 0.265070 0.776192 0.0
+vt 0.310731 0.776192 0.0
+vt 0.310731 0.852599 0.0
+vt 0.265070 0.852599 0.0
+vt 0.218923 0.776192 0.0
+vt 0.265070 0.776192 0.0
+vt 0.265070 0.852599 0.0
+vt 0.218923 0.852599 0.0
+vt 0.173605 0.776192 0.0
+vt 0.218923 0.776192 0.0
+vt 0.218923 0.852599 0.0
+vt 0.173605 0.852599 0.0
+vt 0.127125 0.776192 0.0
+vt 0.173605 0.776192 0.0
+vt 0.173605 0.852599 0.0
+vt 0.127125 0.852599 0.0
+vt 0.077176 0.776192 0.0
+vt 0.127125 0.776192 0.0
+vt 0.127125 0.852599 0.0
+vt 0.077176 0.852599 0.0
+vt 0.077176 0.852599 0.0
+vt 0.127125 0.852599 0.0
+vt 0.127125 0.931145 0.0
+vt 0.077176 0.931145 0.0
+vt 0.127125 0.852599 0.0
+vt 0.173605 0.852599 0.0
+vt 0.173605 0.931145 0.0
+vt 0.127125 0.931145 0.0
+vt 0.173605 0.852599 0.0
+vt 0.218923 0.852599 0.0
+vt 0.218923 0.931145 0.0
+vt 0.173605 0.931145 0.0
+vt 0.218923 0.852599 0.0
+vt 0.265070 0.852599 0.0
+vt 0.265070 0.931145 0.0
+vt 0.218923 0.931145 0.0
+vt 0.265070 0.852599 0.0
+vt 0.310731 0.852599 0.0
+vt 0.310731 0.931145 0.0
+vt 0.265070 0.931145 0.0
+vt 0.310731 0.852599 0.0
+vt 0.356479 0.852599 0.0
+vt 0.356479 0.931145 0.0
+vt 0.310731 0.931145 0.0
+vt 0.356479 0.852599 0.0
+vt 0.406818 0.852599 0.0
+vt 0.406818 0.931145 0.0
+vt 0.356479 0.931145 0.0
+vt 0.025544 0.852599 0.0
+vt 0.077176 0.852599 0.0
+vt 0.077176 0.931145 0.0
+vt 0.025544 0.931145 0.0
+vt 0.025544 0.931145 0.0
+vt 0.077176 0.931145 0.0
+vt 0.077176 0.989663 0.0
+vt 0.025544 0.989663 0.0
+vt 0.356479 0.931145 0.0
+vt 0.406818 0.931145 0.0
+vt 0.406818 0.989663 0.0
+vt 0.356479 0.989663 0.0
+vt 0.310731 0.931145 0.0
+vt 0.356479 0.931145 0.0
+vt 0.356479 0.989663 0.0
+vt 0.310731 0.989663 0.0
+vt 0.265070 0.931145 0.0
+vt 0.310731 0.931145 0.0
+vt 0.310731 0.989663 0.0
+vt 0.265070 0.989663 0.0
+vt 0.218923 0.931145 0.0
+vt 0.265070 0.931145 0.0
+vt 0.265070 0.989663 0.0
+vt 0.218923 0.989663 0.0
+vt 0.173605 0.931145 0.0
+vt 0.218923 0.931145 0.0
+vt 0.218923 0.989663 0.0
+vt 0.173605 0.989663 0.0
+vt 0.127125 0.931145 0.0
+vt 0.173605 0.931145 0.0
+vt 0.173605 0.989663 0.0
+vt 0.127125 0.989663 0.0
+vt 0.077176 0.931145 0.0
+vt 0.127125 0.931145 0.0
+vt 0.127125 0.989663 0.0
+vt 0.077176 0.989663 0.0
+vt 0.760828 0.931145 0.0
+vt 0.760828 0.989663 0.0
+vt 0.710954 0.989663 0.0
+vt 0.710954 0.931145 0.0
+vt 0.710954 0.931145 0.0
+vt 0.710954 0.989663 0.0
+vt 0.664251 0.989663 0.0
+vt 0.664251 0.931145 0.0
+vt 0.664251 0.931145 0.0
+vt 0.664251 0.989663 0.0
+vt 0.618707 0.989663 0.0
+vt 0.618707 0.931145 0.0
+vt 0.618707 0.931145 0.0
+vt 0.618707 0.989663 0.0
+vt 0.570270 0.989663 0.0
+vt 0.570270 0.931145 0.0
+vt 0.570270 0.931145 0.0
+vt 0.570270 0.989663 0.0
+vt 0.525733 0.989663 0.0
+vt 0.525733 0.931145 0.0
+vt 0.525733 0.931145 0.0
+vt 0.525733 0.989663 0.0
+vt 0.480342 0.989663 0.0
+vt 0.480342 0.931145 0.0
+vt 0.480342 0.931145 0.0
+vt 0.480342 0.989663 0.0
+vt 0.431753 0.989663 0.0
+vt 0.431753 0.931145 0.0
+vt 0.812263 0.931145 0.0
+vt 0.812263 0.989663 0.0
+vt 0.760828 0.989663 0.0
+vt 0.760828 0.931145 0.0
+vt 0.812263 0.852599 0.0
+vt 0.812263 0.931145 0.0
+vt 0.760828 0.931145 0.0
+vt 0.760828 0.852599 0.0
+vt 0.480342 0.852599 0.0
+vt 0.480342 0.931145 0.0
+vt 0.431753 0.931145 0.0
+vt 0.431753 0.852599 0.0
+vt 0.525733 0.852599 0.0
+vt 0.525733 0.931145 0.0
+vt 0.480342 0.931145 0.0
+vt 0.480342 0.852599 0.0
+vt 0.570270 0.852599 0.0
+vt 0.570270 0.931145 0.0
+vt 0.525733 0.931145 0.0
+vt 0.525733 0.852599 0.0
+vt 0.618707 0.852599 0.0
+vt 0.618707 0.931145 0.0
+vt 0.570270 0.931145 0.0
+vt 0.570270 0.852599 0.0
+vt 0.664251 0.852599 0.0
+vt 0.664251 0.931145 0.0
+vt 0.618707 0.931145 0.0
+vt 0.618707 0.852599 0.0
+vt 0.710954 0.852599 0.0
+vt 0.710954 0.931145 0.0
+vt 0.664251 0.931145 0.0
+vt 0.664251 0.852599 0.0
+vt 0.760828 0.852599 0.0
+vt 0.760828 0.931145 0.0
+vt 0.710954 0.931145 0.0
+vt 0.710954 0.852599 0.0
+vt 0.760828 0.776192 0.0
+vt 0.760828 0.852599 0.0
+vt 0.710954 0.852599 0.0
+vt 0.710954 0.776192 0.0
+vt 0.710954 0.776192 0.0
+vt 0.710954 0.852599 0.0
+vt 0.664251 0.852599 0.0
+vt 0.664251 0.776192 0.0
+vt 0.664251 0.776192 0.0
+vt 0.664251 0.852599 0.0
+vt 0.618707 0.852599 0.0
+vt 0.618707 0.776192 0.0
+vt 0.618707 0.776192 0.0
+vt 0.618707 0.852599 0.0
+vt 0.570270 0.852599 0.0
+vt 0.570270 0.776192 0.0
+vt 0.570270 0.776192 0.0
+vt 0.570270 0.852599 0.0
+vt 0.525733 0.852599 0.0
+vt 0.525733 0.776192 0.0
+vt 0.525733 0.776192 0.0
+vt 0.525733 0.852599 0.0
+vt 0.480342 0.852599 0.0
+vt 0.480342 0.776192 0.0
+vt 0.480342 0.776192 0.0
+vt 0.480342 0.852599 0.0
+vt 0.431753 0.852599 0.0
+vt 0.431753 0.776192 0.0
+vt 0.812263 0.776192 0.0
+vt 0.812263 0.852599 0.0
+vt 0.760828 0.852599 0.0
+vt 0.760828 0.776192 0.0
+vt 0.812263 0.715219 0.0
+vt 0.812263 0.776192 0.0
+vt 0.760828 0.776192 0.0
+vt 0.760828 0.715219 0.0
+vt 0.480342 0.715219 0.0
+vt 0.480342 0.776192 0.0
+vt 0.431753 0.776192 0.0
+vt 0.431753 0.715219 0.0
+vt 0.525733 0.715219 0.0
+vt 0.525733 0.776192 0.0
+vt 0.480342 0.776192 0.0
+vt 0.480342 0.715219 0.0
+vt 0.570270 0.715219 0.0
+vt 0.570270 0.776192 0.0
+vt 0.525733 0.776192 0.0
+vt 0.525733 0.715219 0.0
+vt 0.618707 0.715219 0.0
+vt 0.618707 0.776192 0.0
+vt 0.570270 0.776192 0.0
+vt 0.570270 0.715219 0.0
+vt 0.664251 0.715219 0.0
+vt 0.664251 0.776192 0.0
+vt 0.618707 0.776192 0.0
+vt 0.618707 0.715219 0.0
+vt 0.710954 0.715219 0.0
+vt 0.710954 0.776192 0.0
+vt 0.664251 0.776192 0.0
+vt 0.664251 0.715219 0.0
+vt 0.760828 0.715219 0.0
+vt 0.760828 0.776192 0.0
+vt 0.710954 0.776192 0.0
+vt 0.710954 0.715219 0.0
+vt 0.710954 0.015137 0.0
+vt 0.760828 0.015137 0.0
+vt 0.760828 0.715219 0.0
+vt 0.710954 0.715219 0.0
+vt 0.664251 0.015137 0.0
+vt 0.710954 0.015137 0.0
+vt 0.710954 0.715219 0.0
+vt 0.664251 0.715219 0.0
+vt 0.618707 0.015137 0.0
+vt 0.664251 0.015137 0.0
+vt 0.664251 0.715219 0.0
+vt 0.618707 0.715219 0.0
+vt 0.570270 0.015137 0.0
+vt 0.618707 0.015137 0.0
+vt 0.618707 0.715219 0.0
+vt 0.570270 0.715219 0.0
+vt 0.525733 0.015137 0.0
+vt 0.570270 0.015137 0.0
+vt 0.570270 0.715219 0.0
+vt 0.525733 0.715219 0.0
+vt 0.480342 0.015137 0.0
+vt 0.525733 0.015137 0.0
+vt 0.525733 0.715219 0.0
+vt 0.480342 0.715219 0.0
+vt 0.431753 0.015137 0.0
+vt 0.480342 0.015137 0.0
+vt 0.480342 0.715219 0.0
+vt 0.431753 0.715219 0.0
+vt 0.760828 0.015137 0.0
+vt 0.812263 0.015137 0.0
+vt 0.812263 0.715219 0.0
+vt 0.760828 0.715219 0.0
+vt 0.912816 0.570310 0.0
+vt 0.890062 0.515376 0.0
+vt 0.935571 0.515376 0.0
+vt 0.912816 0.570310 0.0
+vt 0.935571 0.515376 0.0
+vt 0.967750 0.547556 0.0
+vt 0.912816 0.570310 0.0
+vt 0.967750 0.547556 0.0
+vt 0.967750 0.593064 0.0
+vt 0.912816 0.570310 0.0
+vt 0.967750 0.593064 0.0
+vt 0.935571 0.625244 0.0
+vt 0.912816 0.570310 0.0
+vt 0.935571 0.625244 0.0
+vt 0.890062 0.625244 0.0
+vt 0.912816 0.570310 0.0
+vt 0.890062 0.625244 0.0
+vt 0.857882 0.593064 0.0
+vt 0.912816 0.570310 0.0
+vt 0.857882 0.593064 0.0
+vt 0.857882 0.547556 0.0
+vt 0.912816 0.570310 0.0
+vt 0.857882 0.547556 0.0
+vt 0.890062 0.515376 0.0
+usemtl None_bike_rack_tex.jpg
+s 1
+f 17/1 1/2 2/3
+f 17/4 2/5 3/6
+f 17/7 3/8 4/9
+f 17/10 4/11 5/12
+f 17/13 5/14 6/15
+f 17/16 6/17 7/18
+f 17/19 7/20 8/21
+f 8/22 1/23 17/24
+f 1/25 9/26 10/27 2/28
+f 2/29 10/30 11/31 3/32
+f 3/33 11/34 12/35 4/36
+f 4/37 12/38 13/39 5/40
+f 5/41 13/42 14/43 6/44
+f 6/45 14/46 15/47 7/48
+f 7/49 15/50 16/51 8/52
+f 9/53 1/54 8/55 16/56
+f 9/57 16/58 18/59 25/60
+f 16/61 15/62 19/63 18/64
+f 15/65 14/66 20/67 19/68
+f 14/69 13/70 21/71 20/72
+f 13/73 12/74 22/75 21/76
+f 12/77 11/78 23/79 22/80
+f 11/81 10/82 24/83 23/84
+f 10/85 9/86 25/87 24/88
+f 24/89 25/90 26/91 27/92
+f 23/93 24/94 27/95 28/96
+f 22/97 23/98 28/99 29/100
+f 21/101 22/102 29/103 30/104
+f 20/105 21/106 30/107 31/108
+f 19/109 20/110 31/111 32/112
+f 18/113 19/114 32/115 33/116
+f 25/117 18/118 33/119 26/120
+f 26/121 33/122 34/123 41/124
+f 33/125 32/126 35/127 34/128
+f 32/129 31/130 36/131 35/132
+f 31/133 30/134 37/135 36/136
+f 30/137 29/138 38/139 37/140
+f 29/141 28/142 39/143 38/144
+f 28/145 27/146 40/147 39/148
+f 27/149 26/150 41/151 40/152
+f 40/153 41/154 42/155 43/156
+f 39/157 40/158 43/159 44/160
+f 38/161 39/162 44/163 49/164
+f 37/165 38/166 49/167 48/168
+f 36/169 37/170 48/171 47/172
+f 35/173 36/174 47/175 45/176
+f 34/177 35/178 45/179 46/180
+f 41/181 34/182 46/183 42/184
+f 50/185 42/186 46/187 57/188
+f 57/189 46/190 45/191 56/192
+f 56/193 45/194 47/195 55/196
+f 55/197 47/198 48/199 54/200
+f 54/201 48/202 49/203 53/204
+f 53/205 49/206 44/207 52/208
+f 52/209 44/210 43/211 51/212
+f 51/213 43/214 42/215 50/216
+f 64/217 51/218 50/219 65/220
+f 63/221 52/222 51/223 64/224
+f 62/225 53/226 52/227 63/228
+f 61/229 54/230 53/231 62/232
+f 60/233 55/234 54/235 61/236
+f 59/237 56/238 55/239 60/240
+f 58/241 57/242 56/243 59/244
+f 65/245 50/246 57/247 58/248
+f 66/249 65/250 58/251 73/252
+f 73/253 58/254 59/255 72/256
+f 72/257 59/258 60/259 71/260
+f 71/261 60/262 61/263 70/264
+f 70/265 61/266 62/267 69/268
+f 69/269 62/270 63/271 68/272
+f 68/273 63/274 64/275 67/276
+f 67/277 64/278 65/279 66/280
+f 81/281 67/282 66/283 82/284
+f 80/285 68/286 67/287 81/288
+f 79/289 69/290 68/291 80/292
+f 78/293 70/294 69/295 79/296
+f 77/297 71/298 70/299 78/300
+f 76/301 72/302 71/303 77/304
+f 75/305 73/306 72/307 76/308
+f 82/309 66/310 73/311 75/312
+f 83/313 90/314 82/315 75/316
+f 84/317 83/318 75/319 76/320
+f 85/321 84/322 76/323 77/324
+f 86/325 85/326 77/327 78/328
+f 87/329 86/330 78/331 79/332
+f 88/333 87/334 79/335 80/336
+f 89/337 88/338 80/339 81/340
+f 90/341 89/342 81/343 82/344
+f 74/345 90/346 83/347
+f 74/348 83/349 84/350
+f 74/351 84/352 85/353
+f 74/354 85/355 86/356
+f 74/357 86/358 87/359
+f 74/360 87/361 88/362
+f 74/363 88/364 89/365
+f 74/366 89/367 90/368
Added: maven/trunk/ogoglio-server/src/main/resources/populate/template-43/bike_rack_tex.jpg
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/resources/populate/template-43/bike_rack_tex.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/resources/populate/template-43/gilman_license.txt
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/populate/template-43/gilman_license.txt (rev 0)
+++ maven/trunk/ogoglio-server/src/main/resources/populate/template-43/gilman_license.txt 2007-09-23 00:32:43 UTC (rev 432)
@@ -0,0 +1,84 @@
+The full text of the Creative Commons is listed below, but here is the human-readable summary of it:
+
+You are free:
+
+to copy, distribute, display, and perform the work
+to make derivative works
+to make commercial use of the work
+Under the following conditions.
+
+Attribution. You must attribute the work in the manner specified by the author or licensor.
+You must credit the creators of this work in the following way:
+Scott Hsu-Storaker
+Terrence M
+Evan Tann
+Yaniv Pe'er
+Emily Huffman
+Clint Herron
+Tom Perkins
+
+For any reuse or distribution, you must make clear to others the license terms of this work. Any of these conditions can be waived if you get permission from the copyright holder.
+
+Your fair use and other rights are in no way affected by the above.
+
+_______________________________________
+
+Here is the full text of this agreement.
+Attribution 2.5
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+ a "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+ b "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+ c "Licensor" means the individual or entity that offers the Work under the terms of this License.
+ d "Original Author" means the individual or entity who created the Work.
+ e "Work" means the copyrightable work of authorship offered under the terms of this License.
+ f "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+ a to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+ b to create and reproduce Derivative Works;
+ c to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+ d to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
+ e
+For the avoidance of doubt, where the work is a musical composition:
+ i Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
+ ii Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
+ f Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
+
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+ a You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(b), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(b), as requested.
+ b If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE ...
[truncated message content] |
|
From: <ian...@us...> - 2007-09-20 18:51:21
|
Revision: 431
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=431&view=rev
Author: iansmith
Date: 2007-09-20 11:51:24 -0700 (Thu, 20 Sep 2007)
Log Message:
-----------
Assumptions about bulding/testing this new version:
1) Get an instance of tomcat 6 running.
2) Add the "server.xml config" section below to the "<GlobalNamingResources>" section of server.xml in the conf directory of tomcat 6. Edit the values below to match your settings.xml.
3) Cargo has been dropped in favor of using the tomcat manager application. Make sure you have configured the manager application properly. This implies that you have set a manager account with the proper roles. See below with the tomcat-users.xml section and the webapps/manager/META-INF/context.xml.
You probably have it configured if this returns a sensible web page (not any kind of failure):
http://127.0.0.1:8080/manager/roles
4) Add this to your settings.xml (needs to match up with your tomcat-users.xml):
<server>
<id>localMachine</id>
<username>iansmith</username>
<password>javaesque</password>
</server>
This assumes that you have a "<servers>" section in your settings.xml already. It's a top level element
if you need to add it.
5) The .war file of the ogoglio server gets deployed now during the build of ogoglio-server.
6) Once you have everything configured, just leave a copy of tomcat6 running somewhere. This will get new wars deployed to it when ogoglio-server is built (#5) and now the integration tests just assume that this server is running.
----webapps/manager/META-INF/context.xml (note hooked by name to the server.xml below) -----
<Context antiResourceLocking="false" privileged="true">
<ResourceLink name="users"
global="UserDatabase"
type="org.apache.catalina.UserDatabase"/>
</Context>
----tomcat-users.xml conifg ------------
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="iansmith" password="mysecret" roles="manager,admin"/>
</tomcat-users>
---server.xml config ----
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
<!--
OGOGLIO SPECIFIC GLOBAL RESOURCES
-->
<Resource name="ogoglioDB" scope="Shareable"
type="javax.sql.DataSource" auth='Container'
factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
url="jdbc:mysql://127.0.0.1/og"
driverClassName="com.mysql.jdbc.Driver"
username="oguser"
password="sssh"
dialect="org.hibernate.dialect.MySQLDialect"
show_sql="false"
maxIdle="5"
maxActive="50" />
<Environment name="mediaURL" value="file:///home/iansmith/tmp/working/media" type="java.lang.String"/>
<Environment name="baseURL" value="http://127.0.0.1:8080/og/" type="java.lang.String"/>
<Environment name="oktoZapDB" value="true" type="java.lang.String"/>
<Environment name="okToMigrateDB" value="true" type="java.lang.String"/>
<Environment name="simsAllowRemoteAccess" value="true" type="java.lang.String" />
<Environment name="mediaDirectory" value="/home/iansmith/tmp/working/media" type="java.lang.String"/>
Modified Paths:
--------------
maven/trunk/ogoglio/pom.xml
Modified: maven/trunk/ogoglio/pom.xml
===================================================================
--- maven/trunk/ogoglio/pom.xml 2007-09-20 18:34:07 UTC (rev 430)
+++ maven/trunk/ogoglio/pom.xml 2007-09-20 18:51:24 UTC (rev 431)
@@ -19,43 +19,6 @@
<module>../dev-plugins</module>
</modules>
- <profiles>
- <profile>
- <id>boot-server</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <version>0.3-SNAPSHOT</version>
- <!-- CARGO INTERACTIONS WITH TOMCAT FOR BOOTING SERVER ONLY -->
- <configuration>
-
-<wait>${ogoglio.interactive_boot}</wait>
- <!-- tomcat 5.5 running on the same machine...-->
- <container>
- <containerId>tomcat5x</containerId>
- <home>${cargo.tomcat5x.home}</home>
- <log>${basedir}/tomcat5x.log</log>
- <output>${basedir}/tomcat5x.out</output>
- </container>
- <!-- tomcat configuration -->
- <configuration>
- <type>standalone</type>
- <home>${ogoglio.tmp.tomcat5x}</home>
- <properties>
- <cargo.servlet.port>
- 8080
- </cargo.servlet.port>
- </properties>
- </configuration>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
<ciManagement>
<system>continuum</system>
<notifiers>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-09-20 18:34:08
|
Revision: 430
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=430&view=rev
Author: iansmith
Date: 2007-09-20 11:34:07 -0700 (Thu, 20 Sep 2007)
Log Message:
-----------
First stage of externalization of all resources that are needed to run an ogoglio war.
Modified Paths:
--------------
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/MigrationSupport.java
maven/trunk/ogoglio-integration-test/pom.xml
maven/trunk/ogoglio-server/pom.xml
maven/trunk/ogoglio-server/src/main/webapp/META-INF/context.xml
Modified: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/MigrationSupport.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/MigrationSupport.java 2007-09-19 20:33:25 UTC (rev 429)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/MigrationSupport.java 2007-09-20 18:34:07 UTC (rev 430)
@@ -87,6 +87,8 @@
}
if (useJNDI) {
configuration.setProperty("hibernate.connection.datasource", "java:comp/env/jdbc/space");
+ //I have no idea why this is necessary if the datasource SPECIFIES the dialect
+ configuration.setProperty("hibernate.dialect","org.hibernate.dialect.MySQLDialect");
} else {
configuration.addProperties(ps.getAllProps(PropStorage.TEST_CONFIG_PROPS));
}
Modified: maven/trunk/ogoglio-integration-test/pom.xml
===================================================================
--- maven/trunk/ogoglio-integration-test/pom.xml 2007-09-19 20:33:25 UTC (rev 429)
+++ maven/trunk/ogoglio-integration-test/pom.xml 2007-09-20 18:34:07 UTC (rev 430)
@@ -90,56 +90,6 @@
</executions>
<configuration />
</plugin>
- <!--lots of CARGO magic to bring server up, do deploys... -->
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <version>0.3-SNAPSHOT</version>
- <configuration></configuration>
- <executions>
- <execution>
- <!--bring up server in /tmp -->
- <id>boot-server</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>start</goal>
- </goals>
- <configuration>
- <wait>false</wait>
- <container>
- <containerId>tomcat5x</containerId>
- <home>${cargo.tomcat5x.home}</home>
- <log>${basedir}/tomcat5x.log</log>
- <output>${basedir}/tomcat5x.out</output>
- </container>
- <!-- container configuration -->
- <configuration>
- <type>standalone</type>
- <home>${ogoglio.tmp.tomcat5x}</home>
- <properties>
- <cargo.servlet.port>
- ${ogoglio.port}
- </cargo.servlet.port>
- <cargo.logging>high</cargo.logging>
- </properties>
- <!-- tricky: this gets put in *before* the server even boots -->
- <deployables>
- <deployable>
- <groupId>com.ogoglio</groupId>
- <artifactId>
- ogoglio-server
- </artifactId>
- <type>war</type>
- <properties>
- <context>og</context>
- </properties>
- </deployable>
- </deployables>
- </configuration>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
Modified: maven/trunk/ogoglio-server/pom.xml
===================================================================
--- maven/trunk/ogoglio-server/pom.xml 2007-09-19 20:33:25 UTC (rev 429)
+++ maven/trunk/ogoglio-server/pom.xml 2007-09-20 18:34:07 UTC (rev 430)
@@ -14,41 +14,6 @@
<artifactId>ogoglio-server</artifactId>
<packaging>war</packaging>
- <profiles>
- <profile>
- <id>hot-deploy</id>
- <build>
- <plugins>
- <!-- CARGO CONFIG:INSTALL TO RUNNING SERVER -->
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <version>0.3-SNAPSHOT</version>
- <configuration>
- <container>
- <containerId>tomcat5x</containerId>
- </container>
- <!-- Configuration to use with the container -->
- <configuration>
- <type>existing</type>
- <home>${ogoglio.tmp.tomcat5x}</home>
- </configuration>
- <deployables>
- <deployable>
- <properties>
- <context>
- ${pom.artifactId}
- </context>
- </properties>
- </deployable>
- </deployables>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
<!-- -->
<!-- BUILD -->
<!-- -->
@@ -200,7 +165,9 @@
<serviceURI>${ogoglio.baseURL}</serviceURI>
<username>${ogoglio.bootstrapUser}</username>
<password>${ogoglio.bootstrapUserPW}</password>
- <populateDir>src/main/resources/populate</populateDir>
+ <populateDir>
+ src/main/resources/populate
+ </populateDir>
<reverseFile>/tmp/reverse.xml</reverseFile>
<goalPrefix>og</goalPrefix>
</configuration>
@@ -224,6 +191,26 @@
</execution>
</executions>
</plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>tomcat-maven-plugin</artifactId>
+ <configuration>
+ <server>localMachine</server>
+ <path>/og</path>
+ </configuration>
+
+ <executions>
+ <execution>
+ <phase>install</phase>
+ <goals>
+ <goal>undeploy</goal>
+ <goal>deploy</goal>
+ </goals>
+ </execution>
+ </executions>
+
+ </plugin>
</plugins>
</build>
Modified: maven/trunk/ogoglio-server/src/main/webapp/META-INF/context.xml
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/META-INF/context.xml 2007-09-19 20:33:25 UTC (rev 429)
+++ maven/trunk/ogoglio-server/src/main/webapp/META-INF/context.xml 2007-09-20 18:34:07 UTC (rev 430)
@@ -2,24 +2,15 @@
<Context reloadable="true" path="/og" >
<Realm className="org.apache.catalina.realm.MemoryRealm" />
- <Resource name="jdbc/space" scope="Shareable"
- type="javax.sql.DataSource" auth='Container'
- factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
- url="${ogoglio.mysql.url}"
- driverClassName="com.mysql.jdbc.Driver"
- username="${ogoglio.mysql.user}"
- password="${ogoglio.mysql.password}"
- dialect="org.hibernate.dialect.MySQLDialect"
- show_sql="false"
- maxIdle="5"
- maxActive="50" />
-
- <Environment name="ogoglio/oktoZapDB" value="false" type="java.lang.String"/> <!-- not running tests! -->
- <Environment name="ogoglio/okToMigrateDB" value="${ogoglio.okToMigrateDB}" type="java.lang.String"/>
- <Environment name="ogoglio/mediaURL" value="${ogoglio.mediaURL}" type="java.lang.String"/>
- <Environment name="ogoglio/baseURL" value="${ogoglio.baseURL}" type="java.lang.String"/>
- <Environment name="ogoglio/simsAllowRemoteAccess" value="true" type="java.lang.String" />
- <Environment name="ogoglio/mediaDirectory" value="${ogoglio.mediaDirectory}" type="java.lang.String"/>
- <Environment name="ogoglio/bootstrapUser" value="${ogoglio.bootstrapUser}" type="java.lang.String"/>
- <Environment name="ogoglio/bootstrapUserPW" value="${ogoglio.bootstrapUserPW}" type="java.lang.String"/>
+ <ResourceLink name="jdbc/space"
+ global="ogoglioDB"
+ type="javax.sql.DataSource"/>
+
+ <ResourceLink name="ogoglio/mediaURL" global="mediaURL" type="java.lang.String"/>
+ <ResourceLink name="ogoglio/baseURL" global="baseURL" type="java.lang.String"/>
+
+ <ResourceLink name="ogoglio/oktoZapDB" global="oktoZapDB" type="java.lang.String"/>
+ <ResourceLink name="ogoglio/okMigrateDB" global="oktoMigrateDB" type="java.lang.String"/>
+ <ResourceLink name="ogoglio/simsAllowRemoteAccess" global="simsAllowRemoteAccess" type="java.lang.String"/>
+ <ResourceLink name="ogoglio/mediaDirectory" global="mediaDirectory" type="java.lang.String"/>
</Context>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-09-19 20:33:27
|
Revision: 429
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=429&view=rev
Author: trevorolio
Date: 2007-09-19 13:33:25 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
Give the height slider a white background.
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-09-19 20:32:53 UTC (rev 428)
+++ maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-09-19 20:33:25 UTC (rev 429)
@@ -387,6 +387,7 @@
slider.setMajorTickSpacing(20);
slider.setPaintTicks(true);
slider.setPaintLabels(true);
+ slider.setBackground(Color.WHITE);
add(slider, BorderLayout.CENTER);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-09-19 20:32:48
|
Revision: 428
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=428&view=rev
Author: trevorolio
Date: 2007-09-19 13:32:53 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
Retweaked the client api wire so that all JRE 1.6+ clients don't use the applet cache, which is broken in 1.6u1 on.
Removed the domain from the cookies so that hosts within the same domain can have different account records, which is handy for when you want public.example.com and seekret.example.com.
Modified Paths:
--------------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AuthServlet.java
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AuthServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AuthServlet.java 2007-09-19 20:32:50 UTC (rev 427)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AuthServlet.java 2007-09-19 20:32:53 UTC (rev 428)
@@ -116,7 +116,6 @@
Cookie logoutCookie = new Cookie(WebConstants.AUTH_COOKIE, "logMeOut");
logoutCookie.setPath("/");
logoutCookie.setMaxAge(0);
- logoutCookie.setDomain(getSiteInfo().getHost());
response.addCookie(logoutCookie);
AuthDocument authDoc = new AuthDocument();
@@ -153,7 +152,6 @@
Cookie newCookie = new Cookie(WebConstants.AUTH_COOKIE, authedAccountRecord.getCookie());
newCookie.setPath("/");
newCookie.setMaxAge(Integer.MAX_VALUE - 1);
- newCookie.setDomain(getSiteInfo().getHost());
response.addCookie(newCookie);
AuthDocument authDoc = new AuthDocument(authedAccountRecord.getUsername(), true);
response.setStatus(HttpServletResponse.SC_OK);
@@ -225,7 +223,6 @@
Cookie newCookie = new Cookie(WebConstants.AUTH_COOKIE, cookie);
newCookie.setPath("/");
newCookie.setMaxAge(-1);
- newCookie.setDomain(getSiteInfo().getHost());
response.addCookie(newCookie);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-09-19 20:32:48
|
Revision: 427
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=427&view=rev
Author: trevorolio
Date: 2007-09-19 13:32:50 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
Retweaked the client api wire so that all JRE 1.6+ clients don't use the applet cache, which is broken in 1.6u1 on.
Removed the domain from the cookies so that hosts within the same domain can have different account records, which is handy for when you want public.example.com and seekret.example.com.
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClientWire.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClientWire.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClientWire.java 2007-09-18 22:45:40 UTC (rev 426)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClientWire.java 2007-09-19 20:32:50 UTC (rev 427)
@@ -19,9 +19,10 @@
public class WebAPIClientWire {
- private boolean printedCacheComplaint = false;
- private static final String BAD_SUN_VERSION = "1.6;";
-
+ private boolean printedCacheComplaint = false;
+
+ private static final String BAD_SUN_VERSION = "1.6"; //don't add a semicolon on the end of this, as we want to match all 1.6x jvms
+
public InputStream performPUT(URI uri, InputStream input, String type, int length, String authCookie) throws IOException {
HttpURLConnection connection = (HttpURLConnection) uri.toURL().openConnection();
connection.setRequestMethod("PUT");
@@ -156,7 +157,7 @@
Log.warn("Not using Sun's download cache, which they broke in Java 1.6u1.");
}
} catch (URISyntaxException e) {
- Log.error("Tried to reset the URI to avoid bad cache in 1.6",e);
+ Log.error("Tried to reset the URI to avoid bad cache in 1.6", e);
}
}
@@ -227,7 +228,7 @@
Log.warn("Not using Sun's download cache, which they broke in Java 1.6u1.");
}
} catch (URISyntaxException e) {
- Log.error("Tried to reset the URI to avoid bad cache in 1.6",e);
+ Log.error("Tried to reset the URI to avoid bad cache in 1.6", e);
}
}
@@ -295,17 +296,17 @@
// XXX seems to be required
String headerValue = null;
Object makeLinuxHappy = (connection.getRequestProperties().get(headerName));
- if (makeLinuxHappy!=null) {
- if (makeLinuxHappy instanceof String) {
- headerValue = (String) makeLinuxHappy;
- } else if (makeLinuxHappy instanceof List) {
- headerValue = (String) ((List) makeLinuxHappy).get(0);
- } else {
- // we don't understand this type at all
- Log.error("Unable to understand the type returned by Linux workaround in WebAPIClient:"+makeLinuxHappy.getClass().getName());
- return null;
- }
- }
+ if (makeLinuxHappy != null) {
+ if (makeLinuxHappy instanceof String) {
+ headerValue = (String) makeLinuxHappy;
+ } else if (makeLinuxHappy instanceof List) {
+ headerValue = (String) ((List) makeLinuxHappy).get(0);
+ } else {
+ // we don't understand this type at all
+ Log.error("Unable to understand the type returned by Linux workaround in WebAPIClient:" + makeLinuxHappy.getClass().getName());
+ return null;
+ }
+ }
if (makeLinuxHappy == null) {
return null;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-09-18 22:45:43
|
Revision: 426
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=426&view=rev
Author: trevorolio
Date: 2007-09-18 15:45:40 -0700 (Tue, 18 Sep 2007)
Log Message:
-----------
Now you can select your height from the body editor applet.
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-09-18 22:45:34 UTC (rev 425)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java 2007-09-18 22:45:40 UTC (rev 426)
@@ -34,7 +34,7 @@
public class BodyAppletTestWindow extends Frame {
- Dimension appDimension = new Dimension(500, 520);
+ Dimension appDimension = new Dimension(800, 620);
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-09-18 22:45:43
|
Revision: 425
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=425&view=rev
Author: trevorolio
Date: 2007-09-18 15:45:34 -0700 (Tue, 18 Sep 2007)
Log Message:
-----------
Now you can select your height from the body editor applet.
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-09-18 22:45:32 UTC (rev 424)
+++ maven/trunk/ogoglio-server/src/main/resources/siteTemplates/body.html 2007-09-18 22:45:34 UTC (rev 425)
@@ -24,8 +24,8 @@
}
#appletDiv {
- width: 500px;
- height: 500px;
+ width: 800px;
+ height: 600px;
}
</style>
@@ -75,7 +75,7 @@
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='500' height='500' mayscript='true'>";
+ 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'>";
html += "<param name='loginCookie' value='" + loginCookie + "' />";
html += "<param name='serviceURI' value='" + getServiceURI() + "' />";
html += "<param name='image' value='" + appPath + "/icons/32x32/face-monkey.png' />";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-09-18 22:45:37
|
Revision: 424
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=424&view=rev
Author: trevorolio
Date: 2007-09-18 15:45:32 -0700 (Tue, 18 Sep 2007)
Log Message:
-----------
Now you can select your height from the body editor applet.
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Body.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
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/bvh/Bvh.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/BodyDocument.java
Added Paths:
-----------
maven/trunk/ogoglio-common/src/main/resources/sourceArt/Icons/
maven/trunk/ogoglio-common/src/main/resources/sourceArt/Icons/GenderIcons.psd
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Body.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Body.java 2007-09-18 22:45:25 UTC (rev 423)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Body.java 2007-09-18 22:45:32 UTC (rev 424)
@@ -19,7 +19,7 @@
private float height = 2;
private float girth = 1;
-
+
public Body(long bodyID, int hair, int eyes, int nose, int mouth, int face, boolean isMale, float height, float girth) {
this.bodyID = bodyID;
this.hair = hair;
@@ -28,8 +28,8 @@
this.mouth = mouth;
this.face = face;
this.male = isMale;
- this.height = height;
- this.girth = girth;
+ this.height = height;
+ this.girth = girth;
}
public long getBodyID() {
@@ -68,11 +68,15 @@
return male;
}
- public float getHeight(){
+ public float getHeight() {
return height;
}
-
- public float getGirth(){
+
+ public void setHeight(float height) {
+ this.height = height;
+ }
+
+ public float getGirth() {
return girth;
}
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-09-18 22:45:25 UTC (rev 423)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java 2007-09-18 22:45:32 UTC (rev 424)
@@ -109,6 +109,7 @@
scaleBVH(defaultAnimation);
skeleton = new SkeletonLoader(defaultAnimation).generateSkeleton();
+ //skeleton.addDebugAttachments();
if (isVisible) {
skin.setSkeleton(skeleton, skinMap);
}
@@ -137,7 +138,7 @@
float bvhHeight = bvh.getHeight();
if (bvhHeight != userHeight) {
skeletonScale = userHeight / bvhHeight / MAGIC_SKELETON_SCALE; //TODO figure out why we need this magic scale number
- bvh.scale(skeletonScale);
+ bvh.scale(skeletonScale, skeletonScale, skeletonScale);
}
}
@@ -277,4 +278,19 @@
e.printStackTrace();
}
}
+
+ public void setHeight(float newHeight) {
+ try {
+ initBody();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (ObjParseException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (SkinMapParseException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
}
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-09-18 22:45:25 UTC (rev 423)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/SkinLoader.java 2007-09-18 22:45:32 UTC (rev 424)
@@ -52,12 +52,30 @@
Point3f[] vertices = obj.getVertices();
float[] vertexArray = new float[vertices.length * 3];
+ float minY = Float.MAX_VALUE;
+ float maxY = Float.MIN_VALUE;
for (int i = 0; i < vertices.length; i++) {
vertexArray[i * 3] = vertices[i].x;
vertexArray[(i * 3) + 1] = vertices[i].y;
vertexArray[(i * 3) + 2] = vertices[i].z;
+
+ if(vertices[i].y < minY){
+ minY = vertices[i].y;
+ }
+ if(vertices[i].y > maxY){
+ maxY = vertices[i].y;
+ }
}
+ float heightScale = body.getHeight() / Math.abs(maxY - minY);
+ if(Math.abs(heightScale) > 0.1){
+ for (int i = 0; i < vertices.length; i++) {
+ vertexArray[i * 3] = vertexArray[i * 3] * heightScale;
+ vertexArray[(i * 3) + 1] = vertexArray[(i * 3) + 1] * heightScale;
+ vertexArray[(i * 3) + 2] = vertexArray[(i * 3) + 2] * heightScale;
+ }
+ }
+
Point3f[] texCoords = obj.getTextureVertices();
float[] textureCoordinateArray = new float[texCoords.length * 2];
for (int i = 0; i < texCoords.length; i++) {
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/bvh/Bvh.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/bvh/Bvh.java 2007-09-18 22:45:25 UTC (rev 423)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/bvh/Bvh.java 2007-09-18 22:45:32 UTC (rev 424)
@@ -107,14 +107,14 @@
//TODO stop ignoring scale
}
- public void scaleFrameData(float amountToScale, Frame frame) {
+ public void scaleFrameData(float xScale, float yScale, float zScale, Frame frame) {
if (startIndex == -1) {
return;
}
if (channelIndices[0] != -1 && channelIndices[1] != -1 && channelIndices[2] != -1) {
- frame.data[startIndex + channelIndices[0]] = frame.data[startIndex + channelIndices[0]] * amountToScale;
- frame.data[startIndex + channelIndices[1]] = frame.data[startIndex + channelIndices[1]] * amountToScale;
- frame.data[startIndex + channelIndices[2]] = frame.data[startIndex + channelIndices[2]] * amountToScale;
+ frame.data[startIndex + channelIndices[0]] = frame.data[startIndex + channelIndices[0]] * xScale;
+ frame.data[startIndex + channelIndices[1]] = frame.data[startIndex + channelIndices[1]] * yScale;
+ frame.data[startIndex + channelIndices[2]] = frame.data[startIndex + channelIndices[2]] * zScale;
}
}
@@ -234,15 +234,15 @@
return maxY - minY;
}
- public void scale(float amountToScale) {
+ public void scale(float xScale, float yScale, float zScale) {
Vector joints = new Vector();
getJoints(getRootJoint(), joints);
for (int i = 0; i < joints.size(); i++) {
Joint joint = (Joint) joints.get(i);
Vector3f offset = joint.getOffset();
- joint.setOffset(offset.x * amountToScale, offset.y * amountToScale, offset.z * amountToScale);
+ joint.setOffset(offset.x * xScale, offset.y * yScale, offset.z * zScale);
for (int j = 0; j < getFrameCount(); j++) {
- joint.scaleFrameData(amountToScale, getFrame(j));
+ joint.scaleFrameData(xScale, yScale, zScale, getFrame(j));
}
}
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/BodyDocument.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/BodyDocument.java 2007-09-18 22:45:25 UTC (rev 423)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/BodyDocument.java 2007-09-18 22:45:32 UTC (rev 424)
@@ -144,18 +144,26 @@
data.setAttribute(FACE_INDEX, index);
}
- public boolean isMale(){
+ public boolean isMale() {
return data.getBooleanAttribute(IS_MALE);
}
-
- public float getHeight(){
+
+ public float getHeight() {
return data.getFloatAttribute(HEIGHT);
}
-
- public float getGirth(){
+
+ public void setHeight(float newHeight) {
+ data.setAttribute(HEIGHT, newHeight);
+ }
+
+ public float getGirth() {
return data.getFloatAttribute(GIRTH);
}
-
+
+ public void setGirth(float girth) {
+ data.setAttribute(GIRTH, girth);
+ }
+
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof BodyDocument)) {
return false;
@@ -166,4 +174,5 @@
public int hashCode() {
return ("BodyDocument-" + getBodyID()).hashCode();
}
+
}
\ No newline at end of file
Added: maven/trunk/ogoglio-common/src/main/resources/sourceArt/Icons/GenderIcons.psd
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-common/src/main/resources/sourceArt/Icons/GenderIcons.psd
___________________________________________________________________
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.
|
|
From: <tre...@us...> - 2007-09-18 22:45:27
|
Revision: 423
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=423&view=rev
Author: trevorolio
Date: 2007-09-18 15:45:25 -0700 (Tue, 18 Sep 2007)
Log Message:
-----------
Now you can select your height from the body editor applet.
Modified Paths:
--------------
maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
Added Paths:
-----------
maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/FemaleIcon32x32.gif
maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/MaleIcon32x32.gif
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-09-18 17:43:02 UTC (rev 422)
+++ maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-09-18 22:45:25 UTC (rev 423)
@@ -49,7 +49,11 @@
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
+import javax.swing.JPanel;
import javax.swing.JRadioButton;
+import javax.swing.JSlider;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
import javax.vecmath.Color3f;
import javax.vecmath.Point3d;
import javax.vecmath.Vector3f;
@@ -117,7 +121,7 @@
public BodyEditorApplet() {
setBackground(Color.WHITE);
setLayout(new BorderLayout());
- setSize(new Dimension(500, 500));
+ setSize(new Dimension(800, 600));
}
private class SpacelessUser extends User {
@@ -174,7 +178,7 @@
}
private class BodyPanel extends Panel {
- Dimension dimension = new Dimension(200, 300);
+ Dimension dimension = new Dimension(300, 400);
private J3DUniverse universe = null;
@@ -249,8 +253,8 @@
canvas.getView().setTransparencySortingPolicy(View.TRANSPARENCY_SORT_GEOMETRY);
canvas.getView().setSceneAntialiasingEnable(true);
- camera.setRotation(-0.5, Math.PI, 0);
- camera.setLocation(new Vector3f(0f, 1.8f, -1.2f));
+ camera.setRotation(-0.2, Math.PI, 0);
+ camera.setLocation(new Vector3f(0f, 1.7f, -2.5f));
sceneRoot.addChild(camera.getNode());
universe.makeLive();
@@ -270,10 +274,10 @@
ScrollingRowPanel faceRow = new ScrollingRowPanel(true, faceRowModel);
+ GenderPanel genderPanel = new GenderPanel();
+
HeightPanel heightPanel = new HeightPanel();
- GenderPanel genderPanel = new GenderPanel();
-
public WestPanel() {
setPreferredSize(dimension);
setMinimumSize(dimension);
@@ -281,12 +285,13 @@
setBackground(Color.WHITE);
//add(hairRow);
- add(eyesRow);
- add(noseRow);
- add(mouseRow);
- add(faceRow);
+ //add(eyesRow);
+ //add(noseRow);
+ //add(mouseRow);
+ //add(faceRow);
add(genderPanel);
- //add(heightPanel);
+ add(heightPanel);
+
}
}
@@ -304,16 +309,19 @@
} catch (IOException e) {
e.printStackTrace();
}
-
}
private class GenderPanel extends Panel implements ActionListener {
- Dimension dimension = new Dimension(80, 55);
+ Dimension dimension = new Dimension(80, 100);
- JRadioButton maleButton = new JRadioButton("male");
+ ImageIcon maleIcon = UIConstants.loadIconFromResource("images/MaleIcon32x32.gif");
- JRadioButton femaleButton = new JRadioButton("female");
+ ImageIcon femaleIcon = UIConstants.loadIconFromResource("images/FemaleIcon32x32.gif");
+ JRadioButton maleButton = new JRadioButton("male", maleIcon);
+
+ JRadioButton femaleButton = new JRadioButton("female", femaleIcon);
+
public GenderPanel() {
setPreferredSize(dimension);
setMinimumSize(dimension);
@@ -354,15 +362,50 @@
}
}
- private class HeightPanel extends Panel {
- Dimension dimension = new Dimension(150, 25);
+ private class HeightPanel extends Panel implements ChangeListener {
+ Dimension dimension = new Dimension(150, 150);
+ JSlider slider = new JSlider(JSlider.VERTICAL, 150, 210, 200);
public HeightPanel() {
+
setPreferredSize(dimension);
setMinimumSize(dimension);
+ setLayout(new BorderLayout());
+ setBackground(Color.WHITE);
- setBackground(Color.GRAY);
+
+ JLabel heightLabel = new JLabel("height:");
+ heightLabel.setBackground(Color.WHITE);
+ JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER));
+ panel.setBackground(Color.WHITE);
+ panel.add(heightLabel);
+ add(panel, BorderLayout.NORTH);
+
+ int value = (int)(user.getBody().getHeight() * 100);
+ slider.setValue(value);
+ slider.addChangeListener(this);
+ slider.setMajorTickSpacing(20);
+ slider.setPaintTicks(true);
+ slider.setPaintLabels(true);
+ add(slider, BorderLayout.CENTER);
}
+
+ public void stateChanged(ChangeEvent event) {
+ if (slider.getModel().getValueIsAdjusting()) {
+ return;
+ }
+ float newHeight = slider.getValue() / 100f;
+ if (user.getBody().getHeight() != newHeight) {
+ user.getBody().setHeight(newHeight);
+ bodyPanel.renderable.setHeight(newHeight);
+ try {
+ bodyDoc.setHeight(newHeight);
+ webClient.updateBody(bodyDoc);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
}
private class WidthPanel extends Panel {
@@ -381,7 +424,7 @@
JButton[] animationButtons = null;
- AnimationPanel(){
+ AnimationPanel() {
setPreferredSize(dimension);
setMinimumSize(dimension);
setBackground(Color.WHITE);
@@ -392,12 +435,12 @@
animationButtons[i].addActionListener(this);
add(animationButtons[i]);
}
-
+
}
public void actionPerformed(ActionEvent event) {
for (int i = 0; i < animationButtons.length; i++) {
- if(event.getSource() == animationButtons[i]){
+ if (event.getSource() == animationButtons[i]) {
playAnimation(animationButtons[i].getText());
break;
}
@@ -405,9 +448,9 @@
}
}
- private void playAnimation(String command){
+ private void playAnimation(String command) {
for (int i = 0; i < BodyConstants.USER_ANIMATION_COMMANDS.length; i++) {
- if(BodyConstants.USER_ANIMATION_COMMANDS[i].equals(command)){
+ if (BodyConstants.USER_ANIMATION_COMMANDS[i].equals(command)) {
try {
Bvh bvh = new BvhParser(user, i).parse();
bodyPanel.renderable.playAnimation(bvh, false);
@@ -420,7 +463,7 @@
}
}
}
-
+
private class EastPanel extends Panel {
Dimension dimension = new Dimension(150, 300);
@@ -439,7 +482,7 @@
WidthPanel widthPanel = new WidthPanel();
AnimationPanel animationPanel = new AnimationPanel();
-
+
public EastPanel() {
setPreferredSize(dimension);
setMinimumSize(dimension);
@@ -447,11 +490,11 @@
setBackground(Color.WHITE);
//add(hairRow);
- add(eyesRow);
- add(noseRow);
- add(mouthRow);
- add(faceRow);
-
+ //add(eyesRow);
+ //add(noseRow);
+ //add(mouthRow);
+ //add(faceRow);
+
add(animationPanel);
//add(texturePanel);
//add(widthPanel);
@@ -737,9 +780,9 @@
configTemplate.setDoubleBuffer(GraphicsConfigTemplate.REQUIRED);
return device.getBestConfiguration(configTemplate);
}
-
+
public boolean completedInitialLoad() {
- return completedInitialLoad ;
+ return completedInitialLoad;
}
}
Added: maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/FemaleIcon32x32.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/FemaleIcon32x32.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/MaleIcon32x32.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/MaleIcon32x32.gif
___________________________________________________________________
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.
|
|
From: <tre...@us...> - 2007-09-18 16:03:59
|
Revision: 419
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=419&view=rev
Author: trevorolio
Date: 2007-09-18 09:03:54 -0700 (Tue, 18 Sep 2007)
Log Message:
-----------
Added the ability to choose a male or female avatar.
Both avatar models still need work.
Consolidated the two UIConstants classes into one.
Modified Paths:
--------------
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/ClientTest.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-09-18 16:03:36 UTC (rev 418)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java 2007-09-18 16:03:54 UTC (rev 419)
@@ -19,8 +19,6 @@
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Frame;
-import java.awt.GraphicsDevice;
-import java.awt.GraphicsEnvironment;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
@@ -36,7 +34,7 @@
public class BodyAppletTestWindow extends Frame {
- Dimension appDimension = new Dimension(500, 500);
+ Dimension appDimension = new Dimension(500, 520);
public BodyEditorApplet applet = null;
@@ -44,19 +42,17 @@
URI serviceURI = null;
- public BodyAppletTestWindow(URI serviceURI, String authCookie, Dimension appDimension, boolean decorated) {
- ArgumentUtils.assertNotNull(appDimension);
- this.appDimension = appDimension;
+ public BodyAppletTestWindow(URI serviceURI, String authCookie) {
+ setTitle("Body Editor");
+
ArgumentUtils.assertNotNull(serviceURI);
this.serviceURI = serviceURI;
-
+
setLayout(new BorderLayout());
setSize(appDimension);
setLocation(30, 50);
setResizable(false);
- if (!decorated) {
- this.setUndecorated(true);
- }
+
HashMap parameters1 = new HashMap();
parameters1.put("loginCookie", authCookie);
parameters1.put("serviceURI", serviceURI.toString());
@@ -118,13 +114,6 @@
}
public static void main(String[] args) {
- GraphicsEnvironment graphicsEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
- GraphicsDevice device = graphicsEnv.getDefaultScreenDevice();
- Dimension dim = new Dimension(1024, 800);
- boolean fullScreen = args.length > 0 && "fullscreen".equals(args[0]);
- if (fullScreen) {
- dim = new Dimension(device.getDisplayMode().getWidth(), device.getDisplayMode().getWidth());
- }
String serviceURI=null;
String loginCookie=null;
try {
@@ -140,11 +129,8 @@
}
try {
- BodyAppletTestWindow test = new BodyAppletTestWindow(new URI(serviceURI), loginCookie, dim, fullScreen);
+ BodyAppletTestWindow test = new BodyAppletTestWindow(new URI(serviceURI), loginCookie);
test.setVisible(true);
- if (fullScreen) {
- device.setFullScreenWindow(test);
- }
test.start();
} catch (URISyntaxException e) {
e.printStackTrace();
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-09-18 16:03:36 UTC (rev 418)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2007-09-18 16:03:54 UTC (rev 419)
@@ -49,8 +49,8 @@
import com.ogoglio.util.Log;
import com.ogoglio.util.PropStorage;
import com.ogoglio.util.StreamUtils;
+import com.ogoglio.util.UIConstants;
import com.ogoglio.util.WebConstants;
-import com.ogoglio.viewer.render.UIConstants;
import com.ogoglio.xml.AccountDocument;
import com.ogoglio.xml.AuthDocument;
import com.ogoglio.xml.BodyDocument;
@@ -315,9 +315,28 @@
assertEquals(basicAuthenticator.getAuthDocument(true).getUsername(), testWindow.applet.getUsername());
testWindow.cleanup();
+ BodyAppletTestWindow bodyWindow = openBodyAppletTestWindow(basicAuthenticator);
+ bodyWindow.cleanup();
+
basicWebClient.deleteSpace(spaceDocument.getSpaceID());
}
+ private BodyAppletTestWindow openBodyAppletTestWindow(WebAPIAuthenticator authenticator) {
+ BodyAppletTestWindow bodyWindow = new BodyAppletTestWindow(descriptor1.getServiceURI(), authenticator.getAuthCookie());
+ bodyWindow.setVisible(true);
+ bodyWindow.start();
+
+ long startTime = System.currentTimeMillis();
+ while (!bodyWindow.applet.completedInitialLoad() && System.currentTimeMillis() < startTime + 10000) {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ }
+ }
+ assertTrue(bodyWindow.applet.completedInitialLoad());
+ return bodyWindow;
+ }
+
private AppletTestWindow openAppletTestWindow(SpaceDocument spaceDocument, WebAPIAuthenticator authenticator) {
AppletTestWindow testWindow = new AppletTestWindow(descriptor1.getServiceURI(), spaceDocument.getSpaceID(), authenticator.getAuthCookie(), new Dimension(500, 500), true);
testWindow.setVisible(true);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-09-18 16:03:52
|
Revision: 418
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=418&view=rev
Author: trevorolio
Date: 2007-09-18 09:03:36 -0700 (Tue, 18 Sep 2007)
Log Message:
-----------
Added the ability to choose a male or female avatar.
Both avatar models still need work.
Consolidated the two UIConstants classes into one.
Modified Paths:
--------------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/BodyPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/xml/server/DocumentFactory.java
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/BodyPersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/BodyPersistTasks.java 2007-09-18 16:03:23 UTC (rev 417)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/BodyPersistTasks.java 2007-09-18 16:03:36 UTC (rev 418)
@@ -67,10 +67,22 @@
dirty = true;
record.setFaceIndex(bodyDoc.getFaceIndex());
}
+ if (bodyDoc.isMale() != record.isMale()) {
+ dirty = true;
+ record.setMale(bodyDoc.isMale());
+ }
+ if(bodyDoc.getHeight() != record.getHeight()){
+ dirty = true;
+ record.setHeight(bodyDoc.getHeight());
+ }
+ if(bodyDoc.getGirth() != record.getGirth()){
+ dirty = true;
+ record.setGirth(bodyDoc.getGirth());
+ }
if (dirty) {
session.update(record);
}
- return new BodyDocument(record.getBodyID(), record.getOwnerUsername(), record.getDisplayName(), record.getHairIndex(), record.getEyesIndex(), record.getNoseIndex(), record.getMouthIndex(), record.getFaceIndex());
+ return new BodyDocument(record.getBodyID(), record.getOwnerUsername(), record.getDisplayName(), record.getHairIndex(), record.getEyesIndex(), record.getNoseIndex(), record.getMouthIndex(), record.getFaceIndex(), record.isMale(), record.getHeight(), record.getGirth());
}
};
task.setSessionFactory(sessionFactory);
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-09-18 16:03:23 UTC (rev 417)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java 2007-09-18 16:03:36 UTC (rev 418)
@@ -40,10 +40,11 @@
import com.ogoglio.sim.script.SpaceScriptEngine;
import com.ogoglio.util.ArgumentUtils;
import com.ogoglio.util.BlockingQueue;
+import com.ogoglio.util.BodyConstants;
import com.ogoglio.util.Log;
+import com.ogoglio.util.UIConstants;
import com.ogoglio.util.BlockingQueue.QueueClosedException;
import com.ogoglio.viewer.j3d.J3DRenderer;
-import com.ogoglio.viewer.render.UIConstants;
import com.ogoglio.xml.BodyDocument;
import com.ogoglio.xml.DoorDocument;
import com.ogoglio.xml.PageDocument;
@@ -164,11 +165,19 @@
}
public InputStream getUserAnimationStream(String username, long animationID) throws IOException {
- return UIConstants.getUserAnimation((int) animationID);
+ return BodyConstants.getUserAnimation((int) animationID);
}
public InputStream getUserSkinMapStream(String username) throws IOException {
- return UIConstants.getResource("avatar/avatar.smap");
+ User user = space.getUser(username);
+ if(user == null){
+ return null;
+ }
+ if(user.getBody().isMale()){
+ return UIConstants.getResource(BodyConstants.MALE_SMAP_PATH);
+ } else {
+ return UIConstants.getResource(BodyConstants.FEMALE_SMAP_PATH);
+ }
}
public String getThingScript(long thingID) throws IOException {
@@ -180,7 +189,15 @@
}
public InputStream getUserGeometryStream(String username, String name) throws IOException {
- return UIConstants.getResource("avatar/avatar.obj");
+ User user = space.getUser(username);
+ if(user == null){
+ return null;
+ }
+ if(user.getBody().isMale()){
+ return UIConstants.getResource(BodyConstants.MALE_AVATAR_PATH);
+ } else {
+ return UIConstants.getResource(BodyConstants.FEMALE_AVATAR_PATH);
+ }
}
public InputStream getPageContentStream(long thingID, long pageID) {
@@ -188,7 +205,7 @@
}
public BodyDocument getBodyDocument(String username, long bodyID) throws IOException {
- return new BodyDocument(bodyID, username, "Body", 0, 0, 0, 0, 0);
+ return new BodyDocument(bodyID, username, "Body", 0, 0, 0, 0, 0, false, 2, 1);
}
}
@@ -369,8 +386,8 @@
if(chatMessage.startsWith("/") && chatMessage.length() > 1){
String command = chatMessage.substring(1);
boolean sentAnimation = false;
- for (int i = 0; i < UIConstants.USER_ANIMATION_COMMANDS.length; i++) {
- if(UIConstants.USER_ANIMATION_COMMANDS[i].equals(command)){
+ for (int i = 0; i < BodyConstants.USER_ANIMATION_COMMANDS.length; i++) {
+ if(BodyConstants.USER_ANIMATION_COMMANDS[i].equals(command)){
SpaceEvent playAnimationEvent = new SpaceEvent(SpaceEvent.PLAY_ANIMATION_EVENT);
playAnimationEvent.setProperty(SpaceEvent.USERNAME, user.getUsername());
playAnimationEvent.setProperty(SpaceEvent.ANIMATION_ID, new Long(i));
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-09-18 16:03:23 UTC (rev 417)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/xml/server/DocumentFactory.java 2007-09-18 16:03:36 UTC (rev 418)
@@ -23,7 +23,7 @@
public class DocumentFactory {
public static BodyDocument documentFromRecord(BodyRecord record) {
- return new BodyDocument(record.getBodyID(), record.getOwnerUsername(), record.getDisplayName(), record.getHairIndex(), record.getEyesIndex(), record.getNoseIndex(), record.getMouthIndex(), record.getFaceIndex());
+ return new BodyDocument(record.getBodyID(), record.getOwnerUsername(), record.getDisplayName(), record.getHairIndex(), record.getEyesIndex(), record.getNoseIndex(), record.getMouthIndex(), record.getFaceIndex(), record.isMale(), record.getHeight(), record.getGirth());
}
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-09-18 16:03:23 UTC (rev 417)
+++ maven/trunk/ogoglio-server/src/test/java/com/ogoglio/sim/script/test/ScriptTest.java 2007-09-18 16:03:36 UTC (rev 418)
@@ -9,7 +9,7 @@
import junit.framework.TestCase;
import com.ogoglio.sim.SpaceSimulator;
-import com.ogoglio.viewer.render.UIConstants;
+import com.ogoglio.util.UIConstants;
import com.ogoglio.xml.SpaceDocument;
import com.ogoglio.xml.SpaceEvent;
import com.ogoglio.xml.TemplateDocument;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-09-18 16:03:28
|
Revision: 417
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=417&view=rev
Author: trevorolio
Date: 2007-09-18 09:03:23 -0700 (Tue, 18 Sep 2007)
Log Message:
-----------
Added the ability to choose a male or female avatar.
Both avatar models still need work.
Consolidated the two UIConstants classes into one.
Modified Paths:
--------------
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/MigrationSupport.java
Modified: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/MigrationSupport.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/MigrationSupport.java 2007-09-18 16:03:11 UTC (rev 416)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/MigrationSupport.java 2007-09-18 16:03:23 UTC (rev 417)
@@ -12,25 +12,26 @@
import com.ogoglio.appdev.persist.PersistException;
import com.ogoglio.util.Log;
import com.ogoglio.util.PropStorage;
-import com.ogoglio.viewer.render.UIConstants;
+import com.ogoglio.util.UIConstants;
-
-
public abstract class MigrationSupport {
//check on migration okayness
public static final String MIGRATION_KEY = "ogoglio/okToMigrateDB";
- public static final boolean DDL_MODE_UPDATE=true;
- public static final boolean DDL_MODE_CREATE=false;
-
+ public static final boolean DDL_MODE_UPDATE = true;
+
+ public static final boolean DDL_MODE_CREATE = false;
+
public MigrationSupport() {
}
-
+
public abstract int getVersionNumber();
+
public abstract Migration[] getMigrationList();
+
public abstract String getResourcePath();
-
+
public boolean verifyVersion(ServletConfig servletConf, Context ctx) {
try {
SessionFactory sessionFactory = getCurrentConfiguration().buildSessionFactory();
@@ -38,8 +39,7 @@
if (version != getVersionNumber()) {
Log.error("DB Version Mismatch! Expected (" + getVersionNumber() + ") but got " + version + "!");
sessionFactory.close();
- return tryUpgrade(servletConf, ctx, version, getVersionNumber(),
- DDL_MODE_UPDATE, true, null);
+ return tryUpgrade(servletConf, ctx, version, getVersionNumber(), DDL_MODE_UPDATE, true, null);
}
sessionFactory.close();
return true; // we are at the expected version
@@ -68,12 +68,12 @@
return false;
}
}
-
+
public boolean initVersionAndUpgrade(ServletConfig conf, Context ctx) {
- if (!initVersionOnly(true,null)) {
- return false;
- }
- return tryUpgrade(conf, ctx, 0, getVersionNumber(), DDL_MODE_UPDATE, true,null);
+ if (!initVersionOnly(true, null)) {
+ return false;
+ }
+ return tryUpgrade(conf, ctx, 0, getVersionNumber(), DDL_MODE_UPDATE, true, null);
}
public Configuration getCurrentConfiguration() {
@@ -88,9 +88,9 @@
if (useJNDI) {
configuration.setProperty("hibernate.connection.datasource", "java:comp/env/jdbc/space");
} else {
- configuration.addProperties(ps.getAllProps(PropStorage.TEST_CONFIG_PROPS));
+ configuration.addProperties(ps.getAllProps(PropStorage.TEST_CONFIG_PROPS));
}
- configuration.addInputStream(UIConstants.getResource(getResourcePath()+"/migration-" + num + ".xml"));
+ configuration.addInputStream(UIConstants.getResource(getResourcePath() + "/migration-" + num + ".xml"));
return configuration.configure();
}
@@ -103,43 +103,41 @@
}
}
- public boolean tryUpgrade(ServletConfig servletConfig, Context ctx, int db_is,
- int db_wants_to_be, boolean isUpdate, boolean useJNDI, PropStorage propStore) {
+ public boolean tryUpgrade(ServletConfig servletConfig, Context ctx, int db_is, int db_wants_to_be, boolean isUpdate, boolean useJNDI, PropStorage propStore) {
if (getMigrationList().length != getVersionNumber()) {
Log.error("Internal error! Migration list length should be " + getVersionNumber() + " but is " + getMigrationList().length + "!");
return false;
}
boolean canMigrate = false;
-
+
//check the flags
try {
- String migrate;
- if (useJNDI) {
- migrate = (String) ctx.lookup(MIGRATION_KEY);
- } else {
- migrate= propStore.getKeyFromSet(PropStorage.TEST_CONFIG_PROPS, "ogoglio.okToMigrateDB");
- }
- if ("true".equals(migrate)) {
- canMigrate = true;
- }
+ String migrate;
+ if (useJNDI) {
+ migrate = (String) ctx.lookup(MIGRATION_KEY);
+ } else {
+ migrate = propStore.getKeyFromSet(PropStorage.TEST_CONFIG_PROPS, "ogoglio.okToMigrateDB");
+ }
+ if ("true".equals(migrate)) {
+ canMigrate = true;
+ }
} catch (NamingException e) {
- Log.error("Naming exception trying to access " + MIGRATION_KEY + " from naming context!");
- canMigrate=false;
+ Log.error("Naming exception trying to access " + MIGRATION_KEY + " from naming context!");
+ canMigrate = false;
}
if (!canMigrate) {
Log.error("Cannot migrate data! Property ogoglio.okToMigrateDB is false or non-existent!");
return false;
}
- String hbm_auto_flag="update";
+ String hbm_auto_flag = "update";
if (!isUpdate) {
- hbm_auto_flag="create";
+ hbm_auto_flag = "create";
}
-
for (int i = db_is; i < db_wants_to_be; ++i) {
Migration current = getMigrationList()[i];
- Log.info("DB: Attempting migration from " + i + " to " + (i + 1) + " with auto HBM:"+hbm_auto_flag);
+ Log.info("DB: Attempting migration from " + i + " to " + (i + 1) + " with auto HBM:" + hbm_auto_flag);
//try to get hibernate to do the work
Configuration config = createConfigurationForHibernate(i + 1, hbm_auto_flag, useJNDI, propStore);
@@ -153,65 +151,65 @@
setVersionNumberOfDbViaQuery(factory, i + 1, expectedRecords);
try {
- if (!current.patch(factory, servletConfig, ctx, i, i + 1)) {
- factory.close();
- return false;
- }
+ if (!current.patch(factory, servletConfig, ctx, i, i + 1)) {
+ factory.close();
+ return false;
+ }
} catch (PersistException e) {
- Log.error("Whoa! Patch failed at revision!"+(i+1)+" on class "+current.getClass().getName());
- Log.error("Whoa! Persistance layer problem was:"+e.getMessage());
+ Log.error("Whoa! Patch failed at revision!" + (i + 1) + " on class " + current.getClass().getName());
+ Log.error("Whoa! Persistance layer problem was:" + e.getMessage());
}
-
+
try {
- if (!isUpdate) {
- //we need to go ahead and create the data
- if (!current.populate(factory, i, i+1)) {
- Log.error("Whoa! Populate failed at revision!"+(i+1)+" on class "+current.getClass().getName());
- factory.close();
- return false;
- }
- }
+ if (!isUpdate) {
+ //we need to go ahead and create the data
+ if (!current.populate(factory, i, i + 1)) {
+ Log.error("Whoa! Populate failed at revision!" + (i + 1) + " on class " + current.getClass().getName());
+ factory.close();
+ return false;
+ }
+ }
} catch (PersistException e) {
- Log.error("Whoa! Populate failed at revision!"+(i+1)+" on class "+current.getClass().getName());
- Log.error("Whoa! Persistance layer problem was:"+e.getMessage());
+ Log.error("Whoa! Populate failed at revision!" + (i + 1) + " on class " + current.getClass().getName());
+ Log.error("Whoa! Persistance layer problem was:" + e.getMessage());
}
-
+
factory.close();
}
return true;
}
- public boolean destroyAllData() {
- PropStorage ps =new PropStorage();
- if (ps.loadPropertySet(PropStorage.TEST_CONFIG_PROPS)==false) {
- return false;
- }
+ public boolean destroyAllData() {
+ PropStorage ps = new PropStorage();
+ if (ps.loadPropertySet(PropStorage.TEST_CONFIG_PROPS) == false) {
+ return false;
+ }
- if (initVersionOnly(false, ps)==false) {
- return false;
- }
+ if (initVersionOnly(false, ps) == false) {
+ return false;
+ }
- if (tryUpgrade(null, null, 0, getVersionNumber(), DDL_MODE_CREATE, false, ps)==false) {
- Log.error("Aborted destroying data after failure to upgrade");
- return false;
- }
- ps.loadPropertySet(PropStorage.BASIC_PROPS);
- String dir = ps.getKeyFromSet(PropStorage.BASIC_PROPS, "ogoglio.mediaDirectory");
- if (dir==null) {
- Log.error("Can't find a property ogoglio.mediaDirectory to cleanse media store");
- return false;
- }
- File store = new File(dir);
- if ((!store.exists()) || (!store.canWrite())) {
- Log.error("Media directory doesn't exist or can't be changed:"+dir);
- return false;
- }
- File[] children= store.listFiles();
- for (int i=0; i<children.length;++i) {
- if (children[i].delete()!=true) {
- Log.error("Failed to delete media file:"+children[i].getAbsolutePath());
- }
- }
- return true;
- }
+ if (tryUpgrade(null, null, 0, getVersionNumber(), DDL_MODE_CREATE, false, ps) == false) {
+ Log.error("Aborted destroying data after failure to upgrade");
+ return false;
+ }
+ ps.loadPropertySet(PropStorage.BASIC_PROPS);
+ String dir = ps.getKeyFromSet(PropStorage.BASIC_PROPS, "ogoglio.mediaDirectory");
+ if (dir == null) {
+ Log.error("Can't find a property ogoglio.mediaDirectory to cleanse media store");
+ return false;
+ }
+ File store = new File(dir);
+ if ((!store.exists()) || (!store.canWrite())) {
+ Log.error("Media directory doesn't exist or can't be changed:" + dir);
+ return false;
+ }
+ File[] children = store.listFiles();
+ for (int i = 0; i < children.length; ++i) {
+ if (children[i].delete() != true) {
+ Log.error("Failed to delete media file:" + children[i].getAbsolutePath());
+ }
+ }
+ return true;
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-09-18 16:03:15
|
Revision: 416
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=416&view=rev
Author: trevorolio
Date: 2007-09-18 09:03:11 -0700 (Tue, 18 Sep 2007)
Log Message:
-----------
Added the ability to choose a male or female avatar.
Both avatar models still need work.
Consolidated the two UIConstants classes into one.
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/model/Body.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/util/BodyConstants.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/UIConstants.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/Skin.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/SkinLoader.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/BodyDocument.java
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/XMLTest.java
Added Paths:
-----------
maven/trunk/ogoglio-common/src/main/resources/avatar/female.obj
maven/trunk/ogoglio-common/src/main/resources/avatar/female.smap
maven/trunk/ogoglio-common/src/main/resources/avatar/female1.jpg
maven/trunk/ogoglio-common/src/main/resources/avatar/male.obj
maven/trunk/ogoglio-common/src/main/resources/avatar/male.smap
maven/trunk/ogoglio-common/src/main/resources/avatar/male1.jpg
Removed Paths:
-------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/UIConstants.java
maven/trunk/ogoglio-common/src/main/resources/avatar/avatar.jpg
maven/trunk/ogoglio-common/src/main/resources/avatar/avatar.obj
maven/trunk/ogoglio-common/src/main/resources/avatar/avatar.smap
maven/trunk/ogoglio-common/src/main/resources/avatar/avatar1.jpg
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-09-18 16:02:42 UTC (rev 415)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2007-09-18 16:03:11 UTC (rev 416)
@@ -37,8 +37,9 @@
import com.ogoglio.message.PayloadFactory;
import com.ogoglio.message.TCPChannel;
import com.ogoglio.util.ArgumentUtils;
+import com.ogoglio.util.BodyConstants;
import com.ogoglio.util.Log;
-import com.ogoglio.viewer.render.UIConstants;
+import com.ogoglio.util.UIConstants;
import com.ogoglio.xml.AccountDocument;
import com.ogoglio.xml.BodyDocument;
import com.ogoglio.xml.DoorDocument;
@@ -721,15 +722,31 @@
}
public InputStream getUserGeometryStream(String username, String name) throws IOException {
- return UIConstants.getResource("avatar/avatar.obj");
+ User user = space.getUser(username);
+ if(user == null){
+ return null;
+ }
+ if(user.getBody().isMale()){
+ return UIConstants.getResource(BodyConstants.MALE_AVATAR_PATH);
+ } else {
+ return UIConstants.getResource(BodyConstants.FEMALE_AVATAR_PATH);
+ }
}
public InputStream getUserAnimationStream(String username, long animationID) throws IOException {
- return UIConstants.getUserAnimation((int) animationID);
+ return BodyConstants.getUserAnimation((int) animationID);
}
public InputStream getUserSkinMapStream(String username) throws IOException {
- return UIConstants.getResource("avatar/avatar.smap");
+ User user = space.getUser(username);
+ if(user == null){
+ return null;
+ }
+ if(user.getBody().isMale()){
+ return UIConstants.getResource(BodyConstants.MALE_SMAP_PATH);
+ } else {
+ return UIConstants.getResource(BodyConstants.FEMALE_SMAP_PATH);
+ }
}
public BodyDocument getBodyDocument(String username, long bodyID) throws IOException {
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-09-18 16:02:42 UTC (rev 415)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java 2007-09-18 16:03:11 UTC (rev 416)
@@ -482,7 +482,7 @@
}
public BodyDocument createBody(String bodyName) throws IOException {
- BodyDocument bodyDoc = new BodyDocument(-1, authenticator.getUsername(), bodyName, 0, 0, 0, 0, 0);
+ BodyDocument bodyDoc = new BodyDocument(-1, authenticator.getUsername(), bodyName, 0, 0, 0, 0, 0, false, 2, 1);
XMLElement element = wire.postAuthenticatedXML(descriptor.getBodiesURI(authenticator.getUsername()), bodyDoc.toString(), authenticator.getAuthCookie());
if (element == null) {
return null;
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Body.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Body.java 2007-09-18 16:02:42 UTC (rev 415)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Body.java 2007-09-18 16:03:11 UTC (rev 416)
@@ -14,13 +14,22 @@
private int face = -1;
- public Body(long bodyID, int hair, int eyes, int nose, int mouth, int face) {
+ private boolean male = false;
+
+ private float height = 2;
+
+ private float girth = 1;
+
+ public Body(long bodyID, int hair, int eyes, int nose, int mouth, int face, boolean isMale, float height, float girth) {
this.bodyID = bodyID;
this.hair = hair;
this.eyes = eyes;
this.nose = nose;
this.mouth = mouth;
this.face = face;
+ this.male = isMale;
+ this.height = height;
+ this.girth = girth;
}
public long getBodyID() {
@@ -54,5 +63,20 @@
this.mouth = mouthIndex;
this.face = faceIndex;
}
+
+ public boolean isMale() {
+ return male;
+ }
+
+ public float getHeight(){
+ return height;
+ }
+ public float getGirth(){
+ return girth;
+ }
+
+ public void setMale(boolean male) {
+ this.male = male;
+ }
}
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-09-18 16:02:42 UTC (rev 415)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Space.java 2007-09-18 16:03:11 UTC (rev 416)
@@ -558,9 +558,9 @@
public Body getBody(String username, long bodyID) throws IOException {
if (bodyID < 0) {
- return new Body(-1, 0, 0, 0, 0, 0);
+ return new Body(-1, 0, 0, 0, 0, 0, false, 2, 0);
}
BodyDocument bodyDoc = spaceContext.getBodyDocument(username, bodyID);
- return new Body(bodyDoc.getBodyID(), bodyDoc.getHairIndex(), bodyDoc.getEyesIndex(), bodyDoc.getNoseIndex(), bodyDoc.getMouthIndex(), bodyDoc.getFaceIndex());
+ return new Body(bodyDoc.getBodyID(), bodyDoc.getHairIndex(), bodyDoc.getEyesIndex(), bodyDoc.getNoseIndex(), bodyDoc.getMouthIndex(), bodyDoc.getFaceIndex(), bodyDoc.isMale(), bodyDoc.getHeight(), bodyDoc.getGirth());
}
}
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-09-18 16:02:42 UTC (rev 415)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/User.java 2007-09-18 16:03:11 UTC (rev 416)
@@ -46,7 +46,7 @@
body = space.getBody(username, bodyID);
} catch (IOException e) {
e.printStackTrace();
- body = new Body(-1, 0, 0, 0, 0, 0);
+ body = new Body(-1, 0, 0, 0, 0, 0, false, 2, 1);
}
}
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-09-18 16:02:42 UTC (rev 415)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/BodyConstants.java 2007-09-18 16:03:11 UTC (rev 416)
@@ -1,19 +1,24 @@
package com.ogoglio.util;
import java.awt.Image;
+import java.io.InputStream;
public class BodyConstants {
public static final String TEXTURE_RESOURCE_PATH = "avatar/";
- public static Image BASE_SKIN_TEXTURE1 = UIConstants.loadImageFromResource(TEXTURE_RESOURCE_PATH + "avatar1.jpg");
+ public static Image MALE_BASE_SKIN_TEXTURE1 = UIConstants.loadImageFromResource(TEXTURE_RESOURCE_PATH + "male1.jpg");
- public static final int BASE_SKIN_TEXTURE_WIDTH = BASE_SKIN_TEXTURE1.getWidth(null);
+ public static Image FEMALE_BASE_SKIN_TEXTURE1 = UIConstants.loadImageFromResource(TEXTURE_RESOURCE_PATH + "female1.jpg");
- public static final int BASE_SKIN_TEXTURE_HEIGHT = BASE_SKIN_TEXTURE1.getHeight(null);
+ public static final int BASE_SKIN_TEXTURE_WIDTH = MALE_BASE_SKIN_TEXTURE1.getWidth(null);
- public static final Image[] BASE_SKIN_TEXTURES = { BASE_SKIN_TEXTURE1 };
+ public static final int BASE_SKIN_TEXTURE_HEIGHT = MALE_BASE_SKIN_TEXTURE1.getHeight(null);
+ public static final Image[] MALE_BASE_SKIN_TEXTURES = { MALE_BASE_SKIN_TEXTURE1 };
+
+ public static final Image[] FEMALE_BASE_SKIN_TEXTURES = { FEMALE_BASE_SKIN_TEXTURE1 };
+
public static final Image EYES_1 = UIConstants.loadImageFromResource(TEXTURE_RESOURCE_PATH + "Eyes1.gif");
public static final Image EYES_2 = UIConstants.loadImageFromResource(TEXTURE_RESOURCE_PATH + "Eyes2.gif");
@@ -31,4 +36,45 @@
public static final Image MOUTH_2 = UIConstants.loadImageFromResource(TEXTURE_RESOURCE_PATH + "Mouth2.gif");
public static final Image[] MOUTHES = { MOUTH_1, MOUTH_2 };
+
+ public static final String DEFAULT_ANIMATION_PATH = "avatar/avatar.bvh";
+
+ public static final String WALK_ANIMATION_PATH = "avatar/avatar-walk.bvh";
+
+ public static final String WAVE_ANIMATION_PATH = "avatar/avatar-wave.bvh";
+
+ public static final String POINT_ANIMATION_PATH = "avatar/avatar-point.bvh";
+
+ public static final String LAUGH_ANIMATION_PATH = "avatar/avatar-laugh.bvh";
+
+ public static final String CLAP_ANIMATION_PATH = "avatar/avatar-clap.bvh";
+
+ public static final String[] USER_ANIMATION_COMMANDS = { "default", "walk", "wave", "point", "laugh", "clap" };
+
+ public static final String[] USER_ANIMATION_PATHS = { DEFAULT_ANIMATION_PATH, WALK_ANIMATION_PATH, WAVE_ANIMATION_PATH, POINT_ANIMATION_PATH, LAUGH_ANIMATION_PATH, CLAP_ANIMATION_PATH };
+
+ public static final String MALE_AVATAR_PATH = "avatar/male.obj";
+
+ public static final String MALE_SMAP_PATH = "avatar/male.smap";
+
+ public static final String FEMALE_AVATAR_PATH = "avatar/female.obj";
+
+ public static final String FEMALE_SMAP_PATH = "avatar/female.smap";
+
+ public static InputStream getUserAnimation(int animationID) {
+ if (animationID < 0 || animationID >= USER_ANIMATION_PATHS.length) {
+ return null;
+ }
+ return UIConstants.getResource(USER_ANIMATION_PATHS[animationID]);
+ }
+
+ public static InputStream getUserAnimation(String command) {
+ for (int i = 0; i < USER_ANIMATION_COMMANDS.length; i++) {
+ if (USER_ANIMATION_COMMANDS[i].equals(command)) {
+ return UIConstants.getResource(USER_ANIMATION_PATHS[i]);
+ }
+ }
+ return null;
+ }
+
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/UIConstants.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/UIConstants.java 2007-09-18 16:02:42 UTC (rev 415)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/UIConstants.java 2007-09-18 16:03:11 UTC (rev 416)
@@ -21,9 +21,41 @@
import java.io.InputStream;
import javax.swing.ImageIcon;
+import javax.vecmath.Color3f;
public class UIConstants {
+ /*
+ * dark blue #10628B 16/98/139 0.0625f, 0.382f, 0.542
+ *
+ * light blue #1A99D9 26/153/217 0.1015f, 0.5976f, 0.8476f
+ *
+ * brown #8C6311 140/99/17 0.5468f, 0.3867f, 0.0664f
+ *
+ * orange #D9791A 217/121/26 0.8476f, 0.4726f, 0.1015f
+ *
+ * dark gray #737373 115/115/115 0.4492f, 0.4492f, 0.4492f
+ *
+ * light gray #8C8C8C 140/140/140 0.5468f, 0.5468f, 0.5468f
+ */
+ public static Color3f WHITE = new Color3f(1, 1, 1);
+
+ public static Color3f BLACK = new Color3f(0, 0, 0);
+
+ public static Color3f DARK_BLUE = new Color3f(0.0625f, 0.382f, 0.542f);
+
+ public static Color3f LIGHT_BLUE = new Color3f(0.1015f, 0.5976f, 0.8476f);
+
+ public static Color3f BROWN = new Color3f(0.5468f, 0.3867f, 0.0664f);
+
+ public static Color3f ORANGE = new Color3f(0.8476f, 0.4726f, 0.1015f);
+
+ public static Color3f DARK_GRAY = new Color3f(0.4492f, 0.4492f, 0.4492f);
+
+ public static Color3f LIGHT_GRAY = new Color3f(0.5468f, 0.5468f, 0.5468f);
+
+ public static Color3f DARK_GREEN = new Color3f(0.6468f, 0.7867f, 0.0664f);
+
public static Image loadImageFromResource(String resourcePath) {
return loadIconFromResource(resourcePath).getImage();
}
@@ -62,4 +94,13 @@
throw new IllegalStateException("Could not load resource: " + resourcePath);
}
}
+
+ public static InputStream getResource(String resourcePath) {
+ InputStream resource = UIConstants.class.getClassLoader().getResourceAsStream(resourcePath);
+ if (resource == null) {
+ resource = UIConstants.class.getResourceAsStream(resourcePath);
+ }
+ return resource;
+
+ }
}
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-09-18 16:02:42 UTC (rev 415)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java 2007-09-18 16:03:11 UTC (rev 416)
@@ -48,6 +48,7 @@
import com.ogoglio.client.model.Thing;
import com.ogoglio.client.model.User;
import com.ogoglio.util.Log;
+import com.ogoglio.util.UIConstants;
import com.ogoglio.viewer.j3d.bvh.Bvh;
import com.ogoglio.viewer.j3d.bvh.BvhParseException;
import com.ogoglio.viewer.j3d.bvh.BvhParser;
@@ -62,7 +63,6 @@
import com.ogoglio.viewer.render.RenderableParseException;
import com.ogoglio.viewer.render.Renderer;
import com.ogoglio.viewer.render.ThingRenderable;
-import com.ogoglio.viewer.render.UIConstants;
import com.ogoglio.viewer.render.UserRenderable;
import com.sun.j3d.utils.picking.PickTool;
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-09-18 16:02:42 UTC (rev 415)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java 2007-09-18 16:03:11 UTC (rev 416)
@@ -36,7 +36,6 @@
import com.ogoglio.viewer.j3d.body.SkinLoader;
import com.ogoglio.viewer.j3d.bvh.Bvh;
import com.ogoglio.viewer.j3d.bvh.BvhParseException;
-import com.ogoglio.viewer.j3d.bvh.BvhParser;
import com.ogoglio.viewer.j3d.obj.Obj;
import com.ogoglio.viewer.j3d.obj.ObjParseException;
import com.ogoglio.viewer.j3d.obj.ObjParser;
@@ -50,7 +49,7 @@
public class J3DUserRenderable extends BranchGroup implements UserRenderable {
private static final float MAGIC_SKELETON_SCALE = 2.5f;
-
+
public static float PERSON_HEIGHT = 2f;
private TransformGroup transformGroup = new TransformGroup();
@@ -60,7 +59,7 @@
private User user = null;
private Bvh defaultAnimation = null;
-
+
private J3DCamera camera = null;
private Skin skin = null;
@@ -74,62 +73,74 @@
private BodyAnimator animator = null;
private BodyAnimatorListener bodyAnimatorListener = new BodyAnimatorListener();
-
- float userHeight = 2; //meters
+ private float userHeight = 2; //meters
+
+ private boolean isVisible = true;
+
public J3DUserRenderable(User user, boolean setVisible, Bvh defaultAnimation) throws IOException, ObjParseException, BvhParseException, SkinMapParseException {
ArgumentUtils.assertNotNull(user);
this.user = user;
+ this.isVisible = setVisible;
ArgumentUtils.assertNotNull(defaultAnimation);
this.defaultAnimation = defaultAnimation;
-
- if (setVisible) {
+
+ setCapability(BranchGroup.ALLOW_DETACH);
+ setCapability(BranchGroup.ALLOW_BOUNDS_READ);
+ setCapabilities(transformGroup);
+ addChild(transformGroup);
+ setCapabilities(bodyGroup);
+ transformGroup.addChild(bodyGroup);
+
+ initBody();
+ }
+
+ private void initBody() throws IOException, ObjParseException, SkinMapParseException {
+ bodyGroup.removeAllChildren();
+ if (isVisible) {
ObjParser parser = new ObjParser(user, 0);
parser.setIgnoreMaterialsFiles(true);
Obj obj = parser.parse();
skin = new SkinLoader(obj, user.getBody()).generateSkin();
userHeight = skin.getHeight();
-
- SkinMapParser skinMapParser = new SkinMapParser(user);
- skinMap = skinMapParser.parse();
+ skinMap = new SkinMapParser(user).parse();
}
scaleBVH(defaultAnimation);
-
+
skeleton = new SkeletonLoader(defaultAnimation).generateSkeleton();
- //skeleton.addDebugAttachments();
- if(setVisible){
+ if (isVisible) {
skin.setSkeleton(skeleton, skinMap);
}
-
- setCapability(BranchGroup.ALLOW_DETACH);
- setCapability(BranchGroup.ALLOW_BOUNDS_READ);
- setCapabilities(transformGroup);
- addChild(transformGroup);
Transform3D rotationTransform = new Transform3D();
rotationTransform.rotY(Math.PI);
float hairHeight = defaultAnimation.getJointHeight("lFoot");
rotationTransform.setTranslation(new Vector3d(0, -1 * hairHeight, 0));
bodyGroup.setTransform(rotationTransform);
- if (setVisible) {
- bodyGroup.addChild(skin);
+ if (isVisible) {
+ BranchGroup skinBranch = new BranchGroup();
+ skinBranch.setCapability(BranchGroup.ALLOW_DETACH);
+ skinBranch.addChild(skin);
+ bodyGroup.addChild(skinBranch);
}
- bodyGroup.addChild(skeleton);
+ BranchGroup skeletonBranch = new BranchGroup();
+ skeletonBranch.setCapability(BranchGroup.ALLOW_DETACH);
+ skeletonBranch.addChild(skeleton);
+ bodyGroup.addChild(skeletonBranch);
- transformGroup.addChild(bodyGroup);
setPosition(user.getPosition());
playAnimation(defaultAnimation, false);
}
- private void scaleBVH(Bvh bvh){
+ private void scaleBVH(Bvh bvh) {
float bvhHeight = bvh.getHeight();
- if(bvhHeight != userHeight){
+ if (bvhHeight != userHeight) {
skeletonScale = userHeight / bvhHeight / MAGIC_SKELETON_SCALE; //TODO figure out why we need this magic scale number
bvh.scale(skeletonScale);
}
}
-
+
public void setNameTag(String nameTag) {
TransformGroup nameGroup = new TransformGroup();
nameGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
@@ -160,62 +171,6 @@
group.setCapability(TransformGroup.ALLOW_CHILDREN_WRITE);
}
- /*
- private class SkinUpdater implements GeometryUpdater {
- Transform3D requestTransform = null;
-
- float[] coords = null;
-
- Point3f workingPoint = new Point3f();
-
- SkinUpdater(Transform3D requestTransform) {
- this.requestTransform = requestTransform;
- IndexedTriangleStripArray triArray = (IndexedTriangleStripArray) skin.getGeometry();
- coords = triArray.getCoordRefFloat();
- }
-
- public void updateData(Geometry geometry) {
- for (int i = 0; i < coords.length - 2; i += 3) {
- workingPoint.set(coords[i], coords[i + 1], coords[i + 2]);
- requestTransform.transform(workingPoint);
- coords[i] = workingPoint.x;
- coords[i + 1] = workingPoint.y;
- coords[i + 2] = workingPoint.z;
- }
- }
- }
- */
- /*
- private void fitSkin() {
- skin.setBoundsAutoCompute(true);
- BoundingBox bounds = (BoundingBox) skin.getBounds();
- Point3d upper = new Point3d();
- bounds.getUpper(upper);
- Point3d lower = new Point3d();
- bounds.getLower(lower);
- double originalHeight = upper.y - lower.y;
- skinScale = PERSON_HEIGHT / originalHeight;
-
- //Scale the skin
- Transform3D figureTransform = new Transform3D(new Quat4d(), new Vector3d(0, 0, 0), skinScale);
- Transform3D rotationTransform = new Transform3D();
- rotationTransform.rotY(Math.PI);
- figureTransform.mul(rotationTransform);
- SkinUpdater skinUpdater = new SkinUpdater(figureTransform);
- ((IndexedTriangleStripArray) skin.getGeometry()).updateData(skinUpdater);
-
- //Translate the skin so the feet are at Y == 0
- bounds = (BoundingBox) skin.getBounds();
- bounds.getLower(lower);
- if (lower.y != 0) {
- figureTransform = new Transform3D(new Quat4d(), new Vector3d(0, -lower.y, 0), 1);
- skinUpdater = new SkinUpdater(figureTransform);
- ((IndexedTriangleStripArray) skin.getGeometry()).updateData(skinUpdater);
- }
- bounds = (BoundingBox) skin.getBounds();
- }
- */
-
public void setCamera(Camera camera) {
if (camera == null) {
throw new IllegalArgumentException("Cannot set null camera");
@@ -261,7 +216,7 @@
public User getUser() {
return user;
}
-
+
public double getHeight() {
BoundingSphere bounds = (BoundingSphere) getBounds();
return Math.abs(bounds.getRadius() * 2);
@@ -276,7 +231,7 @@
return;
}
Body body = user.getBody();
- skin.updateTexture(body.getHair(), body.getEyes(), body.getNose(), body.getMouth(), body.getFace());
+ skin.updateTexture(body.getHair(), body.getEyes(), body.getNose(), body.getMouth(), body.getFace(), body.isMale());
}
public synchronized void stopAnimation() {
@@ -289,13 +244,13 @@
private class BodyAnimatorListener implements BodyAnimator.Listener {
public void bodyAnimationCompleted(BodyAnimator animator) {
- if(animator.getBvh() == defaultAnimation){
+ if (animator.getBvh() == defaultAnimation) {
return;
}
playAnimation(defaultAnimation, false);
}
}
-
+
public synchronized void playAnimation(Bvh bvh, boolean loop) {
if (animator != null) {
animator.cleanup();
@@ -307,4 +262,19 @@
animator.animate(loop);
}
}
+
+ public void setMale(boolean male) {
+ try {
+ initBody();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (ObjParseException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (SkinMapParseException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
}
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-09-18 16:02:42 UTC (rev 415)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/Skin.java 2007-09-18 16:03:11 UTC (rev 416)
@@ -15,6 +15,7 @@
package com.ogoglio.viewer.j3d.body;
import java.awt.Graphics;
+import java.awt.Image;
import java.awt.image.BufferedImage;
import java.util.Vector;
@@ -37,7 +38,6 @@
import javax.vecmath.Vector3d;
import com.ogoglio.util.BodyConstants;
-import com.ogoglio.util.Log;
import com.ogoglio.viewer.j3d.body.Skeleton.Bone;
import com.ogoglio.viewer.j3d.smap.SkinMap;
import com.ogoglio.viewer.j3d.smap.SkinMap.Group;
@@ -53,7 +53,7 @@
private SkinUpdater skinUpdater = null;
- public Skin(int hair, int eyes, int nose, int mouth, int face) {
+ public Skin(int hair, int eyes, int nose, int mouth, int face, boolean isMale) {
setCapability(Skin.ALLOW_APPEARANCE_WRITE);
setCapability(Skin.ALLOW_PICKABLE_READ);
setCapability(Skin.ALLOW_GEOMETRY_READ);
@@ -69,7 +69,7 @@
texture.getImage(0).setCapability(ImageComponent.ALLOW_IMAGE_READ);
texture.getImage(0).setCapability(ImageComponent.ALLOW_IMAGE_WRITE);
- updateTexture(hair, eyes, nose, mouth, face);
+ updateTexture(hair, eyes, nose, mouth, face, isMale);
Appearance appearance = new Appearance();
TextureAttributes textureAtts = new TextureAttributes();
@@ -91,18 +91,22 @@
int hair, eyes, nose, mouth, face;
- public TextureUpdater(int hair, int eyes, int nose, int mouth, int face) {
+ boolean isMale = false;
+
+ public TextureUpdater(int hair, int eyes, int nose, int mouth, int face, boolean isMale) {
this.hair = hair;
this.eyes = eyes;
this.nose = nose;
this.mouth = mouth;
this.face = face;
+ this.isMale = isMale;
}
public void updateData(ImageComponent2D imageComp, int arg1, int arg2, int arg3, int arg4) {
Graphics g = imageComp.getImage().getGraphics();
- if (face >= 0 && face < BodyConstants.BASE_SKIN_TEXTURES.length) {
- g.drawImage(BodyConstants.BASE_SKIN_TEXTURES[face], 0, 0, null);
+ Image[] baseTextures = isMale ? BodyConstants.MALE_BASE_SKIN_TEXTURES : BodyConstants.FEMALE_BASE_SKIN_TEXTURES;
+ if (face >= 0 && face < baseTextures.length) {
+ g.drawImage(baseTextures[face], 0, 0, null);
}
if (eyes >= 0 && eyes < BodyConstants.EYES.length) {
g.drawImage(BodyConstants.EYES[eyes], 111, 90, 75, 37, null);
@@ -117,9 +121,9 @@
}
- public void updateTexture(int hair, int eyes, int nose, int mouth, int face) {
+ public void updateTexture(int hair, int eyes, int nose, int mouth, int face, boolean isMale) {
ImageComponent2D imageComp = (ImageComponent2D) texture.getImage(0);
- imageComp.updateData(new TextureUpdater(hair, eyes, nose, mouth, face), 0, 0, baseImage.getWidth(), baseImage.getHeight());
+ imageComp.updateData(new TextureUpdater(hair, eyes, nose, mouth, face, isMale), 0, 0, baseImage.getWidth(), baseImage.getHeight());
}
public void setGeometry(Geometry geo) {
@@ -268,12 +272,12 @@
}
public float getHeight() {
- BoundingBox bounds = (BoundingBox)getBounds();
+ BoundingBox bounds = (BoundingBox) getBounds();
Point3d upper = new Point3d();
bounds.getUpper(upper);
Point3d lower = new Point3d();
bounds.getLower(lower);
- return (float)(upper.y - lower.y);
+ return (float) (upper.y - lower.y);
}
}
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-09-18 16:02:42 UTC (rev 415)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/SkinLoader.java 2007-09-18 16:03:11 UTC (rev 416)
@@ -73,7 +73,7 @@
normalArray[(i * 3) + 1] = normals[i].z;
}
- Skin skin = new Skin(body.getHair(), body.getEyes(), body.getNose(), body.getMouth(), body.getFace());
+ Skin skin = new Skin(body.getHair(), body.getEyes(), body.getNose(), body.getMouth(), body.getFace(), body.isMale());
IndexedTriangleArray array = new IndexedTriangleArray(vertices.length, TriangleArray.COORDINATES | TriangleArray.NORMALS | TriangleArray.TEXTURE_COORDINATE_2 | TriangleArray.BY_REFERENCE, indicesTotal);
array.setCoordRefFloat(vertexArray);
Deleted: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/UIConstants.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/UIConstants.java 2007-09-18 16:02:42 UTC (rev 415)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/UIConstants.java 2007-09-18 16:03:11 UTC (rev 416)
@@ -1,127 +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.viewer.render;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.swing.ImageIcon;
-import javax.vecmath.Color3f;
-
-public class UIConstants {
- /*
- * dark blue #10628B 16/98/139 0.0625f, 0.382f, 0.542
- *
- * light blue #1A99D9 26/153/217 0.1015f, 0.5976f, 0.8476f
- *
- * brown #8C6311 140/99/17 0.5468f, 0.3867f, 0.0664f
- *
- * orange #D9791A 217/121/26 0.8476f, 0.4726f, 0.1015f
- *
- * dark gray #737373 115/115/115 0.4492f, 0.4492f, 0.4492f
- *
- * light gray #8C8C8C 140/140/140 0.5468f, 0.5468f, 0.5468f
- */
- public static Color3f WHITE = new Color3f(1, 1, 1);
-
- public static Color3f BLACK = new Color3f(0, 0, 0);
-
- public static Color3f DARK_BLUE = new Color3f(0.0625f, 0.382f, 0.542f);
-
- public static Color3f LIGHT_BLUE = new Color3f(0.1015f, 0.5976f, 0.8476f);
-
- public static Color3f BROWN = new Color3f(0.5468f, 0.3867f, 0.0664f);
-
- public static Color3f ORANGE = new Color3f(0.8476f, 0.4726f, 0.1015f);
-
- public static Color3f DARK_GRAY = new Color3f(0.4492f, 0.4492f, 0.4492f);
-
- public static Color3f LIGHT_GRAY = new Color3f(0.5468f, 0.5468f, 0.5468f);
-
- public static Color3f DARK_GREEN = new Color3f(0.6468f, 0.7867f, 0.0664f);
-
- public static final String DEFAULT_ANIMATION_PATH = "avatar/avatar.bvh";
-
- public static final String WALK_ANIMATION_PATH = "avatar/avatar-walk.bvh";
-
- public static final String WAVE_ANIMATION_PATH = "avatar/avatar-wave.bvh";
-
- public static final String POINT_ANIMATION_PATH = "avatar/avatar-point.bvh";
-
- public static final String LAUGH_ANIMATION_PATH = "avatar/avatar-laugh.bvh";
-
- public static final String CLAP_ANIMATION_PATH = "avatar/avatar-clap.bvh";
-
- public static final String[] USER_ANIMATION_COMMANDS = { "default", "walk", "wave", "point", "laugh", "clap" };
-
- public static final String[] USER_ANIMATION_PATHS = { DEFAULT_ANIMATION_PATH, WALK_ANIMATION_PATH, WAVE_ANIMATION_PATH, POINT_ANIMATION_PATH, LAUGH_ANIMATION_PATH, CLAP_ANIMATION_PATH };
-
- public static InputStream getUserAnimation(int animationID) {
- if(animationID < 0 || animationID >= USER_ANIMATION_PATHS.length){
- return null;
- }
- return getResource(USER_ANIMATION_PATHS[animationID]);
- }
-
- public static InputStream getUserAnimation(String command) {
- for (int i = 0; i < USER_ANIMATION_COMMANDS.length; i++) {
- if (USER_ANIMATION_COMMANDS[i].equals(command)) {
- return getResource(USER_ANIMATION_PATHS[i]);
- }
- }
- return null;
- }
-
- public static ImageIcon loadIconFromResource(String resourcePath) {
- try {
- byte[] buffer = null;
- InputStream resource = getResource(resourcePath);
-
- if (resource == null) {
- throw new IllegalStateException("Could not find resource: " + resourcePath);
- }
-
- BufferedInputStream in = new BufferedInputStream(resource);
- ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
- buffer = new byte[1024];
- int n;
- while ((n = in.read(buffer)) > 0) {
- out.write(buffer, 0, n);
- }
- in.close();
- out.flush();
-
- buffer = out.toByteArray();
- if (buffer.length == 0) {
- throw new IllegalStateException("Could not read resource: " + resourcePath);
- }
- return new ImageIcon(buffer);
- } catch (IOException ioe) {
- ioe.printStackTrace();
- throw new IllegalStateException("Could not load resource: " + resourcePath);
- }
- }
-
- public static InputStream getResource(String resourcePath) {
- InputStream resource = UIConstants.class.getClassLoader().getResourceAsStream(resourcePath);
- if (resource == null) {
- resource = UIConstants.class.getResourceAsStream(resourcePath);
- }
- return resource;
-
- }
-}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/BodyDocument.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/BodyDocument.java 2007-09-18 16:02:42 UTC (rev 415)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/BodyDocument.java 2007-09-18 16:03:11 UTC (rev 416)
@@ -37,9 +37,15 @@
public static final String FACE_INDEX = "face";
+ public static final String IS_MALE = "ismale";
+
+ public static final String HEIGHT = "height";
+
+ public static final String GIRTH = "girth";
+
XMLElement data = null;
- public BodyDocument(long bodyID, String ownerUsername, String displayName, int hair, int eyes, int nose, int mouth, int face) {
+ public BodyDocument(long bodyID, String ownerUsername, String displayName, int hair, int eyes, int nose, int mouth, int face, boolean isMale, float height, float girth) {
data = new XMLElement(NAME);
data.setAttribute(BODY_ID, bodyID);
@@ -57,6 +63,9 @@
data.setAttribute(MOUTH_INDEX, mouth);
ArgumentUtils.assertNotNegative(face);
data.setAttribute(FACE_INDEX, face);
+ data.setAttribute(IS_MALE, isMale);
+ data.setAttribute(HEIGHT, height);
+ data.setAttribute(GIRTH, girth);
}
public BodyDocument(XMLElement data) {
@@ -135,6 +144,18 @@
data.setAttribute(FACE_INDEX, index);
}
+ public boolean isMale(){
+ return data.getBooleanAttribute(IS_MALE);
+ }
+
+ public float getHeight(){
+ return data.getFloatAttribute(HEIGHT);
+ }
+
+ public float getGirth(){
+ return data.getFloatAttribute(GIRTH);
+ }
+
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof BodyDocument)) {
return false;
Deleted: maven/trunk/ogoglio-common/src/main/resources/avatar/avatar.jpg
===================================================================
(Binary files differ)
Deleted: maven/trunk/ogoglio-common/src/main/resources/avatar/avatar.obj
===================================================================
--- maven/trunk/ogoglio-common/src/main/resources/avatar/avatar.obj 2007-09-18 16:02:42 UTC (rev 415)
+++ maven/trunk/ogoglio-common/src/main/resources/avatar/avatar.obj 2007-09-18 16:03:11 UTC (rev 416)
@@ -1,8927 +0,0 @@
-# Blender3D v244 OBJ File: MikeRigged.blend
-# www.blender3d.org
-o Mike
-v 0.311142 0.406033 -0.108595
-v 0.303021 0.345360 -0.125835
-v 0.227706 0.341257 -0.128513
-v 0.229273 0.409040 -0.107120
-v 0.294899 0.278192 -0.102832
-v 0.241228 0.253397 -0.120454
-v 0.226139 0.256499 -0.012092
-v 0.294899 0.270102 -0.036757
-v 0.303021 0.323897 0.025088
-v 0.227706 0.318876 0.024398
-v 0.311142 0.395855 0.014442
-v 0.229273 0.394438 0.000494
-v 0.314506 0.428960 -0.051745
-v 0.229922 0.422291 -0.054673
-v 0.032408 0.438193 0.019218
-v 0.000028 0.433348 0.028486
-v 0.000028 0.377973 0.023821
-v 0.049007 0.387226 0.014744
-v 0.031882 0.438606 0.041908
-v 0.000028 0.431574 0.061884
-v 0.021992 0.449185 0.072133
-v 0.000028 0.444615 0.081399
-v 0.016030 0.469902 0.076850
-v 0.000028 0.469598 0.081529
-v 0.012422 0.490974 0.083452
-v 0.000028 0.490011 0.087355
-v 0.009128 0.497154 0.079358
-v 0.000028 0.497166 0.081634
-v 0.012094 0.502695 0.087565
-v 0.000028 0.502377 0.089515
-v 0.020607 0.523745 0.080789
-v 0.000028 0.519527 0.090166
-v 0.014865 0.531088 0.096715
-v 0.000028 0.524749 0.102985
-v 0.013691 0.540315 0.093596
-v 0.000028 0.535999 0.105575
-v 0.006934 0.559235 0.089070
-v 0.000028 0.560304 0.094733
-v 0.014916 0.623913 0.087199
-v 0.000028 0.623913 0.087199
-v 0.000028 0.590254 0.090531
-v 0.010582 0.585735 0.084708
-v 0.030071 0.689433 0.033411
-v 0.000028 0.693038 0.037553
-v 0.000028 0.659557 0.075624
-v 0.022023 0.657368 0.073036
-v 0.030071 0.688165 -0.058547
-v 0.000028 0.691187 -0.060564
-v 0.038780 0.619464 -0.126007
-v 0.000028 0.620930 -0.128730
-v 0.038089 0.555866 -0.119522
-v 0.000028 0.555803 -0.122571
-v 0.030779 0.472175 -0.081673
-v 0.000028 0.472172 -0.082136
-v 0.000028 0.508952 -0.096572
-v 0.037557 0.507394 -0.092203
-v 0.032240 0.437063 -0.080951
-v 0.000028 0.433697 -0.084518
-v 0.009305 0.573542 0.082195
-v 0.000028 0.573009 0.087655
-v 0.026811 0.584435 0.071542
-v 0.040521 0.582635 0.067057
-v 0.049895 0.596475 0.070593
-v 0.028011 0.598325 0.081865
-v 0.047951 0.574371 0.059396
-v 0.057153 0.571919 0.048250
-v 0.039423 0.569399 0.067127
-v 0.048187 0.556122 0.062690
-v 0.026867 0.569700 0.072905
-v 0.025897 0.553701 0.072508
-v 0.018504 0.571587 0.076368
-v 0.013366 0.556996 0.078749
-v 0.022323 0.538583 0.079018
-v 0.032507 0.538061 0.069355
-v 0.053149 0.538678 0.045440
-v 0.069197 0.573117 0.032754
-v 0.059235 0.609482 0.058061
-v 0.032174 0.620979 0.079437
-v 0.022262 0.501677 0.080554
-v 0.038303 0.513808 0.066809
-v 0.032862 0.497765 0.070830
-v 0.046530 0.494389 0.061846
-v 0.020710 0.493805 0.077478
-v 0.036277 0.474128 0.069749
-v 0.019214 0.577472 0.076421
-v 0.010349 0.585259 0.084608
-v 0.053937 0.512055 0.044935
-v 0.056515 0.492857 0.041268
-v 0.046152 0.462052 0.048870
-v 0.049014 0.649793 0.053833
-v 0.073436 0.624977 0.026105
-v 0.079557 0.581437 0.011099
-v 0.067467 0.540893 0.013789
-v 0.064933 0.512990 0.011857
-v 0.063412 0.489249 0.013024
-v 0.052911 0.454943 0.012510
-v 0.053886 0.453386 0.001558
-v 0.077742 0.410787 -0.022260
-v 0.083865 0.431962 -0.044335
-v 0.060751 0.471467 -0.025079
-v 0.059151 0.675975 0.025682
-v 0.058545 0.673868 -0.054165
-v 0.070151 0.610003 -0.105443
-v 0.063792 0.554302 -0.100252
-v 0.058724 0.508456 -0.075485
-v 0.058092 0.473761 -0.057461
-v 0.066169 0.433346 -0.059552
-v 0.081789 0.634172 -0.004684
-v 0.082519 0.635104 -0.051578
-v 0.087981 0.600291 -0.078550
-v 0.078026 0.555455 -0.070254
-v 0.069087 0.512555 -0.043755
-v 0.071182 0.516580 -0.012704
-v 0.075481 0.546017 -0.017103
-v 0.091662 0.553537 -0.029029
-v 0.092180 0.571775 -0.025134
-v 0.077038 0.546506 -0.004031
-v 0.069544 0.520973 -0.005878
-v 0.084231 0.524297 -0.014313
-v 0.076922 0.552023 -0.031426
-v 0.092997 0.553324 -0.037942
-v 0.081448 0.517100 -0.018164
-v 0.085183 0.571371 -0.036702
-v 0.094337 0.576197 -0.039252
-v 0.087750 0.581460 -0.022004
-v 0.086741 0.578605 -0.014305
-v 0.094337 0.587110 -0.022076
-v 0.087812 0.602441 -0.015110
-v 0.000028 0.306033 0.078103
-v 0.098413 0.315753 0.058105
-v 0.000028 0.390553 -0.124096
-v 0.066103 0.392548 -0.118642
-v 0.127275 0.405948 -0.001655
-v 0.133119 0.432021 -0.049028
-v 0.105463 0.420778 -0.094615
-v 0.176177 0.321700 0.039256
-v 0.182500 0.403268 -0.006660
-v 0.183263 0.429829 -0.056155
-v 0.167158 0.411076 -0.096562
-v 0.156244 0.357656 -0.125999
-v 0.071801 0.287852 -0.142860
-v 0.000028 0.288407 -0.148833
-v 0.161383 0.280583 -0.135349
-v 0.000028 0.234817 0.101598
-v 0.088484 0.240522 0.093669
-v 0.183165 0.247821 0.074628
-v 0.219529 0.164758 0.009079
-v 0.220210 0.161960 -0.104152
-v 0.075033 0.180716 -0.154695
-v 0.000028 0.181746 -0.161272
-v 0.162609 0.175029 -0.143446
-v 0.000028 0.122600 0.129090
-v 0.081107 0.138150 0.122447
-v 0.169559 0.175308 0.080912
-v 0.392215 0.398575 -0.103312
-v 0.389599 0.341860 -0.118799
-v 0.363127 0.295690 -0.098197
-v 0.363926 0.288459 -0.038797
-v 0.371429 0.322571 -0.003214
-v 0.393038 0.393851 0.012893
-v 0.393035 0.421282 -0.052218
-v 0.480329 0.382575 -0.108943
-v 0.477818 0.339690 -0.116291
-v 0.476964 0.281307 -0.096437
-v 0.477731 0.274366 -0.039413
-v 0.479842 0.321220 0.003687
-v 0.481119 0.375678 -0.002511
-v 0.481116 0.403009 -0.052303
-v 0.534529 0.383467 -0.103144
-v 0.531846 0.339802 -0.113081
-v 0.530933 0.277408 -0.092400
-v 0.531753 0.279534 -0.038301
-v 0.531875 0.319938 -0.008492
-v 0.535374 0.377030 -0.007050
-v 0.535371 0.407429 -0.052026
-v 0.614205 0.370882 -0.094631
-v 0.611815 0.330580 -0.103040
-v 0.611002 0.272891 -0.089630
-v 0.611732 0.275147 -0.040212
-v 0.613742 0.312186 -0.013477
-v 0.614958 0.366006 -0.012141
-v 0.614955 0.393044 -0.052460
-v 0.697684 0.349483 -0.085306
-v 0.696158 0.323875 -0.094952
-v 0.695639 0.289056 -0.082154
-v 0.696105 0.284930 -0.045352
-v 0.697388 0.306451 -0.017489
-v 0.698164 0.345371 -0.021510
-v 0.698162 0.361660 -0.053638
-v 0.754698 0.333399 -0.077816
-v 0.753286 0.320252 -0.096420
-v 0.752805 0.296102 -0.081030
-v 0.753237 0.292513 -0.048656
-v 0.754424 0.311242 -0.024676
-v 0.755142 0.332518 -0.031850
-v 0.755141 0.337772 -0.056064
-v 0.807592 0.316963 -0.102882
-v 0.806886 0.309287 -0.104776
-v 0.806406 0.294584 -0.088101
-v 0.806837 0.303095 -0.044997
-v 0.790644 0.296553 -0.014002
-v 0.790965 0.316036 -0.012315
-v 0.791362 0.326429 -0.019325
-v 0.809505 0.337968 -0.055003
-v 0.808922 0.330058 -0.094521
-v 0.856666 0.324398 -0.107946
-v 0.856203 0.309974 -0.111118
-v 0.855723 0.301462 -0.090840
-v 0.839287 0.310210 -0.066552
-v 0.840293 0.307497 -0.051713
-v 0.818320 0.322653 -0.003366
-v 0.817355 0.311672 0.007191
-v 0.857701 0.307526 0.022552
-v 0.858060 0.320750 0.012845
-v 0.825749 0.327720 -0.017101
-v 0.822955 0.332172 -0.031065
-v 0.842806 0.337434 -0.069897
-v 0.857983 0.334552 -0.084306
-v 0.857616 0.332506 -0.094534
-v 0.878465 0.326286 -0.111195
-v 0.878262 0.310207 -0.113301
-v 0.877985 0.302192 -0.094581
-v 0.878107 0.307071 -0.081601
-v 0.855289 0.302989 -0.078731
-v 0.857342 0.294860 -0.010075
-v 0.856331 0.302742 -0.020943
-v 0.883379 0.306162 -0.026117
-v 0.879604 0.304083 -0.010124
-v 0.858060 0.328932 -0.015010
-v 0.859335 0.310650 -0.011660
-v 0.879896 0.317261 -0.006545
-v 0.884695 0.328932 -0.015010
-v 0.880023 0.335110 -0.081512
-v 0.885720 0.337257 -0.070783
-v 0.878872 0.316581 -0.087636
-v 0.883185 0.309870 -0.068091
-v 0.884684 0.317452 -0.063753
-v 0.883892 0.311136 -0.054673
-v 0.883766 0.316540 -0.032873
-v 0.882798 0.309195 -0.040030
-v 0.879877 0.329057 -0.101777
-v 0.885809 0.338866 -0.056774
-v 0.884694 0.340475 -0.042764
-v 0.884694 0.335037 -0.025919
-v 0.821182 0.289975 -0.011262
-v 0.857342 0.296060 0.017453
-v 0.817044 0.301665 0.001516
-v 0.911570 0.302867 -0.001241
-v 0.912187 0.313236 0.003461
-v 0.921627 0.301808 0.011660
-v 0.911065 0.291154 0.005491
-v 0.911065 0.291427 0.018073
-v 0.906535 0.317860 -0.113865
-v 0.906365 0.303624 -0.112733
-v 0.908014 0.322962 -0.102199
-v 0.906953 0.311825 -0.092512
-v 0.906088 0.299519 -0.099606
-v 0.941775 0.303009 -0.101606
-v 0.948146 0.291392 -0.105249
-v 0.939086 0.299501 -0.112069
-v 0.965350 0.305935 -0.071314
-v 0.972148 0.298701 -0.074351
-v 0.965218 0.305535 -0.078756
-v 0.841634 0.340336 -0.055388
-v 0.841149 0.335478 -0.037826
-v 0.855977 0.332205 -0.026418
-v 0.966390 0.309162 -0.055292
-v 0.974673 0.299676 -0.047939
-v 0.971513 0.296787 -0.057628
-v 0.964451 0.302563 -0.012991
-v 0.972537 0.294499 -0.017808
-v 0.964126 0.301372 -0.023422
-v 0.823797 0.295120 -0.027878
-v 0.845438 0.304521 -0.030178
-v 0.859012 0.318845 -0.005538
-v 0.894490 0.305101 0.030385
-v 0.895051 0.318576 0.021116
-v 0.885814 0.293930 0.022748
-v 0.885814 0.289052 0.007662
-v 0.886320 0.302423 -0.002559
-v 0.912689 0.306951 -0.066372
-v 0.913581 0.317452 -0.063753
-v 0.912581 0.306612 -0.081599
-v 0.913442 0.316905 -0.084002
-v 0.914497 0.329638 -0.081483
-v 0.914617 0.329435 -0.070742
-v 0.912890 0.309725 -0.039758
-v 0.913712 0.324143 -0.036580
-v 0.912790 0.308982 -0.052521
-v 0.913653 0.318456 -0.059502
-v 0.914706 0.332728 -0.056741
-v 0.914794 0.333791 -0.042728
-v 0.914101 0.307026 -0.010625
-v 0.914373 0.317271 -0.007286
-v 0.913522 0.303222 -0.023223
-v 0.914049 0.316792 -0.026910
-v 0.914768 0.327140 -0.024733
-v 0.914769 0.327838 -0.012102
-v 0.886936 0.318403 0.003433
-v 0.912187 0.310895 0.015093
-v 0.911626 0.301338 0.023150
-v 0.929923 0.302823 -0.092941
-v 0.932783 0.313122 -0.102193
-v 0.926876 0.290615 -0.099559
-v 0.927876 0.294607 -0.112685
-v 0.930554 0.308568 -0.113339
-v 0.943794 0.299756 -0.068410
-v 0.946499 0.308737 -0.063707
-v 0.943642 0.300252 -0.081565
-v 0.946286 0.308221 -0.083956
-v 0.949541 0.315907 -0.080187
-v 0.949614 0.316457 -0.070672
-v 0.948709 0.304082 -0.039728
-v 0.952027 0.315692 -0.036535
-v 0.948492 0.302545 -0.052486
-v 0.950999 0.310100 -0.059457
-v 0.954520 0.318716 -0.056666
-v 0.954779 0.319748 -0.042654
-v 0.942940 0.298888 -0.010096
-v 0.945144 0.308805 -0.006500
-v 0.941910 0.297813 -0.023194
-v 0.944731 0.308346 -0.027607
-v 0.950815 0.313296 -0.025232
-v 0.950934 0.314901 -0.011651
-v 0.947637 0.294064 -0.093913
-v 0.942769 0.283864 -0.099862
-v 0.944379 0.287197 -0.111653
-v 0.965252 0.291031 -0.069455
-v 0.968652 0.297354 -0.065851
-v 0.965150 0.291297 -0.079823
-v 0.968424 0.296990 -0.081691
-v 0.970543 0.293645 -0.040931
-v 0.973292 0.301255 -0.038216
-v 0.970114 0.292405 -0.051736
-v 0.966767 0.309976 -0.043425
-v 0.964109 0.287824 -0.011341
-v 0.967547 0.295527 -0.008501
-v 0.963276 0.287433 -0.022121
-v 0.967088 0.295062 -0.025569
-v 0.211918 0.060508 0.009634
-v 0.212598 0.057791 -0.088298
-v 0.075033 0.068439 -0.157155
-v 0.000028 0.071188 -0.160683
-v 0.162609 0.066391 -0.134785
-v 0.000028 0.018325 0.125006
-v 0.081107 0.033861 0.115662
-v 0.160689 0.047771 0.063222
-v 0.193886 -0.059312 0.010272
-v 0.194515 -0.061973 -0.077289
-v 0.073739 -0.054174 -0.145085
-v 0.000028 -0.050157 -0.148620
-v 0.154668 -0.059717 -0.122697
-v 0.000028 -0.085337 0.102384
-v 0.079352 -0.078306 0.096437
-v 0.152894 -0.064361 0.063819
-v 0.206643 -0.182710 0.006394
-v 0.207307 -0.185366 -0.080232
-v 0.073087 -0.183652 -0.163583
-v 0.000028 -0.181627 -0.176575
-v 0.158533 -0.187001 -0.140772
-v 0.000028 -0.183768 0.089989
-v 0.079013 -0.186118 0.087508
-v 0.156660 -0.188272 0.060982
-v 0.217632 -0.316931 0.008457
-v 0.218306 -0.319549 -0.070898
-v 0.078152 -0.336320 -0.156648
-v 0.009250 -0.309291 -0.164916
-v 0.164005 -0.323822 -0.126342
-v -0.001653 -0.264408 0.086143
-v 0.084163 -0.327601 0.074255
-v 0.162105 -0.325183 0.058479
-v 0.230176 -0.430637 0.005062
-v 0.230914 -0.433306 -0.066731
-v 0.006620 -0.377167 -0.122505
-v 0.083923 -0.441582 -0.135759
-v 0.030954 -0.438307 -0.119357
-v 0.165040 -0.437718 -0.116889
-v -0.002821 -0.332311 0.033739
-v 0.017958 -0.429087 0.007909
-v 0.090503 -0.441802 0.064600
-v 0.162960 -0.439271 0.050326
-v 0.222837 -0.553256 0.008807
-v 0.232208 -0.553787 -0.054626
-v 0.113148 -0.554776 -0.114688
-v 0.048644 -0.553257 -0.101597
-v 0.182910 -0.554391 -0.102225
-v 0.030896 -0.553254 0.020694
-v 0.101988 -0.553988 0.053602
-v 0.164625 -0.553797 0.048133
-v 0.004458 -0.430298 -0.042374
-v 0.015405 -0.553254 -0.044763
-v 0.002147 -0.380715 -0.043301
-v 0.206606 -0.670152 0.018721
-v 0.214418 -0.670689 -0.045876
-v 0.115159 -0.671683 -0.107040
-v 0.062475 -0.670163 -0.093709
-v 0.173319 -0.671297 -0.094348
-v 0.046989 -0.670148 0.030825
-v 0.105855 -0.670879 0.064337
-v 0.158075 -0.670688 0.058767
-v 0.034073 -0.670154 -0.035833
-v 0.198387 -0.790216 0.018314
-v 0.205576 -0.790744 -0.044596
-v 0.114234 -0.791730 -0.104164
-v 0.065752 -0.790211 -0.091181
-v 0.167755 -0.791346 -0.091803
-v 0.052777 -0.790214 0.030102
-v 0.105672 -0.790949 0.062739
-v 0.153727 -0.790758 0.057315
-v 0.041452 -0.790211 -0.034815
-v 0.183272 -0.909319 0.010603
-v 0.189607 -0.909826 -0.048240
-v 0.109122 -0.910791 -0.103956
-v 0.066403 -0.909277 -0.091813
-v 0.156281 -0.910411 -0.092394
-v 0.059015 -0.909321 0.021629
-v 0.101578 -0.910068 0.052156
-v 0.143921 -0.909875 0.047083
-v 0.044992 -0.909296 -0.039091
-v 0.183272 -1.019136 0.007524
-v 0.189607 -1.019634 -0.049842
-v 0.109122 -1.020592 -0.104159
-v 0.066403 -1.019080 -0.092321
-v 0.156281 -1.020214 -0.092888
-v 0.059015 -1.019139 0.018274
-v 0.101578 -1.019890 0.048035
-v 0.143921 -1.019696 0.043088
-v 0.044992 -1.019106 -0.040923
-v 0.173240 -1.123543 0.008080
-v 0.187740 -1.124102 -0.060565
-v 0.109122 -1.125059 -0.114883
-v 0.066403 -1.123548 -0.103045
-v 0.156281 -1.124681 -0.103611
-v 0.063244 -1.123546 0.018830
-v 0.102600 -1.124298 0.048591
-v 0.142476 -1.124104 0.043644
-v 0.048930 -1.123573 -0.051647
-v 0.176846 -1.187160 0.027773
-v 0.187644 -1.214756 -0.059215
-v 0.109122 -1.213050 -0.114414
-v 0.066403 -1.211538 -0.102576
-v 0.156281 -1.215113 -0.103130
-v 0.101578 -1.161543 0.182298
-v 0.065679 -1.176706 0.152622
-v 0.065679 -1.209567 0.152797
-v 0.101578 -1.215162 0.182584
-v 0.143921 -1.161349 0.177352
-v 0.143921 -1.214968 0.177638
-v 0.172564 -1.176703 0.141872
-v 0.172564 -1.217875 0.142092
-v 0.048930 -1.214235 -0.051164
-v 0.061397 -1.187217 0.028251
-v 0.060495 -1.139723 0.075530
-v 0.101578 -1.129409 0.075410
-v 0.060495 -1.215808 0.088571
-v 0.096161 -1.203909 0.025452
-v 0.101578 -1.223975 0.088549
-v 0.143921 -1.129189 0.075425
-v 0.142476 -1.203690 0.025231
-v 0.143921 -1.223755 0.088564
-v 0.177748 -1.139663 0.075534
-v 0.177748 -1.215747 0.088575
-v 0.152486 -1.224410 -0.061332
-v 0.106474 -1.224701 -0.060935
-v 0.019063 0.497120 0.072960
-v 0.028659 0.575952 0.074675
-v 0.037109 0.575812 0.070753
-v -0.311086 0.406033 -0.108594
-v -0.229217 0.409040 -0.107120
-v -0.227650 0.341256 -0.128513
-v -0.302964 0.345360 -0.125835
-v -0.241171 0.253397 -0.120454
-v -0.294843 0.278192 -0.102832
-v -0.226082 0.256499 -0.012092
-v -0.294843 0.270102 -0.036757
-v -0.227650 0.318876 0.024398
-v -0.302964 0.323897 0.025088
-v -0.229217 0.394438 0.000494
-v -0.311086 0.395855 0.014442
-v -0.229866 0.422291 -0.054673
-v -0.314450 0.428960 -0.051745
-v -0.032352 0.438193 0.019218
-v -0.048950 0.387226 0.014744
-v -0.031826 0.438606 0.041908
-v -0.021936 0.449185 0.072133
-v -0.015974 0.469902 0.076850
-v -0.012366 0.490974 0.083452
-v -0.009071 0.497154 0.079358
-v -0.012038 0.502695 0.087565
-v -0.020551 0.523745 0.080789
-v -0.014808 0.531088 0.096715
-v -0.013634 0.540315 0.093596
-v -0.006878 0.559235 0.089070
-v -0.014860 0.623913 0.087199
-v -0.010526 0.585735 0.084708
-v -0.030015 0.689433 0.033411
-v -0.021967 0.657368 0.073036
-v -0.030015 0.688165 -0.058547
-v -0.038724 0.619464 -0.126007
-v -0.037996 0.553636 -0.118622
-v -0.030722 0.472213 -0.074561
-v -0.037500 0.507394 -0.092203
-v -0.032184 0.437063 -0.080951
-v -0.009249 0.573542 0.082195
-v -0.026755 0.584435 0.071542
-v -0.027954 0.598325 0.081865
-v -0.049838 0.596475 0.070593
-v -0.040465 0.582635 0.067057
-v -0.057096 0.571919 0.048250
-v -0.047895 0.574371 0.059396
-v -0.048131 0.556122 0.062690
-v -0.039367 0.569399 0.067127
-v -0.025841 0.553701 0.072508
-v -0.026810 0.569700 0.072905
-v -0.018448 0.571587 0.076368
-v -0.013310 0.556996 0.078749
-v -0.032451 0.538061 0.069355
-v -0.022267 0.538583 0.079018
-v -0.053092 0.538678 0.045440
-v -0.069141 0.573117 0.032754
-v -0.059178 0.609482 0.058061
-v -0.032118 0.620979 0.079437
-v -0.038246 0.513808 0.066809
-v -0.022205 0.501677 0.080554
-v -0.046474 0.494389 0.061846
-v -0.032806 0.497765 0.070830
-v -0.036220 0.474128 0.069749
-v -0.020654 0.493805 0.077478
-v -0.019157 0.577472 0.076421
-v -0.010293 0.585259 0.084608
-v -0.053881 0.512055 0.044935
-v -0.053000 0.492857 0.041268
-v -0.046095 0.462052 0.048870
-v -0.048957 0.649793 0.053833
-v -0.073380 0.624977 0.026105
-v -0.079500 0.581437 0.011099
-v -0.067411 0.540893 0.013789
-v -0.064877 0.512990 0.011857
-v -0.063356 0.489249 0.013024
-v -0.052855 0.454981 0.019622
-v -0.053830 0.453386 0.001558
-v -0.060694 0.471467 -0.025079
-v -0.083809 0.431962 -0.044335
-v -0.077685 0.410787 -0.022260
-v -0.059095 0.675975 0.025682
-v -0.058488 0.673868 -0.054165
-v -0.070095 0.610003 -0.105443
-v -0.063575 0.553309 -0.099924
-v -0.058036 0.473761 -0.057461
-v -0.058667 0.508456 -0.075485
-v -0.066112 0.433346 -0.059552
-v -0.081732 0.634172 -0.004684
-v -0.082463 0.635104 -0.051578
-v -0.087924 0.600291 -0.078550
-v -0.076853 0.551430 -0.068695
-v -0.069030 0.512555 -0.043755
-v -0.071126 0.516580 -0.012704
-v -0.075424 0.546017 -0.017103
-v -0.092124 0.571775 -0.025134
-v -0.091605 0.553537 -0.029029
-v -0.076981 0.546506 -0.004031
-v -0.084175 0.524297 -0.014313
-v -0.069487 0.520973 -0.005878
-v -0.081392 0.517100 -0.018164
-v -0.092941 0.553324 -0.037942
-v -0.076866 0.552023 -0.031426
-v -0.094281 0.576197 -0.039252
-v -0.085126 0.571371 -0.036702
-v -0.087694 0.581460 -0.022004
-v -0.094281 0.587110 -0.022076
-v -0.086685 0.578605 -0.014305
-v -0.087755 0.602441 -0.015110
-v -0.098357 0.315753 0.058105
-v -0.066047 0.392548 -0.118642
-v -0.133063 0.432021 -0.049028
-v -0.127218 0.405948 -0.001655
-v -0.105407 0.420778 -0.094615
-v -0.182443 0.403268 -0.006660
-v -0.176121 0.321700 0.039256
-v -0.167102 0.411076 -0.096562
-v -0.183206 0.429829 -0.056155
-v -0.156187 0.357656 -0.125999
-v -0.071745 0.287852 -0.142860
-v -0.161326 0.280583 -0.135349
-v -0.088427 0.240522 0.093669
-v -0.183108 0.247821 0.074628
-v -0.220153 0.161960 -0.104152
-v -0.219473 0.164758 0.009079
-v -0.074976 0.180716 -0.154695
-v -0.162552 0.175029 -0.143446
-v -0.081050 0.138150 0.122447
-v -0.169503 0.175388 0.095807
-v -0.389543 0.341860 -0.118799
-v -0.392158 0.398575 -0.103312
-v -0.363071 0.295690 -0.098196
-v -0.363870 0.288459 -0.038797
-v -0.371373 0.322571 -0.003214
-v -0.392981 0.393851 0.012893
-v -0.392978 0.421282 -0.052218
-v -0.477762 0.339690 -0.116291
-v -0.480272 0.382575 -0.108943
-v -0.476907 0.281307 -0.096437
-v -0.477675 0.274366 -0.039413
-v -0.479785 0.321220 0.003687
-v -0.481063 0.375678 -0.002511
-v -0.481060 0.403009 -0.052303
-v -0.531790 0.339802 -0.113081
-v -0.534473 0.383467 -0.103144
-v -0.530877 0.277408 -0.092400
-v -0.531697 0.279534 -0.038301
-v -0.531819 0.319938 -0.008492
-v -0.535318 0.377030 -0.007050
-v -0.535315 0.407429 -0.052026
-v -0.611758 0.330580 -0.103040
-v -0.614149 0.370882 -0.094631
-v -0.610945 0.272891 -0.089630
-v -0.611676 0.275147 -0.040212
-v -0.613685 0.312186 -0.013477
-v -0.614901 0.366006 -0.012141
-v -0.614899 0.393044 -0.052460
-v -0.696101 0.323875 -0.094952
-v -0.697627 0.349483 -0.085306
-v -0.695582 0.289056 -0.082154
-v -0.696048 0.284930 -0.045352
-v -0.697331 0.306451 -0.017489
-v -0.698108 0.345371 -0.021510
-v -0.698106 0.361660 -0.053638
-v -0.753229 0.320252 -0.096420
-v -0.754641 0.333399 -0.077816
-v -0.752749 0.296102 -0.081030
-v -0.753180 0.292513 -0.048656
-v -0.754367 0.311242 -0.024676
-v -0.755086 0.332518 -0.031850
-v -0.755084 0.337772 -0.056064
-v -0.806830 0.309287 -0.104776
-v -0.807536 0.316963 -0.102882
-v -0.806349 0.294584 -0.088101
-v -0.806781 0.303095 -0.044997
-v -0.790587 0.296553 -0.014002
-v -0.791306 0.326429 -0.019325
-v -0.790909 0.316036 -0.012315
-v -0.809449 0.337968 -0.055003
-v -0.808866 0.330058 -0.094521
-v -0.856147 0.309974 -0.111118
-v -0.856609 0.324398 -0.107946
-v -0.855666 0.301462 -0.090840
-v -0.840237 0.307497 -0.051713
-v -0.839231 0.310210 -0.066552
-v -0.818264 0.322653 -0.003366
-v -0.858004 0.320750 0.012845
-v -0.857645 0.307526 0.022552
-v -0.817298 0.311672 0.007191
-v -0.822899 0.332171 -0.031065
-v -0.825692 0.327720 -0.017101
-v -0.857559 0.332506 -0.094534
-v -0.857926 0.334552 -0.084306
-v -0.842749 0.337434 -0.069897
-v -0.878409 0.326286 -0.111195
-v -0.878205 0.310207 -0.113301
-v -0.855233 0.302989 -0.078731
-v -0.878051 0.307071 -0.081601
-v -0.877928 0.302192 -0.094581
-v -0.857285 0.294860 -0.010075
-v -0.879547 0.304083 -0.010124
-v -0.883323 0.306162 -0.026117
-v -0.856275 0.302742 -0.020943
-v -0.858004 0.328932 -0.015010
-v -0.884639 0.328932 -0.015010
-v -0.879840 0.317261 -0.006545
-v -0.859278 0.310650 -0.011660
-v -0.879967 0.335110 -0.081512
-v -0.885664 0.337257 -0.070783
-v -0.878816 0.316581 -0.087636
-v -0.883129 0.309870 -0.068091
-v -0.883836 0.311136 -0.054673
-v -0.884627 0.317452 -0.063753
-v -0.883710 0.316540 -0.032873
-v -0.882741 0.309194 -0.040030
-v -0.879821 0.329057 -0.101777
-v -0.885752 0.338866 -0.056774
-v -0.884637 0.340475 -0.042764
-v -0.884638 0.335037 -0.025919
-v -0.821125 0.289975 -0.011262
-v -0.816987 0.301665 0.001516
-v -0.857285 0.296060 0.017453
-v -0.911514 0.302867 -0.001241
-v -0.921571 0.301808 0.011660
-v -0.912130 0.313236 0.003461
-v -0.911008 0.291154 0.005491
-v -0.911008 0.291427 0.018073
-v -0.906309 0.303624 -0.112733
-v -0.906479 0.317860 -0.113865
-v -0.907957 0.322962 -0.102199
-v -0.906896 0.311825 -0.092512
-v -0.906031 0.299519 -0.099606
-v -0.941719 0.303009 -0.101606
-v -0.939030 0.299501 -0.112069
-v -0.948090 0.291392 -0.105249
-v -0.965294 0.305935 -0.071314
-v -0.965162 0.305535 -0.078756
-v -0.972091 0.298701 -0.074351
-v -0.841578 0.340336 -0.055388
-v -0.855921 0.332205 -0.026418
-v -0.841092 0.335478 -0.037826
-v -0.966333 0.309162 -0.055292
-v -0.971457 0.296787 -0.057628
-v -0.974617 0.299676 -0.047939
-v -0.964395 0.302563 -0.012991
-v -0.964069 0.301372 -0.023422
-v -0.972481 0.294499 -0.017808
-v -0.823741 0.295120 -0.027878
-v -0.845382 0.304521 -0.030178
-v -0.858955 0.318845 -0.005538
-v -0.894994 0.318576 0.021116
-v -0.894433 0.305101 0.030385
-v -0.885758 0.293930 0.022748
-v -0.885758 0.289052 0.007662
-v -0.886263 0.302423 -0.002559
-v -0.913524 0.317452 -0.063753
-v -0.912633 0.306951 -0.066372
-v -0.912525 0.306612 -0.081599
-v -0.913386 0.316905 -0.084002
-v -0.914441 0.329638 -0.081483
-v -0.914561 0.329435 -0.070742
-v -0.913656 0.324143 -0.036580
-v -0.912834 0.309725 -0.039758
-v -0.912733 0.308982 -0.052521
-v -0.913596 0.318456 -0.059502
-v -0.914649 0.332728 -0.056741
-v -0.914738 0.333791 -0.042728
-v -0.914316 0.317271 -0.007286
-v -0.914044 0.307026 -0.010625
-v -0.913465 0.303222 -0.023223
-v -0.913992 0.316792 -0.026910
-v -0.914711 0.327140 -0.024733
-v -0.914712 0.327838 -0.012102
-v -0.886880 0.318403 0.003433
-v -0.912130 0.310895 0.015093
-v -0.911569 0.301338 0.023150
-v -0.932726 0.313122 -0.102193
-v -0.929867 0.302823 -0.092941
-v -0.926820 0.290615 -0.099559
-v -0.927820 0.294607 -0.112685
-v -0.930497 0.308568 -0.113339
-v -0.946442 0.308737 -0.063707
-v -0.943737 0.299756 -0.068410
-v -0.943586 0.300252 -0.081565
-v -0.946229 0.308221 -0.083956
-v -0.949484 0.315907 -0.080187
-v -0.949557 0.316457 -0.070672
-v -0.951971 0.315692 -0.036535
-v -0.948652 0.304082 -0.039728
-v -0.948436 0.302545 -0.052486
-v -0.950943 0.310100 -0.059457
-v -0.954463 0.318716 -0.056666
-v -0.954722 0.31974...
[truncated message content] |
|
From: <tre...@us...> - 2007-09-18 16:02:48
|
Revision: 415
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=415&view=rev
Author: trevorolio
Date: 2007-09-18 09:02:42 -0700 (Tue, 18 Sep 2007)
Log Message:
-----------
Added the ability to choose a male or female avatar.
Both avatar models still need work.
Consolidated the two UIConstants classes into one.
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-09-18 15:05:26 UTC (rev 414)
+++ maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-09-18 16:02:42 UTC (rev 415)
@@ -26,6 +26,8 @@
import java.awt.GraphicsEnvironment;
import java.awt.Image;
import java.awt.Panel;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.IOException;
@@ -43,8 +45,11 @@
import javax.media.j3d.Transform3D;
import javax.media.j3d.TransformGroup;
import javax.media.j3d.View;
+import javax.swing.ButtonGroup;
import javax.swing.ImageIcon;
+import javax.swing.JButton;
import javax.swing.JLabel;
+import javax.swing.JRadioButton;
import javax.vecmath.Color3f;
import javax.vecmath.Point3d;
import javax.vecmath.Vector3f;
@@ -58,12 +63,14 @@
import com.ogoglio.client.model.User;
import com.ogoglio.client.model.Space.Context;
import com.ogoglio.util.BodyConstants;
+import com.ogoglio.util.UIConstants;
import com.ogoglio.viewer.j3d.J3DCamera;
import com.ogoglio.viewer.j3d.J3DCanvas;
import com.ogoglio.viewer.j3d.J3DUniverse;
import com.ogoglio.viewer.j3d.J3DUserRenderable;
+import com.ogoglio.viewer.j3d.bvh.Bvh;
+import com.ogoglio.viewer.j3d.bvh.BvhParseException;
import com.ogoglio.viewer.j3d.bvh.BvhParser;
-import com.ogoglio.viewer.render.UIConstants;
import com.ogoglio.xml.AccountDocument;
import com.ogoglio.xml.BodyDocument;
@@ -105,9 +112,12 @@
private WebAPIClient webClient;
+ private boolean completedInitialLoad = false;
+
public BodyEditorApplet() {
setBackground(Color.WHITE);
setLayout(new BorderLayout());
+ setSize(new Dimension(500, 500));
}
private class SpacelessUser extends User {
@@ -119,15 +129,23 @@
private class SpacelessContext implements Context {
public InputStream getUserGeometryStream(String username, String name) throws IOException {
- return UIConstants.getResource("avatar/avatar.obj");
+ if (user.getBody().isMale()) {
+ return UIConstants.getResource(BodyConstants.MALE_AVATAR_PATH);
+ } else {
+ return UIConstants.getResource(BodyConstants.FEMALE_AVATAR_PATH);
+ }
}
public InputStream getUserAnimationStream(String username, long animationID) throws IOException {
- return UIConstants.getUserAnimation((int) animationID);
+ return BodyConstants.getUserAnimation((int) animationID);
}
public InputStream getUserSkinMapStream(String username) throws IOException {
- return UIConstants.getResource("avatar/avatar.smap");
+ if (user.getBody().isMale()) {
+ return UIConstants.getResource(BodyConstants.MALE_SMAP_PATH);
+ } else {
+ return UIConstants.getResource(BodyConstants.FEMALE_SMAP_PATH);
+ }
}
public InputStream getPageContentStream(long thingID, long pageID) {
@@ -232,7 +250,7 @@
canvas.getView().setSceneAntialiasingEnable(true);
camera.setRotation(-0.5, Math.PI, 0);
- camera.setLocation(new Vector3f(0f, 0.8f, -1.9f));
+ camera.setLocation(new Vector3f(0f, 1.8f, -1.2f));
sceneRoot.addChild(camera.getNode());
universe.makeLive();
@@ -252,10 +270,10 @@
ScrollingRowPanel faceRow = new ScrollingRowPanel(true, faceRowModel);
+ HeightPanel heightPanel = new HeightPanel();
+
GenderPanel genderPanel = new GenderPanel();
- HeightPanel heightPanel = new HeightPanel();
-
public WestPanel() {
setPreferredSize(dimension);
setMinimumSize(dimension);
@@ -267,20 +285,62 @@
add(noseRow);
add(mouseRow);
add(faceRow);
- //add(genderPanel);
+ add(genderPanel);
//add(heightPanel);
}
}
- private class GenderPanel extends Panel {
- Dimension dimension = new Dimension(80, 35);
+ private BodyDocument bodyToDoc(Body body) {
+ return new BodyDocument(body.getBodyID(), user.getUsername(), "Body", body.getHair(), body.getEyes(), body.getNose(), body.getMouth(), body.getFace(), body.isMale(), body.getHeight(), body.getGirth());
+ }
+ private void changeGender() {
+ Body body = user.getBody();
+ body.setMale(westPanel.genderPanel.maleButton.isSelected());
+ BodyDocument bodyDoc = bodyToDoc(body);
+ bodyPanel.renderable.setMale(body.isMale());
+ try {
+ webClient.updateBody(bodyDoc);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ private class GenderPanel extends Panel implements ActionListener {
+ Dimension dimension = new Dimension(80, 55);
+
+ JRadioButton maleButton = new JRadioButton("male");
+
+ JRadioButton femaleButton = new JRadioButton("female");
+
public GenderPanel() {
setPreferredSize(dimension);
setMinimumSize(dimension);
- setBackground(Color.GRAY);
+ ButtonGroup group = new ButtonGroup();
+
+ group.add(maleButton);
+ maleButton.setBackground(Color.WHITE);
+ maleButton.setSelected(user.getBody().isMale());
+ add(maleButton);
+ maleButton.addActionListener(this);
+
+ group.add(femaleButton);
+ femaleButton.setBackground(Color.WHITE);
+ femaleButton.setSelected(!user.getBody().isMale());
+ add(femaleButton);
+ femaleButton.addActionListener(this);
+
+ setBackground(Color.WHITE);
}
+
+ public void actionPerformed(ActionEvent event) {
+ if (user.getBody().isMale() == maleButton.isSelected()) {
+ return;
+ }
+ changeGender();
+ }
}
private class TexturePanel extends Panel {
@@ -316,6 +376,51 @@
}
}
+ private class AnimationPanel extends Panel implements ActionListener {
+ Dimension dimension = new Dimension(150, 170);
+
+ JButton[] animationButtons = null;
+
+ AnimationPanel(){
+ setPreferredSize(dimension);
+ setMinimumSize(dimension);
+ setBackground(Color.WHITE);
+ animationButtons = new JButton[BodyConstants.USER_ANIMATION_COMMANDS.length];
+ for (int i = 0; i < BodyConstants.USER_ANIMATION_COMMANDS.length; i++) {
+ animationButtons[i] = new JButton(BodyConstants.USER_ANIMATION_COMMANDS[i]);
+ animationButtons[i].setBackground(Color.WHITE);
+ animationButtons[i].addActionListener(this);
+ add(animationButtons[i]);
+ }
+
+ }
+
+ public void actionPerformed(ActionEvent event) {
+ for (int i = 0; i < animationButtons.length; i++) {
+ if(event.getSource() == animationButtons[i]){
+ playAnimation(animationButtons[i].getText());
+ break;
+ }
+ }
+ }
+ }
+
+ private void playAnimation(String command){
+ for (int i = 0; i < BodyConstants.USER_ANIMATION_COMMANDS.length; i++) {
+ if(BodyConstants.USER_ANIMATION_COMMANDS[i].equals(command)){
+ try {
+ Bvh bvh = new BvhParser(user, i).parse();
+ bodyPanel.renderable.playAnimation(bvh, false);
+ } catch (BvhParseException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ break;
+ }
+ }
+ }
+
private class EastPanel extends Panel {
Dimension dimension = new Dimension(150, 300);
@@ -333,6 +438,8 @@
WidthPanel widthPanel = new WidthPanel();
+ AnimationPanel animationPanel = new AnimationPanel();
+
public EastPanel() {
setPreferredSize(dimension);
setMinimumSize(dimension);
@@ -344,7 +451,8 @@
add(noseRow);
add(mouthRow);
add(faceRow);
-
+
+ add(animationPanel);
//add(texturePanel);
//add(widthPanel);
}
@@ -569,8 +677,11 @@
eyesRowModel = new RowModel(bodyDoc.getEyesIndex(), BodyConstants.EYES);
noseRowModel = new RowModel(bodyDoc.getNoseIndex(), BodyConstants.NOSES);
mouthRowModel = new RowModel(bodyDoc.getMouthIndex(), BodyConstants.MOUTHES);
- faceRowModel = new RowModel(bodyDoc.getFaceIndex(), BodyConstants.BASE_SKIN_TEXTURES);
-
+ if (user.getBody().isMale()) {
+ faceRowModel = new RowModel(bodyDoc.getFaceIndex(), BodyConstants.MALE_BASE_SKIN_TEXTURES);
+ } else {
+ faceRowModel = new RowModel(bodyDoc.getFaceIndex(), BodyConstants.FEMALE_BASE_SKIN_TEXTURES);
+ }
add(bodyPanel, BorderLayout.CENTER);
westPanel = new WestPanel();
add(westPanel, BorderLayout.WEST);
@@ -592,6 +703,7 @@
new Thread() {
public void run() {
bodyPanel.addUserRenderable();
+ completedInitialLoad = true;
}
}.start();
}
@@ -625,5 +737,9 @@
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: <ian...@us...> - 2007-09-18 15:05:24
|
Revision: 414
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=414&view=rev
Author: iansmith
Date: 2007-09-18 08:05:26 -0700 (Tue, 18 Sep 2007)
Log Message:
-----------
Added support for spaces to know their own last modified time. og:populate mojo now respects last update time on template geometry files, template support files, and space files in the populate directory.
This change is a DB breaker, does require a drop/add to work properly.
Added support for poms that derive server port info from the settings.xml file. Requires addition of "ogoglio.port" property to your settings.xml.
Modified Paths:
--------------
maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/PopulateMojo.java
maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/ReverseMojo.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SpaceDocument.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
maven/trunk/ogoglio-integration-test/pom.xml
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpacePersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpaceRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateSupportFileRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.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/dev-plugins/src/main/java/com/ogoglio/plugin/PopulateMojo.java
===================================================================
--- maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/PopulateMojo.java 2007-09-18 01:14:18 UTC (rev 413)
+++ maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/PopulateMojo.java 2007-09-18 15:05:26 UTC (rev 414)
@@ -5,14 +5,17 @@
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
-import java.util.ArrayList;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.util.Date;
import java.util.HashMap;
-import java.util.List;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
import nanoxml.XMLElement;
import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
import com.ogoglio.client.WebAPIClient;
import com.ogoglio.util.StreamUtils;
@@ -21,27 +24,40 @@
import com.ogoglio.xml.SettingDocument;
import com.ogoglio.xml.SpaceDocument;
import com.ogoglio.xml.TemplateDocument;
+import com.ogoglio.xml.TemplateSupportFileDocument;
import com.ogoglio.xml.ThingDocument;
/**
* @goal populate
*/
public class PopulateMojo extends OgServiceMojoBase {
- private HashMap<Long, Long> templateIdMap = new HashMap<Long, Long>();
+ private Map<Long, Long> templateIdMap = new HashMap<Long, Long>();
- private List<SpaceDocument> spaces = new ArrayList<SpaceDocument>();
+ private Map<Long,SpaceDocument> localSpaces = new HashMap<Long,SpaceDocument>();
+ private Map<String,SpaceDocument> serveSpacerNameToSpaceDoc = new HashMap<String, SpaceDocument>();
+ private Map<String, TemplateDocument> existingServerTemplates = null;
+
+ public static final DateFormat fmt = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, Locale.US);
+
public void execute() throws MojoExecutionException {
WebAPIClient client = validateArgsAndConnect();
if (client == null) {
return;
}
+
+ try {
+ existingServerTemplates = getAllServerTemplates(client);
+ } catch (IOException e) {
+ throw new MojoExecutionException("Couldn't get the existing templates", e);
+ }
+
File[] templates = populateDir.listFiles();
for (int i = 0; i < templates.length; ++i) {
File candidate = templates[i];
if (candidate.getName().startsWith(TEMPLATE_PREFIX)) {
- uploadTemplate(client, candidate);
+ uploadTemplate(client, candidate, existingServerTemplates);
} else if (candidate.getName().startsWith(SPACE_PREFIX)) {
readSpace(client, candidate);
} else {
@@ -50,17 +66,56 @@
}
}
}
-
+ serveSpacerNameToSpaceDoc=getAllServerSpaces(client);
patchSpaces(client);
}
- private SpaceDocument[] patchSpaces(WebAPIClient client) throws MojoExecutionException {
+ private Map<String,SpaceDocument> getAllServerSpaces(WebAPIClient client) throws MojoExecutionException{
+ try {
+ Map<String,SpaceDocument> result=new HashMap<String,SpaceDocument>();
+ SpaceDocument[] doc=client.getAccountSpaceDocuments(username);
+ for (int i=0; i<doc.length;++i) {
+ result.put(doc[i].getDisplayName(),doc[i]);
+ }
+ return result;
+ } catch (IOException e) {
+ throw new MojoExecutionException("Unable to read server set of space documents",e);
+ }
+ }
+
+ private Map<String, TemplateDocument> getAllServerTemplates(WebAPIClient client) throws IOException {
+ Map<String, TemplateDocument> result = new HashMap<String, TemplateDocument>();
+
+ TemplateDocument[] doc = client.getTemplateDocuments(username);
+ getLog().info("Checking existing server templates...total of:"+doc.length);
+ for (int i = 0; i < doc.length; ++i) {
+ result.put(doc[i].getDisplayName(), doc[i]);
+ }
+ return result;
+ }
+
+ private void patchSpaces(WebAPIClient client) throws MojoExecutionException {
SpaceDocument fakeSpaceDoc, realSpaceDoc;
- SpaceDocument[] result=new SpaceDocument[spaces.size()];
+ Iterator<Long> iter=localSpaces.keySet().iterator();
- for (int i = 0; i < spaces.size(); ++i) {
- fakeSpaceDoc = spaces.get(i);
+ while (iter.hasNext()) {
try {
+ long localModTime = iter.next();
+ fakeSpaceDoc = localSpaces.get(localModTime);
+ if (serveSpacerNameToSpaceDoc.containsKey(fakeSpaceDoc.getDisplayName())) {
+ realSpaceDoc = serveSpacerNameToSpaceDoc.get(fakeSpaceDoc.getDisplayName());
+
+ Date fileModified=new Date(localModTime);
+ Date serverModified = TemplateSupportFileDocument.fmt.parse(realSpaceDoc.getLastModifiedAsUTC());
+ if (fileModified.before(serverModified)) {
+ getLog().info("Not patching space document "+realSpaceDoc.getDisplayName()+". Server copy is newer.");
+ continue;
+ } else {
+ //need to torch the server version b/c it's too old
+ client.deleteSpace(realSpaceDoc.getSpaceID());
+ getLog().info("Deleted old server version of "+realSpaceDoc.getDisplayName()+" ["+realSpaceDoc.getSpaceID()+"]");
+ }
+ }
realSpaceDoc = client.createSpace(fakeSpaceDoc.getDisplayName());
if (realSpaceDoc == null) {
throw new MojoExecutionException("Could not create a space for population: " + fakeSpaceDoc.getDisplayName());
@@ -94,14 +149,13 @@
client.createDoor(realSpaceID, doorDocs[j].getTemplateID(), doorDocs[j].getTemplateOwner(), doorDocs[j].getDisplayName(), doorDocs[j].getLink(), doorDocs[j].getTransform());
}
- getLog().info("Patched up space " + realSpaceDoc.getDisplayName());
- result[i]=realSpaceDoc;
+ getLog().info("Patched up space " + realSpaceDoc.getDisplayName() +" ["+realSpaceDoc.getSpaceID()+"]");
+ } catch (ParseException e) {
+ throw new MojoExecutionException("Parse exception patching space", e);
} catch (IOException e) {
- throw new MojoExecutionException("IOException patching space (" + fakeSpaceDoc.getDisplayName() + ":" + fakeSpaceDoc.getSpaceID() + ")", e);
+ throw new MojoExecutionException("IOException patching space", e);
}
}
- return result;
-
}
private void readSpace(WebAPIClient client, File candidate) throws MojoExecutionException {
@@ -120,7 +174,7 @@
FileInputStream inputStream = new FileInputStream(candidate);
String docContent = StreamUtils.readInput(inputStream);
SpaceDocument doc = new SpaceDocument(XMLElement.parseElementFromString(docContent));
- spaces.add(doc);
+ localSpaces.put(candidate.lastModified(),doc);
inputStream.close();
} catch (IOException e) {
throw new MojoExecutionException("IO Error reading space", e);
@@ -128,11 +182,10 @@
}
- private void uploadTemplate(WebAPIClient client, File candidate) throws MojoExecutionException {
+ private void uploadTemplate(WebAPIClient client, File candidate, Map<String, TemplateDocument> existing) throws MojoExecutionException {
String name = candidate.getName();
- int templateFakeId = dirNameToTemplateNumber(candidate);
+ long templateFakeId = dirNameToTemplateNumber(candidate);
- getLog().info("Uploading template #" + templateFakeId + " to " + serviceURI);
File[] objs = candidate.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.endsWith(".obj");
@@ -141,13 +194,23 @@
if (objs.length != 1) {
throw new MojoExecutionException("Badly formed directory " + name + ". Should have 1 obj file but has " + objs.length);
}
+
+ String templateVisibleName=fileToTemplateName(objs[0]);
+ if (!checkFileTemplateIsNewer(client, candidate, existing, templateVisibleName)) {
+ getLog().info("Not uploading template " + templateVisibleName + ". Server copy is newer.");
+ templateIdMap.put(templateFakeId,existing.get(templateVisibleName).getTemplateID());
+ return;
+ } else {
+ getLog().info("Uploading template #" + templateFakeId + " to " + serviceURI);
+ }
+
try {
TemplateDocument doc = fileNameToTemplateDocument(client, objs[0]);
InputStream objStream = new FileInputStream(objs[0]);
client.uploadTemplateGeometryStream(username, doc.getTemplateID(), 0, objStream);
- templateIdMap.put(new Long(templateFakeId), new Long(doc.getTemplateID()));
+ templateIdMap.put(templateFakeId, doc.getTemplateID());
getLog().info("Created template from " + objs[0].getName() + " [" + templateFakeId + " -> " + doc.getTemplateID() + "]");
File[] notObjs = candidate.listFiles(new FilenameFilter() {
@@ -181,4 +244,114 @@
}
}
+ private boolean checkFileTemplateIsNewer(WebAPIClient client, File candidate, Map<String, TemplateDocument> existing, String displayName) throws MojoExecutionException {
+ //is it even on server?
+ if (!existing.containsKey(displayName)) {
+ return true;
+ }
+
+ TemplateDocument serverCopy = existing.get(displayName);
+
+ //first check support files
+ File[] notObjs = candidate.listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return !name.endsWith(".obj");
+ }
+ });
+
+ //walk support files
+ for (int i = 0; i < notObjs.length; ++i) {
+ File supportFile = notObjs[i];
+ String supportName = supportFile.getName();
+ String modTime = null;
+ if (supportName.endsWith(".js")) {
+ if (!serverCopy.hasScriptFile()) {
+ getLog().info("You have added a javascript file since the last server update.");
+ return true;
+ }
+ modTime = serverCopy.getScriptModifiedTime();
+ } else if ((!(supportName.endsWith(".gif"))) && (!(supportName.endsWith(".jpg"))) && (!(supportName.endsWith(".png"))) && (!(supportName.endsWith(".mtl")))) {
+ continue;
+ } else {
+ modTime = serverCopy.getSupportFileModifiedTime(supportName);
+ }
+ try {
+ //if there is no modtime, then the file doesn't exist on the server
+ if (modTime == null) {
+ getLog().info("Added support file " + supportName + " to template since server copy created");
+ client.deleteTemplate(serverCopy.getTemplateID());
+ return true;
+ }
+ //modtime is now set to what the server thinks the modtime is
+ Date serverTime = fmt.parse(modTime);
+ if (serverTime.before(new Date(supportFile.lastModified()))) {
+ getLog().info("File " + supportFile + " has been modified since last upload to server...");
+ client.deleteTemplate(serverCopy.getTemplateID());
+ return true; //we can bail out now
+ }
+ } catch (IOException e) {
+ throw new MojoExecutionException("unable to delete server copy of template " + serverCopy.getDisplayName(), e);
+ } catch (ParseException e) {
+ throw new MojoExecutionException("unable to comprehend modified time", e);
+ }
+ }
+
+ //at this point we've checked the files that exist on the client side, but we might
+ //have deleted one
+ boolean destroyServerTemplate = false;
+ //special case for js
+ if (serverCopy.hasScriptFile()) {
+ File[] jsFiles = candidate.listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return name.endsWith(".js");
+ }
+ });
+ if (jsFiles.length > 1) {
+ throw new MojoExecutionException("Only one script file is allowed per template (" + candidate.getPath() + ")");
+ }
+ if (jsFiles.length == 0) {
+ getLog().info("Javascript file removed since last server update.");
+ destroyServerTemplate = true;
+ }
+ }
+ //now support files
+ String name[] = serverCopy.getAllSupportFileNames();
+ for (int i = 0; i < name.length; ++i) {
+ File f = new File(candidate, name[i]);
+ if (!f.exists()) {
+ getLog().info("You have removed the file " + name[i] + " from the template.");
+ destroyServerTemplate = true;
+ break;
+ }
+ }
+ //check the obj file
+ File[] objs = candidate.listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return name.endsWith(".obj");
+ }
+ });
+ if (objs.length != 1) {
+ throw new MojoExecutionException("You should have exactly one object (geometry) file per template directory (was " + objs.length + ")");
+ }
+ try {
+ Date fileMod = new Date(objs[0].lastModified());
+ Date onServerMod = fmt.parse(serverCopy.getGeometryModifiedTime(0));
+ if (onServerMod.before(fileMod)) {
+ getLog().info("Local geometry file is newer than server copy.");
+ destroyServerTemplate = true;
+ }
+ //implement destruction
+ if (destroyServerTemplate) {
+ client.deleteTemplate(serverCopy.getTemplateID());
+ return true;
+ } else {
+ return false;
+ }
+ } catch (IOException e) {
+ throw new MojoExecutionException("unable to delete server copy of template " + serverCopy.getDisplayName(), e);
+ } catch (ParseException e) {
+ throw new MojoExecutionException("unable to comprehend modified time", e);
+ }
+ }
+
}
\ No newline at end of file
Modified: maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/ReverseMojo.java
===================================================================
--- maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/ReverseMojo.java 2007-09-18 01:14:18 UTC (rev 413)
+++ maven/trunk/dev-plugins/src/main/java/com/ogoglio/plugin/ReverseMojo.java 2007-09-18 15:05:26 UTC (rev 414)
@@ -65,7 +65,7 @@
long localThingId = 1;
long localPossId = 1;
- SpaceDocument result = new SpaceDocument(localSpaceId, origSpaceDoc.getDisplayName(), origSpaceDoc.getOwnerUsername(), true /*origSpaceDoc.getPublished()*/, origSpaceDoc.getMaxGuests(), origSpaceDoc.getDisplaySea(), origSpaceDoc.getSeaLevel(), origSpaceDoc.getSimID());
+ SpaceDocument result = new SpaceDocument(localSpaceId, origSpaceDoc.getDisplayName(), origSpaceDoc.getOwnerUsername(), true /*origSpaceDoc.getPublished()*/, origSpaceDoc.getMaxGuests(), origSpaceDoc.getDisplaySea(), origSpaceDoc.getSeaLevel(), origSpaceDoc.getSimID(), null);
ThingDocument[] thingDocs = origSpaceDoc.getThingDocuments();
for (int i = 0; i < thingDocs.length; ++i) {
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-09-18 01:14:18 UTC (rev 413)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java 2007-09-18 15:05:26 UTC (rev 414)
@@ -16,6 +16,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
+import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Vector;
@@ -37,6 +38,7 @@
import com.ogoglio.xml.SpaceDocument;
import com.ogoglio.xml.SpaceMemberDocument;
import com.ogoglio.xml.TemplateDocument;
+import com.ogoglio.xml.TemplateSupportFileDocument;
import com.ogoglio.xml.ThingDocument;
import com.ogoglio.xml.UserDocument;
@@ -68,7 +70,7 @@
}
public SpaceDocument createSpace(String spaceName) {
- SpaceDocument spaceDoc = new SpaceDocument(-1, spaceName, authenticator.getUsername(), false, 0, false, 0, -1);
+ SpaceDocument spaceDoc = new SpaceDocument(-1, spaceName, authenticator.getUsername(), false, 0, false, 0, -1, null);
try {
return new SpaceDocument(wire.sendAuthenticatedXML(descriptor.getSpacesURI(), spaceDoc.toString(), "POST", authenticator.getAuthCookie()));
} catch (IOException e) {
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SpaceDocument.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SpaceDocument.java 2007-09-18 01:14:18 UTC (rev 413)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SpaceDocument.java 2007-09-18 15:05:26 UTC (rev 414)
@@ -13,6 +13,8 @@
limitations under the License. */
package com.ogoglio.xml;
+import java.text.ParseException;
+
import nanoxml.XMLElement;
import com.ogoglio.util.ArgumentUtils;
@@ -37,11 +39,13 @@
public static final String SIM_ID = "simid";
+ public static final String LAST_MODIFIED="lastmodified";
+
public static final int MAX_SETTING_VALUE_SIZE = 10240;
XMLElement data = null;
- public SpaceDocument(long spaceID, String displayName, String ownerUsername, boolean published, int maxGuests, boolean displaySea, double seaLevel, long simID) {
+ public SpaceDocument(long spaceID, String displayName, String ownerUsername, boolean published, int maxGuests, boolean displaySea, double seaLevel, long simID, String lastModifiedGMT) {
data = new XMLElement(NAME);
if (spaceID != -1) {
@@ -63,6 +67,10 @@
data.setAttribute(DISPLAY_SEA, displaySea);
data.setAttribute(SEA_LEVEL, seaLevel);
+ if (lastModifiedGMT!=null) {
+ data.setAttribute(LAST_MODIFIED, lastModifiedGMT);
+ }
+
if (simID != -1) {
data.setAttribute(SIM_ID, simID);
}
@@ -222,4 +230,8 @@
public double getSeaLevel() {
return data.getDoubleAttribute(SEA_LEVEL, 0);
}
+
+ public String getLastModifiedAsUTC() {
+ return data.getStringAttribute(LAST_MODIFIED,null);
+ }
}
\ No newline at end of file
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-09-18 01:14:18 UTC (rev 413)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/TemplateDocument.java 2007-09-18 15:05:26 UTC (rev 414)
@@ -181,4 +181,13 @@
}
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) {
+ XMLElement candidate = elem[i];
+ result[i]=elem[i].getStringAttribute(SUPPORT_FILE_NAME,null);
+ }
+ return result;
+ }
}
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-09-18 01:14:18 UTC (rev 413)
+++ maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/XMLTest.java 2007-09-18 15:05:26 UTC (rev 414)
@@ -2,7 +2,9 @@
import java.net.URI;
+import java.text.DateFormat;
import java.util.Date;
+import java.util.Locale;
import javax.media.j3d.Transform3D;
import javax.vecmath.Point3f;
@@ -230,7 +232,12 @@
}
public void testSpaceDocuments() {
- SpaceDocument doc1 = new SpaceDocument(spaceID1, displayName1, ownerUsername1, true, 23, false, 0, 44);
+ DateFormat fmt=DateFormat.getDateTimeInstance(DateFormat.FULL,
+ DateFormat.FULL, Locale.US);
+ Date now=new Date();
+ Date aSecondAgo=new Date(now.getTime()-1000);
+
+ SpaceDocument doc1 = new SpaceDocument(spaceID1, displayName1, ownerUsername1, true, 23, false, 0, 44, fmt.format(aSecondAgo));
assertEquals(spaceID1, doc1.getSpaceID());
assertEquals(displayName1, doc1.getDisplayName());
assertEquals(ownerUsername1, doc1.getOwnerUsername());
@@ -239,7 +246,7 @@
assertFalse(doc1.getDisplaySea());
assertEquals(0, doc1.getSeaLevel(), 0.001);
assertEquals(44, doc1.getSimID());
-
+ assertEquals(fmt.format(aSecondAgo), doc1.getLastModifiedAsUTC());
SpaceDocument doc2 = new SpaceDocument(XMLElement.parseElementFromString(doc1.toElement().toString()));
assertEquals(spaceID1, doc2.getSpaceID());
assertEquals(displayName1, doc2.getDisplayName());
@@ -250,7 +257,7 @@
assertEquals(0, doc2.getSeaLevel(), 0.001);
assertEquals(44, doc2.getSimID());
- SpaceDocument doc3 = new SpaceDocument(spaceID1, displayName1, ownerUsername1, true, 23, true, -2, 44);
+ SpaceDocument doc3 = new SpaceDocument(spaceID1, displayName1, ownerUsername1, true, 23, true, -2, 44, null);
assertTrue(doc3.getDisplaySea());
assertEquals(-2, doc3.getSeaLevel(), 0.00001);
SpaceDocument doc4 = new SpaceDocument(XMLElement.parseElementFromString(doc3.toElement().toString()));
@@ -258,14 +265,14 @@
assertEquals(-2, doc4.getSeaLevel(), 0.00001);
try {
- new SpaceDocument(spaceID1, displayName1, null, true, 4, true, 0, -1);
+ new SpaceDocument(spaceID1, displayName1, null, true, 4, true, 0, -1,null);
fail("Should not allow null ownerURI");
} catch (IllegalArgumentException e) {
//this should happen
}
try {
- new SpaceDocument(spaceID1, null, ownerUsername1, true, 0, true, 0, -1);
+ new SpaceDocument(spaceID1, null, ownerUsername1, true, 0, true, 0, -1,null);
fail("Should not allow null display name");
} catch (IllegalArgumentException e) {
//this should happen
Modified: maven/trunk/ogoglio-integration-test/pom.xml
===================================================================
--- maven/trunk/ogoglio-integration-test/pom.xml 2007-09-18 01:14:18 UTC (rev 413)
+++ maven/trunk/ogoglio-integration-test/pom.xml 2007-09-18 15:05:26 UTC (rev 414)
@@ -118,7 +118,7 @@
<home>${ogoglio.tmp.tomcat5x}</home>
<properties>
<cargo.servlet.port>
- 8080
+ ${ogoglio.port}
</cargo.servlet.port>
<cargo.logging>high</cargo.logging>
</properties>
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-09-18 01:14:18 UTC (rev 413)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2007-09-18 15:05:26 UTC (rev 414)
@@ -20,6 +20,7 @@
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
+import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;
import java.util.Random;
@@ -209,6 +210,8 @@
WebAPIAuthenticator advancedAuth = new WebAPIAuthenticator(wire1, descriptor1, USERNAME1, PASSWORD1);
WebAPIClient advancedClient = new WebAPIClient(descriptor1, advancedAuth, wire1);
SpaceDocument spaceDocument = advancedClient.createSpace("Susan's Space");
+ checkSpaceDocumentCreateTime(spaceDocument);
+
assertNotNull(spaceDocument);
advancedClient.setSpacePublished(spaceDocument.getSpaceID(), true);
@@ -267,6 +270,18 @@
}
+ private void checkSpaceDocumentCreateTime(SpaceDocument spaceDocument) {
+ try {
+ long now=new Date().getTime();
+ long lastMod=TemplateSupportFileDocument.fmt.parse(spaceDocument.getLastModifiedAsUTC()).getTime();
+ assertTrue(now-lastMod < 1000); //1 sec seems pretty safe
+ assertTrue(now-lastMod > 0); // asked for now AFTER we created the space
+ } catch (ParseException e) {
+ fail("can't parse the server's timestamp on last modified time of the space");
+ }
+
+ }
+
public void testApplet() throws AuthenticationFailedException, IOException {
WebAPIAuthenticator basicAuthenticator = new WebAPIAuthenticatorFactory().authenticate(wire1, descriptor1, USERNAME1, PASSWORD1);
assertNotNull("got null auth cookie", basicAuthenticator.getAuthCookie());
@@ -481,14 +496,33 @@
private SpaceDocument checkSpaceSeaLevel(WebAPIClient webClient1, SpaceDocument spaceDocument) throws IOException {
assertFalse(spaceDocument.getDisplaySea());
- assertEquals(0, spaceDocument.getSeaLevel(), 0.001);
- webClient1.setSpaceSeaLevel(spaceDocument.getSpaceID(), -2);
- spaceDocument = webClient1.getSpaceDocument(spaceDocument.getSpaceID(), false);
- assertEquals(-2, spaceDocument.getSeaLevel(), 0.000001);
- webClient1.setSpaceDisplaySea(spaceDocument.getSpaceID(), true);
- spaceDocument = webClient1.getSpaceDocument(spaceDocument.getSpaceID(), false);
- assertTrue(spaceDocument.getDisplaySea());
- return spaceDocument;
+
+ //redefine this here b/c we don't want linkage against internal server code
+ DateFormat fmt=TemplateSupportFileDocument.fmt;
+
+ try {
+ long lastUpdateBeforeSet = fmt.parse(spaceDocument.getLastModifiedAsUTC()).getTime();
+ Thread.sleep(1000);
+ assertEquals(0, spaceDocument.getSeaLevel(), 0.001);
+ webClient1.setSpaceSeaLevel(spaceDocument.getSpaceID(), -2);
+ //also testing that the last updated time changed
+ spaceDocument = webClient1.getSpaceDocument(spaceDocument.getSpaceID(), false);
+ //side test, make sure update time changes
+ long lastUpdateAfterSet = fmt.parse(spaceDocument.getLastModifiedAsUTC()).getTime();
+ assertTrue(lastUpdateAfterSet-lastUpdateBeforeSet>=1000);
+
+ assertEquals(-2, spaceDocument.getSeaLevel(), 0.000001);
+ webClient1.setSpaceDisplaySea(spaceDocument.getSpaceID(), true);
+ spaceDocument = webClient1.getSpaceDocument(spaceDocument.getSpaceID(), false);
+ assertTrue(spaceDocument.getDisplaySea());
+ return spaceDocument;
+ } catch (ParseException e) {
+ fail("Unable to parse the date sent from the server as the last modified time of the space");
+ return null;
+ } catch (InterruptedException e) {
+ fail("Interrupted exception timing the last space updated time");
+ return null;
+ }
}
private void checkNoConnectionToSpaceWithoutAuth(long spaceID) {
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpacePersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpacePersistTasks.java 2007-09-18 01:14:18 UTC (rev 413)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpacePersistTasks.java 2007-09-18 15:05:26 UTC (rev 414)
@@ -13,6 +13,7 @@
limitations under the License. */
package com.ogoglio.persist;
+import java.util.Date;
import java.util.Random;
import org.hibernate.Query;
@@ -70,7 +71,7 @@
}
if (dirty) {
- hibernateSession.update(record);
+ record=updateRecordAndUpdateModifiedTime(record,hibernateSession,true);
}
return record;
}
@@ -78,6 +79,16 @@
task.setSessionFactory(sessionFactory);
return (SpaceRecord) task.execute();
}
+
+ private static SpaceRecord updateRecordAndUpdateModifiedTime(SpaceRecord record, Session hibernateSession, boolean useUpdate) {
+ record.setLastModifiedTime(new Date().getTime());
+ if (useUpdate) {
+ hibernateSession.update(record);
+ } else {
+ hibernateSession.save(record);
+ }
+ return record;
+ }
public static SpaceRecord[] findAllSpaces(SessionFactory sessionFactory) throws PersistException {
HibernateTask task = new HibernateTask() {
@@ -117,7 +128,7 @@
public static void update(final SpaceRecord record, final SessionFactory sessionFactory) throws PersistException {
HibernateTask task = new HibernateTask() {
public Object run(Session hibernateSession) {
- hibernateSession.update(record);
+ updateRecordAndUpdateModifiedTime(record, hibernateSession,true);
return null;
}
};
@@ -133,10 +144,9 @@
Query simQuery = hibernateSession.getNamedQuery(SimPersistTasks.SIM_BY_ID);
simQuery.setLong("simID", spaceRecord.getSimID());
simRecord = (SimRecord) simQuery.uniqueResult();
-
if (simRecord == null || simRecord.isActive() == false) {
spaceRecord.setSimID(-1);
- hibernateSession.update(spaceRecord);
+ updateRecordAndUpdateModifiedTime(spaceRecord,hibernateSession,true);
simRecord = null;
} else {
return simRecord;
@@ -152,7 +162,7 @@
//TODO pick a sim based on load, not at random
simRecord = (SimRecord) sims[Math.abs(RANDOM.nextInt() % sims.length)];
spaceRecord.setSimID(simRecord.getSimID());
- hibernateSession.update(spaceRecord);
+ updateRecordAndUpdateModifiedTime(spaceRecord,hibernateSession,true);
return simRecord;
}
};
@@ -170,7 +180,7 @@
return null;
}
SpaceRecord record = new SpaceRecord(displayName, ownerUsername);
- hibernateSession.save(record);
+ record=updateRecordAndUpdateModifiedTime(record, hibernateSession, false);
return record;
}
};
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpaceRecord.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpaceRecord.java 2007-09-18 01:14:18 UTC (rev 413)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpaceRecord.java 2007-09-18 15:05:26 UTC (rev 414)
@@ -13,6 +13,10 @@
limitations under the License. */
package com.ogoglio.persist;
+import java.util.Date;
+
+import com.ogoglio.xml.TemplateSupportFileDocument;
+
public class SpaceRecord {
private long spaceID = -1;
@@ -31,6 +35,8 @@
private long simID = -1;
+ private long lastModifiedTime=0L;
+
public SpaceRecord() {
}
@@ -123,4 +129,16 @@
}
}
+ public void setLastModifiedTime(long time) {
+ this.lastModifiedTime=time;
+ }
+
+ public long getLastModifiedTime() {
+ return this.lastModifiedTime;
+ }
+
+ public String getLastModifiedTimeGMT() {
+ return TemplateSupportFileDocument.fmt.format(new Date(lastModifiedTime));
+ }
+
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateSupportFileRecord.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateSupportFileRecord.java 2007-09-18 01:14:18 UTC (rev 413)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateSupportFileRecord.java 2007-09-18 15:05:26 UTC (rev 414)
@@ -1,8 +1,6 @@
package com.ogoglio.persist;
-import java.text.DateFormat;
import java.util.Date;
-import java.util.Locale;
import com.ogoglio.xml.TemplateSupportFileDocument;
@@ -13,8 +11,6 @@
private int levelOfDetail = TemplateSupportFileDocument.NO_LOD;
private boolean script = false;
private Date lastChanged= null;
- public static final DateFormat fmt=DateFormat.getDateTimeInstance(DateFormat.FULL,
- DateFormat.FULL, Locale.US);
public Date getLastChanged() {
return lastChanged;
@@ -23,7 +19,7 @@
lastChanged=changed;
}
public String getLastChangedAsUTC() {
- return fmt.format(lastChanged);
+ return TemplateSupportFileDocument.fmt.format(lastChanged);
}
public int getLevelOfDetail()
{
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-09-18 01:14:18 UTC (rev 413)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java 2007-09-18 15:05:26 UTC (rev 414)
@@ -901,7 +901,7 @@
}
public SpaceDocument toSpaceDocument() {
- SpaceDocument spaceDoc = new SpaceDocument(space.getSpaceID(), space.getDisplayName(), space.getOwnerUsername(), false, 0, space.shouldDisplaySea(), space.getSeaLevel(), -1);
+ SpaceDocument spaceDoc = new SpaceDocument(space.getSpaceID(), space.getDisplayName(), space.getOwnerUsername(), false, 0, space.shouldDisplaySea(), space.getSeaLevel(), -1, null);
ThingDocument[] thingDocs = getThingDocuments();
for (int i = 0; i < thingDocs.length; i++) {
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java 2007-09-18 01:14:18 UTC (rev 413)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java 2007-09-18 15:05:26 UTC (rev 414)
@@ -195,7 +195,6 @@
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
}
-
if (!canUseMethodOnSpace(request.getMethod(), authedAccount, spaceRecord)) {
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
return;
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-09-18 01:14:18 UTC (rev 413)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/xml/server/DocumentFactory.java 2007-09-18 15:05:26 UTC (rev 414)
@@ -36,7 +36,7 @@
}
public static SpaceDocument documentFromRecord(SpaceRecord requestedRecord) {
- return new SpaceDocument(requestedRecord.getSpaceID(), requestedRecord.getDisplayName(), requestedRecord.getOwnerUsername(), requestedRecord.isPublished(), requestedRecord.getMaxGuests(), requestedRecord.getDisplaySea(), requestedRecord.getSeaLevel(), requestedRecord.getSimID());
+ return new SpaceDocument(requestedRecord.getSpaceID(), requestedRecord.getDisplayName(), requestedRecord.getOwnerUsername(), requestedRecord.isPublished(), requestedRecord.getMaxGuests(), requestedRecord.getDisplaySea(), requestedRecord.getSeaLevel(), requestedRecord.getSimID(), requestedRecord.getLastModifiedTimeGMT());
}
Modified: maven/trunk/ogoglio-server/src/main/resources/hibernate/migration-1.xml
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/hibernate/migration-1.xml 2007-09-18 01:14:18 UTC (rev 413)
+++ maven/trunk/ogoglio-server/src/main/resources/hibernate/migration-1.xml 2007-09-18 15:05:26 UTC (rev 414)
@@ -63,6 +63,7 @@
<property name="displaySea" access="field" />
<property name="seaLevel" />
<property name="simID" />
+ <property name="lastModifiedTime"/>
</class>
<class name="com.ogoglio.persist.SpaceMemberRecord" table="SpaceMemberRecords">
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-09-18 01:14:18 UTC (rev 413)
+++ maven/trunk/ogoglio-server/src/test/java/com/ogoglio/sim/script/test/ScriptTest.java 2007-09-18 15:05:26 UTC (rev 414)
@@ -28,7 +28,7 @@
TestSpaceListener listener = new TestSpaceListener();
SpaceSimulator spaceSimulator = null;
try {
- SpaceDocument spaceDocument = new SpaceDocument(1, "Space", "trevor", true, 0, false, 0, 1);
+ SpaceDocument spaceDocument = new SpaceDocument(1, "Space", "trevor", true, 0, false, 0, 1, null);
spaceSimulator = new SpaceSimulator(spaceDocument, listener);
spaceSimulator.startSim();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-09-18 01:14:15
|
Revision: 413
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=413&view=rev
Author: trevorolio
Date: 2007-09-17 18:14:18 -0700 (Mon, 17 Sep 2007)
Log Message:
-----------
Added male and female source models (open licensed by Croquet) to the maven build.
Added Paths:
-----------
maven/trunk/ogoglio-common/src/main/resources/sourceArt/
maven/trunk/ogoglio-common/src/main/resources/sourceArt/FemaleAvatar/
maven/trunk/ogoglio-common/src/main/resources/sourceArt/FemaleAvatar/License.txt
maven/trunk/ogoglio-common/src/main/resources/sourceArt/FemaleAvatar/andrea.blend
maven/trunk/ogoglio-common/src/main/resources/sourceArt/FemaleAvatar/andrea.jpg
maven/trunk/ogoglio-common/src/main/resources/sourceArt/MaleAvatar/
maven/trunk/ogoglio-common/src/main/resources/sourceArt/MaleAvatar/License.txt
maven/trunk/ogoglio-common/src/main/resources/sourceArt/MaleAvatar/Mike.blend1
maven/trunk/ogoglio-common/src/main/resources/sourceArt/MaleAvatar/mike.blend
maven/trunk/ogoglio-common/src/main/resources/sourceArt/MaleAvatar/mike.jpg
Added: maven/trunk/ogoglio-common/src/main/resources/sourceArt/FemaleAvatar/License.txt
===================================================================
--- maven/trunk/ogoglio-common/src/main/resources/sourceArt/FemaleAvatar/License.txt (rev 0)
+++ maven/trunk/ogoglio-common/src/main/resources/sourceArt/FemaleAvatar/License.txt 2007-09-18 01:14:18 UTC (rev 413)
@@ -0,0 +1,9 @@
+The Croquet License
+
+Copyright © 2002-2007 by The Croquet Consortium, Inc. and other individual, corporate, and institutional contributors who have collectively contributed elements of the CroquetTM software code to the Croquet Project. CroquetTM is a trademark of The Croquet Consortium, Inc..
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Added: maven/trunk/ogoglio-common/src/main/resources/sourceArt/FemaleAvatar/andrea.blend
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-common/src/main/resources/sourceArt/FemaleAvatar/andrea.blend
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-common/src/main/resources/sourceArt/FemaleAvatar/andrea.jpg
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-common/src/main/resources/sourceArt/FemaleAvatar/andrea.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-common/src/main/resources/sourceArt/MaleAvatar/License.txt
===================================================================
--- maven/trunk/ogoglio-common/src/main/resources/sourceArt/MaleAvatar/License.txt (rev 0)
+++ maven/trunk/ogoglio-common/src/main/resources/sourceArt/MaleAvatar/License.txt 2007-09-18 01:14:18 UTC (rev 413)
@@ -0,0 +1,9 @@
+The Croquet License
+
+Copyright © 2002-2007 by The Croquet Consortium, Inc. and other individual, corporate, and institutional contributors who have collectively contributed elements of the CroquetTM software code to the Croquet Project. CroquetTM is a trademark of The Croquet Consortium, Inc..
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Added: maven/trunk/ogoglio-common/src/main/resources/sourceArt/MaleAvatar/Mike.blend1
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-common/src/main/resources/sourceArt/MaleAvatar/Mike.blend1
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-common/src/main/resources/sourceArt/MaleAvatar/mike.blend
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-common/src/main/resources/sourceArt/MaleAvatar/mike.blend
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-common/src/main/resources/sourceArt/MaleAvatar/mike.jpg
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-common/src/main/resources/sourceArt/MaleAvatar/mike.jpg
___________________________________________________________________
Name: svn:executable
+ *
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.
|
|
From: <tre...@us...> - 2007-09-17 23:35:34
|
Revision: 412
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=412&view=rev
Author: trevorolio
Date: 2007-09-17 16:35:38 -0700 (Mon, 17 Sep 2007)
Log Message:
-----------
Refactored the way user animations are referenced so as to reduce duplicate code and allow for easy addition.
Now avatars can /wave /clap /point and /laugh in addition to the usual standing and walking animations.
Modified Paths:
--------------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.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-09-17 23:35:33 UTC (rev 411)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java 2007-09-17 23:35:38 UTC (rev 412)
@@ -164,14 +164,7 @@
}
public InputStream getUserAnimationStream(String username, long animationID) throws IOException {
- if (animationID == 1) {
- return UIConstants.getResource("avatar/avatar.bvh");
- } else if (animationID == 2) {
- return UIConstants.getResource("avatar/avatar-walk.bvh");
- } else if (animationID == 3) {
- return UIConstants.getResource("avatar/avatar-wave.bvh");
- }
- return null;
+ return UIConstants.getUserAnimation((int) animationID);
}
public InputStream getUserSkinMapStream(String username) throws IOException {
@@ -371,20 +364,24 @@
String chatMessage = event.getStringProperty(SpaceEvent.TSE_MESSAGE);
- // this is a hack to play pre-baked animations in demos
+ // this is a hack to play pre-baked animations
// TODO create a user animation record and a method to dl and play them
- if ("/wave".equals(chatMessage)) {
- SpaceEvent waveEvent = new SpaceEvent(SpaceEvent.PLAY_ANIMATION_EVENT);
- waveEvent.setProperty(SpaceEvent.USERNAME, user.getUsername());
- waveEvent.setProperty(SpaceEvent.ANIMATION_ID, new Long(3));
- listener.generatedSpaceEvent(waveEvent, SpaceSimulator.this);
- continue;
- } else if ("/point".equals(chatMessage)) {
- SpaceEvent waveEvent = new SpaceEvent(SpaceEvent.PLAY_ANIMATION_EVENT);
- waveEvent.setProperty(SpaceEvent.USERNAME, user.getUsername());
- waveEvent.setProperty(SpaceEvent.ANIMATION_ID, new Long(4));
- listener.generatedSpaceEvent(waveEvent, SpaceSimulator.this);
- continue;
+ if(chatMessage.startsWith("/") && chatMessage.length() > 1){
+ String command = chatMessage.substring(1);
+ boolean sentAnimation = false;
+ for (int i = 0; i < UIConstants.USER_ANIMATION_COMMANDS.length; i++) {
+ if(UIConstants.USER_ANIMATION_COMMANDS[i].equals(command)){
+ SpaceEvent playAnimationEvent = new SpaceEvent(SpaceEvent.PLAY_ANIMATION_EVENT);
+ playAnimationEvent.setProperty(SpaceEvent.USERNAME, user.getUsername());
+ playAnimationEvent.setProperty(SpaceEvent.ANIMATION_ID, new Long(i));
+ listener.generatedSpaceEvent(playAnimationEvent, SpaceSimulator.this);
+ sentAnimation = true;
+ break;
+ }
+ }
+ if(sentAnimation){
+ continue;
+ }
}
chatMessage = markdownChatMessage(chatMessage);
@@ -981,7 +978,7 @@
public ScriptHTTPResponse callThingHTTPService(long thingID, String method, Map parameterMap) {
Thing thing = space.getThing(thingID);
- if(thing == null){
+ if (thing == null) {
ScriptHTTPResponse response = new ScriptHTTPResponse();
response.jsConstructor(404, null, null);
return response;
@@ -1037,7 +1034,7 @@
}
public InputStream getSubGeometryStream(String name) throws IOException {
- if("loading.mtl".equals(name)){
+ if ("loading.mtl".equals(name)) {
return UIConstants.getResource("templates/loading.mtl");
}
return null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|