You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(46) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(185) |
Feb
(242) |
Mar
(237) |
Apr
(180) |
May
(102) |
Jun
(278) |
Jul
(114) |
Aug
(92) |
Sep
(246) |
Oct
(212) |
Nov
(279) |
Dec
(99) |
| 2007 |
Jan
(130) |
Feb
(194) |
Mar
(22) |
Apr
(72) |
May
(40) |
Jun
(111) |
Jul
(114) |
Aug
(154) |
Sep
(114) |
Oct
(2) |
Nov
(1) |
Dec
(5) |
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(51) |
Nov
(34) |
Dec
(130) |
| 2009 |
Jan
(22) |
Feb
(20) |
Mar
(41) |
Apr
(45) |
May
(82) |
Jun
(96) |
Jul
(48) |
Aug
(90) |
Sep
(13) |
Oct
(49) |
Nov
(31) |
Dec
(21) |
| 2010 |
Jan
(25) |
Feb
(9) |
Mar
(7) |
Apr
(28) |
May
(27) |
Jun
(7) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
(13) |
Dec
(2) |
| 2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <cn...@us...> - 2009-07-10 02:52:19
|
Revision: 419
http://hgengine.svn.sourceforge.net/hgengine/?rev=419&view=rev
Author: cnlohr
Date: 2009-07-10 02:52:18 +0000 (Fri, 10 Jul 2009)
Log Message:
-----------
update Windows project and fix operation on Windows.
Modified Paths:
--------------
Mercury2/Mercury2.vcproj
Mercury2/src/MercuryNamedResource.cpp
Mercury2/src/OGLExtensions.cpp
Mercury2/src/OGLExtensions.h
Mercury2/src/Shader.cpp
Mercury2/src/Win32Window.cpp
Modified: Mercury2/Mercury2.vcproj
===================================================================
--- Mercury2/Mercury2.vcproj 2009-07-10 02:44:44 UTC (rev 418)
+++ Mercury2/Mercury2.vcproj 2009-07-10 02:52:18 UTC (rev 419)
@@ -6,7 +6,6 @@
ProjectGUID="{071CC088-86A7-4A9F-9FEE-50BD69132886}"
RootNamespace="Mercury2"
Keyword="Win32Proj"
- TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
@@ -66,8 +65,6 @@
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@@ -89,6 +86,9 @@
Name="VCAppVerifierTool"
/>
<Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
@@ -142,8 +142,6 @@
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@@ -165,6 +163,9 @@
Name="VCAppVerifierTool"
/>
<Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
@@ -190,10 +191,6 @@
>
</File>
<File
- RelativePath=".\src\Camera.h"
- >
- </File>
- <File
RelativePath=".\src\Frustum.cpp"
>
</File>
@@ -202,10 +199,6 @@
>
</File>
<File
- RelativePath=".\src\FullscreenQuad.h"
- >
- </File>
- <File
RelativePath=".\src\GLHelpers.cpp"
>
</File>
@@ -278,6 +271,10 @@
>
</File>
<File
+ RelativePath=".\src\MercuryNamedResource.cpp"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryNode.cpp"
>
</File>
@@ -290,10 +287,18 @@
>
</File>
<File
+ RelativePath=".\src\MercuryPrefs.cpp"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryString.cpp"
>
</File>
<File
+ RelativePath=".\src\MercuryTheme.cpp"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryThreads.cpp"
>
</File>
@@ -322,10 +327,6 @@
>
</File>
<File
- RelativePath=".\src\ModuleManager.h"
- >
- </File>
- <File
RelativePath=".\src\MQuaternion.cpp"
>
</File>
@@ -400,10 +401,18 @@
>
</File>
<File
+ RelativePath=".\src\Camera.h"
+ >
+ </File>
+ <File
RelativePath=".\src\Frustum.h"
>
</File>
<File
+ RelativePath=".\src\FullscreenQuad.h"
+ >
+ </File>
+ <File
RelativePath=".\src\glext.h"
>
</File>
@@ -496,6 +505,10 @@
>
</File>
<File
+ RelativePath=".\src\MercuryNamedResource.h"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryNode.h"
>
</File>
@@ -508,10 +521,18 @@
>
</File>
<File
+ RelativePath=".\src\MercuryPrefs.h"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryString.h"
>
</File>
<File
+ RelativePath=".\src\MercuryTheme.h"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryThreads.h"
>
</File>
@@ -548,6 +569,10 @@
>
</File>
<File
+ RelativePath=".\src\ModuleManager.h"
+ >
+ </File>
+ <File
RelativePath=".\src\MQuaternion.h"
>
</File>
Modified: Mercury2/src/MercuryNamedResource.cpp
===================================================================
--- Mercury2/src/MercuryNamedResource.cpp 2009-07-10 02:44:44 UTC (rev 418)
+++ Mercury2/src/MercuryNamedResource.cpp 2009-07-10 02:52:18 UTC (rev 419)
@@ -1,7 +1,7 @@
#include <MercuryNamedResource.h>
#include <MercuryUtil.h>
+#include <stdio.h>
-
MString MercuryNamedResource::GetValueS( const MString & sDataPointer )
{
MString ret;
@@ -35,7 +35,11 @@
void MercuryNamedResource::SetValueF( const MString & sDataPointer, float fValue )
{
char sset[64];
+#ifdef WIN32
+ _snprintf_s( sset, 63, "%f", fValue );
+#else
snprintf( sset, 63, "%f", fValue );
+#endif
SetValueS( sDataPointer, sset );
}
@@ -83,7 +87,11 @@
void MercuryNamedResource::SetValueI( const MString & sDataPointer, int iValue )
{
char sset[64];
+#ifdef WIN32
+ _snprintf_s( sset, 63, "%d", iValue );
+#else
snprintf( sset, 63, "%d", iValue );
+#endif
SetValueS( sDataPointer, sset );
}
Modified: Mercury2/src/OGLExtensions.cpp
===================================================================
--- Mercury2/src/OGLExtensions.cpp 2009-07-10 02:44:44 UTC (rev 418)
+++ Mercury2/src/OGLExtensions.cpp 2009-07-10 02:52:18 UTC (rev 419)
@@ -47,6 +47,12 @@
PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB;
PFNGLUNIFORMMATRIX4FVARBPROC glUniformMatrix4fvARB;
+PFNGLDELETEQUERIESARBPROC glDeleteQueriesARB;
+PFNGLGENQUERIESARBPROC glGenQueriesARB;
+PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB;
+PFNGLBEGINQUERYARBPROC glBeginQueryARB;
+PFNGLENDQUERYARBPROC glEndQueryARB;
+
#define EXTENSION( proc, name ) \
name = (proc)wglGetProcAddress( #name ); \
if( !name ) \
@@ -96,4 +102,11 @@
EXTENSION( PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC, glFramebufferRenderbufferEXT );
EXTENSION( PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC, glCheckFramebufferStatusEXT );
EXTENSION( PFNGLDRAWBUFFERSARBPROC, glDrawBuffersARB );
+
+
+EXTENSION( PFNGLDELETEQUERIESARBPROC, glDeleteQueriesARB );
+EXTENSION( PFNGLGENQUERIESARBPROC, glGenQueriesARB );
+EXTENSION( PFNGLGETQUERYOBJECTUIVARBPROC, glGetQueryObjectuivARB );
+EXTENSION( PFNGLBEGINQUERYARBPROC, glBeginQueryARB );
+EXTENSION( PFNGLENDQUERYARBPROC, glEndQueryARB );
}
Modified: Mercury2/src/OGLExtensions.h
===================================================================
--- Mercury2/src/OGLExtensions.h 2009-07-10 02:44:44 UTC (rev 418)
+++ Mercury2/src/OGLExtensions.h 2009-07-10 02:52:18 UTC (rev 419)
@@ -41,6 +41,13 @@
extern PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT;
extern PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT;
extern PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB;
+
+extern PFNGLDELETEQUERIESARBPROC glDeleteQueriesARB;
+extern PFNGLGENQUERIESARBPROC glGenQueriesARB;
+extern PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB;
+extern PFNGLBEGINQUERYARBPROC glBeginQueryARB;
+extern PFNGLENDQUERYARBPROC glEndQueryARB;
+
void SetupOGLExtensions();
#endif
\ No newline at end of file
Modified: Mercury2/src/Shader.cpp
===================================================================
--- Mercury2/src/Shader.cpp 2009-07-10 02:44:44 UTC (rev 418)
+++ Mercury2/src/Shader.cpp 2009-07-10 02:52:18 UTC (rev 419)
@@ -6,7 +6,9 @@
#include <string.h>
//Because we need to dynamically check for glProgramParameteriEXT, even in Linux.
+#ifndef WIN32
#include <GL/glx.h>
+#endif
using namespace std;
Modified: Mercury2/src/Win32Window.cpp
===================================================================
--- Mercury2/src/Win32Window.cpp 2009-07-10 02:44:44 UTC (rev 418)
+++ Mercury2/src/Win32Window.cpp 2009-07-10 02:52:18 UTC (rev 419)
@@ -116,6 +116,8 @@
ShowWindow(m_hwnd,SW_SHOW);
SetForegroundWindow(m_hwnd); // Slightly Higher Priority
SetFocus(m_hwnd); // Sets Keyboard Focus To The Window
+
+
}
void Win32Window::SetPixelType()
@@ -175,6 +177,12 @@
bool Win32Window::SwapBuffers()
{
+ glEnable(GL_DEPTH_TEST);
+ glEnable(GL_CULL_FACE);
+ glEnable(GL_NORMALIZE);
+ glEnable (GL_BLEND);
+ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
return (::SwapBuffers( m_hdc )==TRUE);
}
@@ -184,14 +192,35 @@
while (PeekMessage(&message, NULL, 0, 0, PM_REMOVE))
{
- // Stop Update if the user is trying to quit
- if (message.message == WM_QUIT)
+ switch( message.message )
+ {
+ case WM_QUIT:
return false;
- else
- {
- TranslateMessage(&message); // Translate The Message
- DispatchMessage(&message); // Dispatch The Message
+ case WM_KEYDOWN:
+ printf( "%d\n", message.lParam>>16 );
+ break;
+ case WM_KEYUP:
+ break;
+ case WM_MOUSEMOVE:
+ break;
+ case WM_LBUTTONDOWN:
+ break;
+ case WM_LBUTTONUP:
+ break;
+ case WM_RBUTTONDOWN:
+ break;
+ case WM_RBUTTONUP:
+ break;
+ case WM_MBUTTONDOWN:
+ break;
+ case WM_MBUTTONUP:
+ break;
+ case 0x020A: //Do nothing (at least now) It's a mouse wheel!
+ break;
}
+
+ TranslateMessage(&message); // Translate The Message
+ DispatchMessage(&message); // Dispatch The Message
}
return true;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2009-07-10 02:44:49
|
Revision: 418
http://hgengine.svn.sourceforge.net/hgengine/?rev=418&view=rev
Author: cnlohr
Date: 2009-07-10 02:44:44 +0000 (Fri, 10 Jul 2009)
Log Message:
-----------
add readme to get list of apps needed on Ubuntu (And soon to add more info)
Added Paths:
-----------
Mercury2/README
Added: Mercury2/README
===================================================================
--- Mercury2/README (rev 0)
+++ Mercury2/README 2009-07-10 02:44:44 UTC (rev 418)
@@ -0,0 +1,15 @@
+README for Mercury2
+
+This file contains notes relating to Mercury2 that is useful to the developers,
+and potentially users.
+
+
+
+* What packages do I need in order to use Mercury 2?
+
+On Ubuntu/Debian:
+ (for subversion)
+ $ sudo apt-get install subversion
+ (for everything else) (note that mesa includes OpenGL and libpng-dev includes zlib-dev)
+ $ sudo apt-get install build-essential libglu1-mesa-dev libpng-dev libxml2-dev
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2009-07-09 04:29:50
|
Revision: 417
http://hgengine.svn.sourceforge.net/hgengine/?rev=417&view=rev
Author: cnlohr
Date: 2009-07-09 04:29:49 +0000 (Thu, 09 Jul 2009)
Log Message:
-----------
standardize scancodes to the HG1 standard.
Modified Paths:
--------------
Mercury2/src/Camera.cpp
Mercury2/src/X11Window.cpp
Mercury2/src/X11Window.h
Added Paths:
-----------
Mercury2/docs/KeyboardCodes.png
Mercury2/docs/KeyboardKeys.png
Added: Mercury2/docs/KeyboardCodes.png
===================================================================
(Binary files differ)
Property changes on: Mercury2/docs/KeyboardCodes.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/docs/KeyboardKeys.png
===================================================================
(Binary files differ)
Property changes on: Mercury2/docs/KeyboardKeys.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: Mercury2/src/Camera.cpp
===================================================================
--- Mercury2/src/Camera.cpp 2009-07-08 05:27:14 UTC (rev 416)
+++ Mercury2/src/Camera.cpp 2009-07-09 04:29:49 UTC (rev 417)
@@ -71,11 +71,11 @@
float a = 0;
float b = 0;
- if ( KeyboardInput::IsKeyDown(25) ) a += dTime*2; //W
- if ( KeyboardInput::IsKeyDown(39) ) a -= dTime*2; //S
+ if ( KeyboardInput::IsKeyDown('w') ) a += dTime*2; //W
+ if ( KeyboardInput::IsKeyDown('s') ) a -= dTime*2; //S
- if ( KeyboardInput::IsKeyDown(38) ) b -= dTime*2; //A
- if ( KeyboardInput::IsKeyDown(40) ) b += dTime*2; //D
+ if ( KeyboardInput::IsKeyDown('a') ) b -= dTime*2; //A
+ if ( KeyboardInput::IsKeyDown('d') ) b += dTime*2; //D
MercuryVector Xaxis = m_lookAt.CrossProduct( MercuryVector(0,1,0) );
Xaxis.NormalizeSelf();
Modified: Mercury2/src/X11Window.cpp
===================================================================
--- Mercury2/src/X11Window.cpp 2009-07-08 05:27:14 UTC (rev 416)
+++ Mercury2/src/X11Window.cpp 2009-07-09 04:29:49 UTC (rev 417)
@@ -5,6 +5,84 @@
Callback0R< MercuryWindow* > MercuryWindow::genWindowClbk(X11Window::GenX11Window); //Register window generation callback
+//XXX: THIS SECTION IS INCOMPLETE! IT NEEDS The right half of the keyboard (Bar arrow keys) + it needs the windows keys/sel keys mapped
+short X11Window::ConvertScancode( int scanin )
+{
+ switch( scanin )
+ {
+ case 9: return 27; //esc
+ case 19: return '0';
+ case 49: return 97; //`
+ case 22: return 8; //backspace
+ case 95: return 292; //F11
+ case 96: return 293; //F12
+ case 20: return 45; //-
+ case 21: return 61; //=
+ case 51: return 92; //backslash
+ case 23: return 9; //tab
+ case 50: return 160; //[lshift]
+ case 62: return 161; //[rshift]
+
+ case 38: return 'a';
+ case 56: return 'b';
+ case 54: return 'c';
+ case 40: return 'd';
+ case 26: return 'e';
+ case 41: return 'f';
+ case 42: return 'g';
+ case 43: return 'h';
+ case 31: return 'i';
+ case 44: return 'j';
+ case 45: return 'k';
+ case 46: return 'l';
+ case 58: return 'm';
+ case 57: return 'n';
+ case 32: return 'o';
+ case 33: return 'p';
+ case 24: return 'q';
+ case 27: return 'r';
+ case 39: return 's';
+ case 28: return 't';
+ case 30: return 'u';
+ case 55: return 'v';
+ case 25: return 'w';
+ case 53: return 'x';
+ case 29: return 'y';
+ case 52: return 'z';
+
+ case 34: return 91; //misc keys inbetween letters and enter
+ case 35: return 93;
+ case 47: return 59;
+ case 48: return 39;
+ case 59: return 44;
+ case 60: return 46;
+ case 61: return 47;
+
+ case 111: return 273; //arrow keys
+ case 113: return 276;
+ case 114: return 275;
+ case 116: return 274;
+
+ case 37: return 162; //ctrl, win, alt
+ case 133: return 91;
+ case 64: return 164;
+
+ case 108: return 165; //RIGHT buttons like ctrl, sel, alt
+ case 135: return 93;
+ case 105: return 263;
+
+ case 36: return 13;
+ case 66: return 15;
+
+ default:
+ if( scanin >= 10 && scanin <= 18 )
+ return scanin + ( (short)'1' - 10 );
+ if( scanin >= 67 && scanin <= 76 ) //f1-f10
+ return scanin + ( 282 - 67 );
+ return scanin;
+ }
+}
+
X11Window::X11Window(const MString& title, int width, int height, int bits, int depthBits, bool fullscreen)
:MercuryWindow(title, width, height, bits, depthBits, fullscreen), m_display(NULL)
{
@@ -165,8 +243,8 @@
{
//ignore autorepeat
if ( IsKeyRepeat(&event.xkey) ) break;
-
- KeyboardInput::ProcessKeyInput(event.xkey.keycode, true, false);
+
+ KeyboardInput::ProcessKeyInput( ConvertScancode( event.xkey.keycode ), true, false);
break;
}
case KeyRelease:
@@ -174,7 +252,7 @@
//ignore autorepeat
if ( IsKeyRepeat(&event.xkey) ) break;
- KeyboardInput::ProcessKeyInput(event.xkey.keycode, false, false);
+ KeyboardInput::ProcessKeyInput( ConvertScancode( event.xkey.keycode ), false, false);
break;
}
case MotionNotify:
Modified: Mercury2/src/X11Window.h
===================================================================
--- Mercury2/src/X11Window.h 2009-07-08 05:27:14 UTC (rev 416)
+++ Mercury2/src/X11Window.h 2009-07-09 04:29:49 UTC (rev 417)
@@ -13,7 +13,7 @@
virtual ~X11Window();
static MercuryWindow* GenX11Window();
-
+ static short ConvertScancode( int scanin );
virtual bool SwapBuffers();
virtual bool PumpMessages();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2009-07-08 05:27:15
|
Revision: 416
http://hgengine.svn.sourceforge.net/hgengine/?rev=416&view=rev
Author: cnlohr
Date: 2009-07-08 05:27:14 +0000 (Wed, 08 Jul 2009)
Log Message:
-----------
remove need for freeglut on Linux, and enable compilation and running on systems missing the not-universal
glProgramParameteriEXT function.
Modified Paths:
--------------
Mercury2/src/GLHeaders.h
Mercury2/src/Shader.cpp
Modified: Mercury2/src/GLHeaders.h
===================================================================
--- Mercury2/src/GLHeaders.h 2009-07-08 05:25:47 UTC (rev 415)
+++ Mercury2/src/GLHeaders.h 2009-07-08 05:27:14 UTC (rev 416)
@@ -15,7 +15,7 @@
#include <OGLExtensions.h>
#else
#include <GL/glext.h>
-#include <GL/freeglut.h>
+#include <GL/glu.h>
#endif
#include <GLHelpers.h>
@@ -34,4 +34,4 @@
assert(0); } }
-#endif
\ No newline at end of file
+#endif
Modified: Mercury2/src/Shader.cpp
===================================================================
--- Mercury2/src/Shader.cpp 2009-07-08 05:25:47 UTC (rev 415)
+++ Mercury2/src/Shader.cpp 2009-07-08 05:27:14 UTC (rev 416)
@@ -5,12 +5,20 @@
#include <GLHeaders.h>
#include <string.h>
+//Because we need to dynamically check for glProgramParameteriEXT, even in Linux.
+#include <GL/glx.h>
+
using namespace std;
REGISTER_ASSET_TYPE( Shader );
Shader * Shader::CurrentShader = NULL;
+//On many GL Implementations, this is super wonky.
+//It may not even exist at all, so we make it optional.
+bool IsCustomGLProgramParISet = false;
+PFNGLPROGRAMPARAMETERIEXTPROC CustomGLProgramParI;
+
ShaderAttribute * ShaderAttributesSet::GetHandle( const MString & sName )
{
ShaderAttribute * ret = m_AllShaderAttributes[sName];
@@ -31,6 +39,16 @@
iTimeCode[0] = 0;
iTimeCode[1] = 0;
iTimeCode[2] = 0;
+
+#ifdef WIN32
+ CustomGLProgramParI = glProgramParameteriEXT;
+#else
+ if( !IsCustomGLProgramParISet )
+ {
+ CustomGLProgramParI = (PFNGLPROGRAMPARAMETERIEXTPROC)glXGetProcAddress( (GLubyte*)"glProgramParameteriEXT" );
+ IsCustomGLProgramParISet = true;
+ }
+#endif
}
Shader::~Shader()
@@ -272,10 +290,10 @@
glLinkProgramARB( iProgramID );
//If we're using a geometry shader, we have to do a little extra.
- if( geometryShader )
+ if( CustomGLProgramParI && geometryShader )
{
- glProgramParameteriEXT( iProgramID, GL_GEOMETRY_INPUT_TYPE_EXT, GL_TRIANGLES );
- glProgramParameteriEXT( iProgramID, GL_GEOMETRY_OUTPUT_TYPE_EXT, GL_TRIANGLE_STRIP );
+ CustomGLProgramParI( iProgramID, GL_GEOMETRY_INPUT_TYPE_EXT, GL_TRIANGLES );
+ CustomGLProgramParI( iProgramID, GL_GEOMETRY_OUTPUT_TYPE_EXT, GL_TRIANGLE_STRIP );
int ierror, i;
GLint imaxvert;
@@ -288,7 +306,7 @@
}
for( i = 1; i < imaxvert; i++ )
{
- glProgramParameteriEXT(iProgramID,GL_GEOMETRY_VERTICES_OUT_EXT,imaxvert/i);
+ CustomGLProgramParI(iProgramID,GL_GEOMETRY_VERTICES_OUT_EXT,imaxvert/i);
if( glGetError() == 0 )
break;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2009-07-08 05:25:49
|
Revision: 415
http://hgengine.svn.sourceforge.net/hgengine/?rev=415&view=rev
Author: cnlohr
Date: 2009-07-08 05:25:47 +0000 (Wed, 08 Jul 2009)
Log Message:
-----------
require G++, not gcc for linking, as to catch missing G++ more clearly.
Modified Paths:
--------------
Mercury2/cnconfigure
Modified: Mercury2/cnconfigure
===================================================================
--- Mercury2/cnconfigure 2009-07-06 21:08:22 UTC (rev 414)
+++ Mercury2/cnconfigure 2009-07-08 05:25:47 UTC (rev 415)
@@ -72,9 +72,9 @@
fi
echo "Link line used: g++ $CC_BASE $LD_BASE"
-echo -n "Checking to make sure ldflags and linker are acceptable... "
+echo -n "Checking to make sure ldflags and cflags are acceptable... "
echo -e "int main() { return 0; }" > tmp.c
-if gcc $CC_BASE $LD_BASE -o bar tmp.c 1> foo 2> foo; then
+if g++ $CC_BASE $LD_BASE -o bar tmp.c 1> foo 2> foo; then
rm ./tmp.c
rm ./foo
rm ./bar
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-07-06 21:08:25
|
Revision: 414
http://hgengine.svn.sourceforge.net/hgengine/?rev=414&view=rev
Author: axlecrusher
Date: 2009-07-06 21:08:22 +0000 (Mon, 06 Jul 2009)
Log Message:
-----------
finish bounding box frustum cull
Modified Paths:
--------------
Mercury2/src/BoundingBox.cpp
Mercury2/src/BoundingBox.h
Mercury2/src/Mercury2.cpp
Mercury2/src/MercuryAsset.cpp
Modified: Mercury2/src/BoundingBox.cpp
===================================================================
--- Mercury2/src/BoundingBox.cpp 2009-07-06 16:18:18 UTC (rev 413)
+++ Mercury2/src/BoundingBox.cpp 2009-07-06 21:08:22 UTC (rev 414)
@@ -86,140 +86,61 @@
bb.m_normals[1] = (m * MercuryVector(0,1,0)).Normalize();
bb.m_normals[2] = (m * MercuryVector(0,0,1)).Normalize();
+ //compute box vertices into world coordinates
+ //it would be nice to do this without needing to save
+ //the result in the bounding box.
+ //XXX look into ways to optimize this
+ MercuryMatrix mm = m;
+ mm.Translate( m_center );
+ mm.Scale( m_extend );
+
+ bb.v[0] = mm * MercuryVertex(-1, 1, 1, 1);
+ bb.v[1] = mm * MercuryVertex(-1, -1, 1, 1);
+ bb.v[2] = mm * MercuryVertex(1, -1, 1, 1);
+ bb.v[3] = mm * MercuryVertex(1, 1, 1, 1);
+
+ bb.v[4] = mm * MercuryVertex(-1, 1, -1, 1);
+ bb.v[5] = mm * MercuryVertex(-1, -1, -1, 1);
+ bb.v[6] = mm * MercuryVertex(1, -1, -1, 1);
+ bb.v[7] = mm * MercuryVertex(1, 1, -1, 1);
+
*this = bb;
}
bool BoundingBox::Clip( const MercuryPlane& p )
{
//do a quick spherical test using the signed distance
+ //from the center of the box
float d = p.GetNormal().DotProduct( m_center - p.GetCenter() );
- if (d < -m_extend.Length()) return true;
- return false;
+ if (d < -m_extend.Length()) return true; //sphere is further than radius distance behind plane
- ///XXX everything below is broken
+ //all points must be behind a plane to be considered clipped
+ bool clip = true;
+ for (uint8_t i = 0; (i < 8) && clip; ++i)
+ clip = p.IsBehindPlane( v[i] );
- MercuryVector dp; //plain normal in box space
-// dp = p.GetNormal().DotProduct3(m_normals[0],m_normals[2],m_normals[3]);
- dp[0] = m_normals[0].DotProduct( p.GetNormal() );
- dp[1] = m_normals[1].DotProduct( p.GetNormal() );
- dp[2] = m_normals[2].DotProduct( p.GetNormal() );
- dp.NormalizeSelf();
-// dp = p.GetNormal();
-
- MercuryVertex P; //max
- if (dp[0] >= 0) P[0] = m_center.GetX() + m_extend.GetX();
- if (dp[1] >= 0) P[1] = m_center.GetY() + m_extend.GetY();
- if (dp[2] >= 0) P[2] = m_center.GetZ() + m_extend.GetZ();
-
- MercuryVertex N; //min
- if (dp[0] >= 0) N[0] = m_center.GetX() - m_extend.GetX();
- if (dp[1] >= 0) N[1] = m_center.GetY() - m_extend.GetY();
- if (dp[2] >= 0) N[2] = m_center.GetZ() - m_extend.GetZ();
-
- float x = dp.DotProduct( P );
- float y = dp.DotProduct( N );
-// printf("p %f n %f\n", x, y);
- if ( x < 0)
- return true; //max value outside
- if ( y < 0) //is negative value outside
- return false; //intersect
-
- return false;
-/*
- db * m_extend;
- float x = ABS( m_extend.GetX() * dp[0] );
- x += ABS( m_extend.GetY() * dp[1] );
- x += ABS( m_extend.GetZ() * dp[2] );
-
- float d = p.GetNormal().DotProduct( m_center+p.GetCenter() ); //signed distance
- if ( ABS(d) <= x ) //intersection
- return false;
-
- return BEHIND_PLANE(d); //if we don't intersect, just see what side we are on
- */
+ return clip;
}
bool BoundingBox::Clip( const Frustum& f )
{
bool clipped = false;
for (uint8_t i = 0; (i < 6) && !clipped; ++i)
- {
- bool t = Clip( f.GetPlane(i) );
-// printf("p%d %d\n", i, t);
- clipped = t;
- }
-// printf("******\n");
-// return false;
+ clipped = Clip( f.GetPlane(i) );
return clipped;
}
-//bool BoundingBox::FrustumCull() const
-//{
- /*feedback in openGL is probably depreciated
- and is known to fallback to software
- the OcclusionTest provides the same performence
- it is probably best to avoid using this function */
-/*
- static float b[3];
- uint32_t samples;
- const float* center = GetCenter();
- const float* extend = GetExtend();
-
- glPushAttrib( GL_CURRENT_BIT | GL_ENABLE_BIT );
- glDisable(GL_CULL_FACE);
-
- glPushMatrix();
- glTranslatef(center[0], center[1], center[2]);
- glScalef(extend[0],extend[1],extend[2]);
-
- uint8_t tCount = Texture::NumberActiveTextures();
- for (uint8_t i = 0; i < tCount; ++i)
- {
- glActiveTexture( GL_TEXTURE0+i );
- glClientActiveTextureARB( GL_TEXTURE0+i );
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisable( GL_TEXTURE_2D );
- }
- glFeedbackBuffer(3, GL_3D, b);
- glRenderMode( GL_FEEDBACK );
-
- InitVBO();
-
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, m_vboID);
- glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
- glVertexPointer(3, GL_FLOAT, 0, 0);
- glDrawArrays(GL_QUADS, 0, 24);
-
- for (uint8_t i = 0; i < tCount; ++i)
- {
- glActiveTexture( GL_TEXTURE0+i );
- glClientActiveTextureARB(GL_TEXTURE0+i);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glEnable( GL_TEXTURE_2D );
- }
-
- samples = glRenderMode( GL_RENDER );
- glPopMatrix();
- glPopAttrib( );
-
-// return false;
- return samples==0;
-}
-*/
-
bool BoundingBox::DoFrustumTest( const MercuryMatrix& m )
{
BoundingBox bb(*this);
// bb.Render();
bb.Transform( m );
-// bb.Render();
return bb.Clip( *FRUSTUM );
}
void BoundingBox::DoOcclusionTest( OcclusionResult& result )
{
- return;
const float* center = GetCenter();
const float* extend = GetExtend();
Modified: Mercury2/src/BoundingBox.h
===================================================================
--- Mercury2/src/BoundingBox.h 2009-07-06 16:18:18 UTC (rev 413)
+++ Mercury2/src/BoundingBox.h 2009-07-06 21:08:22 UTC (rev 414)
@@ -99,6 +99,7 @@
static AlignedBuffer<float> m_vertexData;
static uint32_t m_vboID;
+ MercuryVertex v[8];
};
#endif
Modified: Mercury2/src/Mercury2.cpp
===================================================================
--- Mercury2/src/Mercury2.cpp 2009-07-06 16:18:18 UTC (rev 413)
+++ Mercury2/src/Mercury2.cpp 2009-07-06 21:08:22 UTC (rev 414)
@@ -20,6 +20,7 @@
#include <MercuryFile.h>
bool SHOWBOUNDINGVOLUME = false;
bool SHOWAXISES = false;
+bool DOOCCLUSIONCULL = false;
MSemaphore UpdateLoopGo;
void* UpdateThread(void* node)
Modified: Mercury2/src/MercuryAsset.cpp
===================================================================
--- Mercury2/src/MercuryAsset.cpp 2009-07-06 16:18:18 UTC (rev 413)
+++ Mercury2/src/MercuryAsset.cpp 2009-07-06 21:08:22 UTC (rev 414)
@@ -3,6 +3,8 @@
#include <MercuryNode.h>
#include <GLHeaders.h>
+extern bool DOOCCLUSIONCULL;
+
MercuryAsset::MercuryAsset()
:m_isInstanced(false), m_boundingVolume(NULL), m_loadState(NONE)
{
@@ -42,7 +44,7 @@
if ( m_boundingVolume )
{
n->SetCulled( m_boundingVolume->DoFrustumTest(matrix) );
- if ( !n->IsCulled() )
+ if ( !n->IsCulled() && DOOCCLUSIONCULL)
m_boundingVolume->DoOcclusionTest( n->GetOcclusionResult() );
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-07-06 16:18:19
|
Revision: 413
http://hgengine.svn.sourceforge.net/hgengine/?rev=413&view=rev
Author: axlecrusher
Date: 2009-07-06 16:18:18 +0000 (Mon, 06 Jul 2009)
Log Message:
-----------
simple bounding box frustum culling is working
Modified Paths:
--------------
Mercury2/src/BoundingBox.cpp
Mercury2/src/HGMDLModel.cpp
Mercury2/src/HGMDLModel.h
Mercury2/src/MercuryAsset.cpp
Mercury2/src/MercuryAsset.h
Mercury2/src/MercuryNode.cpp
Mercury2/src/MercuryPlane.cpp
Modified: Mercury2/src/BoundingBox.cpp
===================================================================
--- Mercury2/src/BoundingBox.cpp 2009-07-06 16:14:59 UTC (rev 412)
+++ Mercury2/src/BoundingBox.cpp 2009-07-06 16:18:18 UTC (rev 413)
@@ -56,37 +56,77 @@
void BoundingBox::ComputeNormals()
{
- //normals are probably just the cardinal axises
-/* MercuryVertex t(m_center, 0);
+ //these need to be the normals of each face
+ /*
+ MercuryVertex t(m_center, 0);
t.SetX( t.GetX() + m_extend.GetX() );
- m_normals[0] = t;//.Normalize();
+ m_normals[0] = (m_center - t).Normalize();
t = m_center;
t.SetY( t.GetY() + m_extend.GetY() );
- m_normals[1] = t;//.Normalize();
+ m_normals[1] = (m_center - t).Normalize();
t = m_center;
t.SetZ( t.GetZ() + m_extend.GetZ() );
- m_normals[2] = t;//.Normalize();
+ m_normals[2] = (m_center - t).Normalize();
+ m_normals[0].Print();
*/
}
void BoundingBox::Transform( const MercuryMatrix& m )
{
+ //the frustum planes are defined in world space so
+ //these values need to be transformed into world space
BoundingBox bb;
- bb.m_extend = m_extend;
- MercuryMatrix mm = m * FRUSTUM->GetMatrix();
- bb.m_center = mm * MercuryVertex(m_center, 1);
- bb.m_normals[0] = (mm * MercuryVector(1.0f,0,0,0)).Normalize();
- bb.m_normals[1] = (mm * MercuryVector(0,1.0f,0,0)).Normalize();
- bb.m_normals[2] = (mm * MercuryVector(0,0,1.0f,0)).Normalize();
-// bb.Render();
+ bb.m_extend = m * m_extend; //Rotate and scale
+ bb.m_center = m * MercuryVertex(m_center, 1);
+
+ //transform the box axises into world axises
+ bb.m_normals[0] = (m * MercuryVector(1,0,0)).Normalize();
+ bb.m_normals[1] = (m * MercuryVector(0,1,0)).Normalize();
+ bb.m_normals[2] = (m * MercuryVector(0,0,1)).Normalize();
+
*this = bb;
}
bool BoundingBox::Clip( const MercuryPlane& p )
{
- MercuryVertex dp = p.GetNormal().DotProduct3(m_normals[0], m_normals[1], m_normals[2]);
+ //do a quick spherical test using the signed distance
+ float d = p.GetNormal().DotProduct( m_center - p.GetCenter() );
+ if (d < -m_extend.Length()) return true;
+ return false;
+
+ ///XXX everything below is broken
+
+ MercuryVector dp; //plain normal in box space
+// dp = p.GetNormal().DotProduct3(m_normals[0],m_normals[2],m_normals[3]);
+ dp[0] = m_normals[0].DotProduct( p.GetNormal() );
+ dp[1] = m_normals[1].DotProduct( p.GetNormal() );
+ dp[2] = m_normals[2].DotProduct( p.GetNormal() );
+ dp.NormalizeSelf();
+// dp = p.GetNormal();
+
+ MercuryVertex P; //max
+ if (dp[0] >= 0) P[0] = m_center.GetX() + m_extend.GetX();
+ if (dp[1] >= 0) P[1] = m_center.GetY() + m_extend.GetY();
+ if (dp[2] >= 0) P[2] = m_center.GetZ() + m_extend.GetZ();
+
+ MercuryVertex N; //min
+ if (dp[0] >= 0) N[0] = m_center.GetX() - m_extend.GetX();
+ if (dp[1] >= 0) N[1] = m_center.GetY() - m_extend.GetY();
+ if (dp[2] >= 0) N[2] = m_center.GetZ() - m_extend.GetZ();
+
+ float x = dp.DotProduct( P );
+ float y = dp.DotProduct( N );
+// printf("p %f n %f\n", x, y);
+ if ( x < 0)
+ return true; //max value outside
+ if ( y < 0) //is negative value outside
+ return false; //intersect
+
+ return false;
+/*
+ db * m_extend;
float x = ABS( m_extend.GetX() * dp[0] );
x += ABS( m_extend.GetY() * dp[1] );
x += ABS( m_extend.GetZ() * dp[2] );
@@ -96,17 +136,22 @@
return false;
return BEHIND_PLANE(d); //if we don't intersect, just see what side we are on
+ */
}
bool BoundingBox::Clip( const Frustum& f )
{
- bool inView = true;
- for (uint8_t i = 0; (i < 6) && inView; ++i)
+ bool clipped = false;
+ for (uint8_t i = 0; (i < 6) && !clipped; ++i)
{
- inView = Clip( f.GetPlane(i) )?false:inView;
+ bool t = Clip( f.GetPlane(i) );
+// printf("p%d %d\n", i, t);
+ clipped = t;
}
+// printf("******\n");
+// return false;
- return !inView;
+ return clipped;
}
//bool BoundingBox::FrustumCull() const
@@ -166,8 +211,10 @@
bool BoundingBox::DoFrustumTest( const MercuryMatrix& m )
{
BoundingBox bb(*this);
+// bb.Render();
bb.Transform( m );
- return false;
+// bb.Render();
+ return bb.Clip( *FRUSTUM );
}
void BoundingBox::DoOcclusionTest( OcclusionResult& result )
@@ -218,7 +265,7 @@
const float* center = GetCenter();
const float* extend = GetExtend();
-// glPushMatrix();
+ glPushMatrix();
// glLoadIdentity();
glPushAttrib( GL_CURRENT_BIT );
glBegin(GL_LINES);
@@ -258,34 +305,45 @@
glEnd();
- //center
glPointSize(4);
glBegin(GL_POINTS);
+ //center
glVertex3f(center[0], center[1], center[2]);
+ //max point
+ glColor3f(1,1,0);
+ glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]+extend[2]);
+ //min point
+// glColor3f(1,0,0);
+ glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]-extend[2]);
glEnd();
+
//normals
MercuryVertex c;
glBegin(GL_LINES);
+
glColor3f(1.0f,0,0);
glVertex3f(center[0], center[1], center[2]);
c = center;
c += m_normals[0];
glVertex3f(c.GetX(), c.GetY(), c.GetZ());
+
glColor3f(0,1.0f,0);
glVertex3f(center[0], center[1], center[2]);
c = center;
c += m_normals[1];
glVertex3f(c.GetX(), c.GetY(), c.GetZ());
+
glColor3f(0,0,1.0f);
glVertex3f(center[0], center[1], center[2]);
c = center;
c += m_normals[2];
glVertex3f(c.GetX(), c.GetY(), c.GetZ());
+
glEnd();
glPopAttrib( );
-// glPopMatrix();
+ glPopMatrix();
}
void BoundingBox::PopulateVertices()
Modified: Mercury2/src/HGMDLModel.cpp
===================================================================
--- Mercury2/src/HGMDLModel.cpp 2009-07-06 16:14:59 UTC (rev 412)
+++ Mercury2/src/HGMDLModel.cpp 2009-07-06 16:18:18 UTC (rev 413)
@@ -58,6 +58,13 @@
}
}
+void HGMDLModel::DoCullingTests(MercuryNode* n, const MercuryMatrix& matrix)
+{
+ if ( GetLoadState() != LOADING )
+ for(uint16_t i = 0; i < m_meshes.size(); ++i)
+ m_meshes[i]->DoCullingTests(n, matrix);
+}
+
void HGMDLModel::PreRender(const MercuryNode* node)
{
if ( GetLoadState() != LOADING )
Modified: Mercury2/src/HGMDLModel.h
===================================================================
--- Mercury2/src/HGMDLModel.h 2009-07-06 16:14:59 UTC (rev 412)
+++ Mercury2/src/HGMDLModel.h 2009-07-06 16:18:18 UTC (rev 413)
@@ -19,6 +19,7 @@
static HGMDLModel* Generate();
+ virtual void DoCullingTests(MercuryNode* n, const MercuryMatrix& matrix);
virtual void PreRender(const MercuryNode* node);
virtual void Render(const MercuryNode* node);
Modified: Mercury2/src/MercuryAsset.cpp
===================================================================
--- Mercury2/src/MercuryAsset.cpp 2009-07-06 16:14:59 UTC (rev 412)
+++ Mercury2/src/MercuryAsset.cpp 2009-07-06 16:18:18 UTC (rev 413)
@@ -37,8 +37,19 @@
SetLoadState( LOADED );
}
+void MercuryAsset::DoCullingTests(MercuryNode* n, const MercuryMatrix& matrix)
+{
+ if ( m_boundingVolume )
+ {
+ n->SetCulled( m_boundingVolume->DoFrustumTest(matrix) );
+ if ( !n->IsCulled() )
+ m_boundingVolume->DoOcclusionTest( n->GetOcclusionResult() );
+ }
+}
+
void MercuryAsset::PreRender(const MercuryNode* node)
{
+ /*
MercuryNode* n = const_cast<MercuryNode*>(node);
if ( m_boundingVolume )
{
@@ -46,6 +57,7 @@
if ( !n->IsCulled() )
m_boundingVolume->DoOcclusionTest( n->GetOcclusionResult() );
}
+ */
}
void MercuryAsset::DrawAxes()
Modified: Mercury2/src/MercuryAsset.h
===================================================================
--- Mercury2/src/MercuryAsset.h 2009-07-06 16:14:59 UTC (rev 412)
+++ Mercury2/src/MercuryAsset.h 2009-07-06 16:18:18 UTC (rev 413)
@@ -51,6 +51,7 @@
inline BoundingVolume* GetBoundingVolume() const { return m_boundingVolume; }
inline const MString& Path() const { return m_path; }
+ virtual void DoCullingTests(MercuryNode* n, const MercuryMatrix& matrix);
void DrawAxes();
protected:
void SetLoadState(LoadState ls); //thread safe
Modified: Mercury2/src/MercuryNode.cpp
===================================================================
--- Mercury2/src/MercuryNode.cpp 2009-07-06 16:14:59 UTC (rev 412)
+++ Mercury2/src/MercuryNode.cpp 2009-07-06 16:18:18 UTC (rev 413)
@@ -224,7 +224,10 @@
{
list< MercuryAsset* >::iterator i;
for (i = m_prerender.begin(); i != m_prerender.end(); ++i )
+ {
+ (*i)->DoCullingTests( this, matrix );
(*i)->PreRender(this);
+ }
}
void MercuryNode::Render(const MercuryMatrix& matrix)
Modified: Mercury2/src/MercuryPlane.cpp
===================================================================
--- Mercury2/src/MercuryPlane.cpp 2009-07-06 16:14:59 UTC (rev 412)
+++ Mercury2/src/MercuryPlane.cpp 2009-07-06 16:18:18 UTC (rev 413)
@@ -2,14 +2,10 @@
#include <stdio.h>
#include <MercuryMath.h>
-#define SIGNED_DIST(x) m_normal.DotProduct(x)
-
-// origional algorithim was -x<0
-#define BEHIND_PLANE(x) x>=0
-
bool MercuryPlane::IsBehindPlane(const MercuryVertex& point) const
{
- return BEHIND_PLANE( SIGNED_DIST( point+m_center ) );
+ //signed distance between the plane and the point
+ return m_normal.DotProduct( point - m_center ) < 0;
}
/****************************************************************************
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-07-06 16:15:00
|
Revision: 412
http://hgengine.svn.sourceforge.net/hgengine/?rev=412&view=rev
Author: axlecrusher
Date: 2009-07-06 16:14:59 +0000 (Mon, 06 Jul 2009)
Log Message:
-----------
remove debuggign print
Modified Paths:
--------------
Mercury2/src/Frustum.cpp
Modified: Mercury2/src/Frustum.cpp
===================================================================
--- Mercury2/src/Frustum.cpp 2009-07-06 16:12:53 UTC (rev 411)
+++ Mercury2/src/Frustum.cpp 2009-07-06 16:14:59 UTC (rev 412)
@@ -88,7 +88,6 @@
aux = (m_nc + X*m_nw) - eye;
aux.NormalizeSelf();
normal = Y.CrossProduct(aux);
- normal.Print();
m_planes[PRIGHT].Setup(m_nc+X*m_nw,normal);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-07-06 16:12:54
|
Revision: 411
http://hgengine.svn.sourceforge.net/hgengine/?rev=411&view=rev
Author: axlecrusher
Date: 2009-07-06 16:12:53 +0000 (Mon, 06 Jul 2009)
Log Message:
-----------
function to read matrix from opengl
Modified Paths:
--------------
Mercury2/src/GLHelpers.cpp
Mercury2/src/GLHelpers.h
Modified: Mercury2/src/GLHelpers.cpp
===================================================================
--- Mercury2/src/GLHelpers.cpp 2009-07-06 02:39:41 UTC (rev 410)
+++ Mercury2/src/GLHelpers.cpp 2009-07-06 16:12:53 UTC (rev 411)
@@ -47,6 +47,14 @@
glLoadMatrixf( l.Ptr() );
}
+MercuryMatrix glGetMatrix(GLenum m)
+{
+ MercuryMatrix mm;
+ glGetFloatv(m, mm.Ptr());
+ mm.Transpose();
+ return mm;
+}
+
/****************************************************************************
* Copyright (C) 2009 by Joshua Allen *
* *
Modified: Mercury2/src/GLHelpers.h
===================================================================
--- Mercury2/src/GLHelpers.h 2009-07-06 02:39:41 UTC (rev 410)
+++ Mercury2/src/GLHelpers.h 2009-07-06 16:12:53 UTC (rev 411)
@@ -4,6 +4,7 @@
MString GlError2String(uint32_t e);
void glLoadMatrix(const MercuryMatrix& m);
+MercuryMatrix glGetMatrix(GLenum m);
/****************************************************************************
* Copyright (C) 2009 by Joshua Allen *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-07-06 02:39:42
|
Revision: 410
http://hgengine.svn.sourceforge.net/hgengine/?rev=410&view=rev
Author: axlecrusher
Date: 2009-07-06 02:39:41 +0000 (Mon, 06 Jul 2009)
Log Message:
-----------
fix broken frustum plane calculations
Modified Paths:
--------------
Mercury2/src/Frustum.cpp
Mercury2/src/Viewport.cpp
Modified: Mercury2/src/Frustum.cpp
===================================================================
--- Mercury2/src/Frustum.cpp 2009-07-05 21:15:50 UTC (rev 409)
+++ Mercury2/src/Frustum.cpp 2009-07-06 02:39:41 UTC (rev 410)
@@ -55,37 +55,40 @@
//Right now this only builds the frustum planes
MercuryVector X,Y,Z;
- Z = (eye - look).Normalize(); //direction behind camera
+ Z = look * -1; //direction opposite of look
X = (up.CrossProduct(Z)).Normalize(); //X axis
Y = Z.CrossProduct( X ); //real up
- m_nc = (eye - Z) * m_zNear;
- m_fc = (eye - Z) * m_zFar;
+ m_nc = eye - (Z * m_zNear);
+ m_fc = eye - (Z * m_zFar);
- m_planes[PNEAR].Setup(m_nc, Z*(-1));
+ //All the normals must face inwards
+ m_planes[PNEAR].Setup(m_nc, Z*-1);
m_planes[PFAR].Setup(m_fc, Z);
+// m_planes[PFAR].GetNormal().Print();
// m_fc.Print();
// Z.Print();
MercuryVector aux,normal;
aux = (m_nc + Y*m_nh) - eye;
aux.NormalizeSelf();
- normal = aux * X;
+ normal = aux.CrossProduct(X);
m_planes[PTOP].Setup(m_nc+Y*m_nh,normal);
-
+
aux = (m_nc - Y*m_nh) - eye;
aux.NormalizeSelf();
- normal = X * aux;
+ normal = X.CrossProduct(aux);
m_planes[PBOTTOM].Setup(m_nc-Y*m_nh,normal);
aux = (m_nc - X*m_nw) - eye;
aux.NormalizeSelf();
- normal = aux * Y;
+ normal = aux.CrossProduct(Y);
m_planes[PLEFT].Setup(m_nc-X*m_nw,normal);
aux = (m_nc + X*m_nw) - eye;
aux.NormalizeSelf();
- normal = Y * aux;
+ normal = Y.CrossProduct(aux);
+ normal.Print();
m_planes[PRIGHT].Setup(m_nc+X*m_nw,normal);
}
Modified: Mercury2/src/Viewport.cpp
===================================================================
--- Mercury2/src/Viewport.cpp 2009-07-05 21:15:50 UTC (rev 409)
+++ Mercury2/src/Viewport.cpp 2009-07-06 02:39:41 UTC (rev 410)
@@ -33,8 +33,9 @@
VIEWMATRIX = matrix;
- MercuryVector z(0,0,1);
- LOOKAT = (matrix * z).Normalize();
+ //the camera sets this (the calculation here is wrong)
+// MercuryVector z(0,0,-1); //look down Z by default
+// LOOKAT = (matrix * z).Normalize();
// matrix.Print();
// EYE.Print("Eye");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-07-05 21:15:50
|
Revision: 409
http://hgengine.svn.sourceforge.net/hgengine/?rev=409&view=rev
Author: axlecrusher
Date: 2009-07-05 21:15:50 +0000 (Sun, 05 Jul 2009)
Log Message:
-----------
commit what I have done before I mess it up
Modified Paths:
--------------
Mercury2/src/BoundingBox.cpp
Mercury2/src/BoundingBox.h
Mercury2/src/HGMDLModel.cpp
Mercury2/src/MercuryAsset.cpp
Mercury2/src/MercuryNode.cpp
Mercury2/src/MercuryNode.h
Modified: Mercury2/src/BoundingBox.cpp
===================================================================
--- Mercury2/src/BoundingBox.cpp 2009-07-05 15:48:11 UTC (rev 408)
+++ Mercury2/src/BoundingBox.cpp 2009-07-05 21:15:50 UTC (rev 409)
@@ -109,13 +109,13 @@
return !inView;
}
-bool BoundingBox::FrustumCull() const
-{
+//bool BoundingBox::FrustumCull() const
+//{
/*feedback in openGL is probably depreciated
and is known to fallback to software
the OcclusionTest provides the same performence
it is probably best to avoid using this function */
-
+/*
static float b[3];
uint32_t samples;
const float* center = GetCenter();
@@ -161,9 +161,18 @@
// return false;
return samples==0;
}
+*/
+bool BoundingBox::DoFrustumTest( const MercuryMatrix& m )
+{
+ BoundingBox bb(*this);
+ bb.Transform( m );
+ return false;
+}
+
void BoundingBox::DoOcclusionTest( OcclusionResult& result )
{
+ return;
const float* center = GetCenter();
const float* extend = GetExtend();
Modified: Mercury2/src/BoundingBox.h
===================================================================
--- Mercury2/src/BoundingBox.h 2009-07-05 15:48:11 UTC (rev 408)
+++ Mercury2/src/BoundingBox.h 2009-07-05 21:15:50 UTC (rev 409)
@@ -42,8 +42,7 @@
virtual bool Clip( const MercuryPlane& p ) = 0;
virtual bool Clip( const Frustum& f ) = 0;
- virtual bool FrustumCull() const = 0; //Do not use
-// virtual bool OcclusionCull() const = 0;
+ virtual bool DoFrustumTest( const MercuryMatrix& m ) = 0;
/** This uses openGL to do an occlusion test in hardware.
The answer is not immediately known, but this can be run on the GPU
@@ -85,8 +84,7 @@
virtual bool Clip( const MercuryPlane& p );
virtual bool Clip( const Frustum& f );
- virtual bool FrustumCull() const; //Do not use
-// virtual bool OcclusionCull() const;
+ virtual bool DoFrustumTest( const MercuryMatrix& m );
virtual void DoOcclusionTest(OcclusionResult& result);
private:
Modified: Mercury2/src/HGMDLModel.cpp
===================================================================
--- Mercury2/src/HGMDLModel.cpp 2009-07-05 15:48:11 UTC (rev 408)
+++ Mercury2/src/HGMDLModel.cpp 2009-07-05 21:15:50 UTC (rev 409)
@@ -71,7 +71,7 @@
{
for(uint16_t i = 0; i < m_meshes.size(); ++i)
{
- if ( !node->GetOcclusionResult().IsOccluded() )
+ if ( !(node->GetOcclusionResult().IsOccluded() || node->IsCulled()) )
m_meshes[i]->Render(node);
}
}
Modified: Mercury2/src/MercuryAsset.cpp
===================================================================
--- Mercury2/src/MercuryAsset.cpp 2009-07-05 15:48:11 UTC (rev 408)
+++ Mercury2/src/MercuryAsset.cpp 2009-07-05 21:15:50 UTC (rev 409)
@@ -41,7 +41,11 @@
{
MercuryNode* n = const_cast<MercuryNode*>(node);
if ( m_boundingVolume )
- m_boundingVolume->DoOcclusionTest( n->GetOcclusionResult() );
+ {
+// n->SetCulled( m_boundingVolume->DoFrustumTest(matrix) );
+ if ( !n->IsCulled() )
+ m_boundingVolume->DoOcclusionTest( n->GetOcclusionResult() );
+ }
}
void MercuryAsset::DrawAxes()
Modified: Mercury2/src/MercuryNode.cpp
===================================================================
--- Mercury2/src/MercuryNode.cpp 2009-07-05 15:48:11 UTC (rev 408)
+++ Mercury2/src/MercuryNode.cpp 2009-07-05 21:15:50 UTC (rev 409)
@@ -14,7 +14,7 @@
REGISTER_NODE_TYPE(MercuryNode);
MercuryNode::MercuryNode()
- :m_parent(NULL), m_prevSibling(NULL), m_nextSibling(NULL), m_hidden(false), m_useAlphaPath(false)
+ :m_parent(NULL), m_prevSibling(NULL), m_nextSibling(NULL), m_hidden(false), m_useAlphaPath(false), m_culled(false)
{
}
@@ -146,7 +146,7 @@
void MercuryNode::RecursiveRender()
{
- if ( IsHidden() || m_occlusionResult.IsOccluded() ) return;
+ if ( IsHidden() || m_occlusionResult.IsOccluded() || IsCulled() ) return;
MercuryMatrix matrix = FindGlobalMatrix();
MercuryMatrix modelView = ManipulateMatrix( matrix );
Modified: Mercury2/src/MercuryNode.h
===================================================================
--- Mercury2/src/MercuryNode.h 2009-07-05 15:48:11 UTC (rev 408)
+++ Mercury2/src/MercuryNode.h 2009-07-05 21:15:50 UTC (rev 409)
@@ -91,8 +91,10 @@
const MercuryMatrix& FindGlobalMatrix() const;
virtual bool IsCulled(const MercuryMatrix& matrix);
- bool IsHidden() { return m_hidden; }
+ inline bool IsHidden() { return m_hidden; }
+ inline void SetCulled(bool t) { m_culled = t; }
+ inline bool IsCulled() const { return m_culled; }
virtual MercuryMatrix ManipulateMatrix(const MercuryMatrix& matrix);
inline OcclusionResult& GetOcclusionResult() { return m_occlusionResult; }
@@ -105,8 +107,10 @@
static bool m_rebuildRenderGraph;
MString m_name;
+
bool m_hidden;
bool m_useAlphaPath;
+ bool m_culled;
private:
bool IsInAssetList(MercuryAsset* asset) const;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-07-05 15:48:17
|
Revision: 408
http://hgengine.svn.sourceforge.net/hgengine/?rev=408&view=rev
Author: axlecrusher
Date: 2009-07-05 15:48:11 +0000 (Sun, 05 Jul 2009)
Log Message:
-----------
Add a much improved occlusion test. This required changing how rendering works.
Specifically, PreRender() is now called on the entire render tree before any Render()
commands are issued. Prerender tells openGL to do a very fast occlusion test before doing
anything else with opengl.
This can be extreamly useful if large occluding geometry is rendered first, followed by many
smaller occluded objects.
Modified Paths:
--------------
Mercury2/src/BoundingBox.cpp
Mercury2/src/BoundingBox.h
Mercury2/src/HGMDLModel.cpp
Mercury2/src/HGMDLModel.h
Mercury2/src/Mercury2.cpp
Mercury2/src/MercuryAsset.cpp
Mercury2/src/MercuryAsset.h
Mercury2/src/MercuryNode.cpp
Mercury2/src/MercuryNode.h
Mercury2/src/MercuryVBO.cpp
Mercury2/src/MercuryVBO.h
Mercury2/src/RenderBuffer.cpp
Mercury2/src/RenderBuffer.h
Modified: Mercury2/src/BoundingBox.cpp
===================================================================
--- Mercury2/src/BoundingBox.cpp 2009-07-05 12:55:17 UTC (rev 407)
+++ Mercury2/src/BoundingBox.cpp 2009-07-05 15:48:11 UTC (rev 408)
@@ -4,19 +4,29 @@
#include <Viewport.h>
#include <Texture.h>
+#include <MercuryVBO.h>
+
#define SIGNED_DIST(x) m_normal.DotProduct(x)
// origional algorithim was -x<0
#define BEHIND_PLANE(x) x>=0
-bool BoundingVolume::IsOccluded()
+OcclusionResult::~OcclusionResult()
{
- uint32_t samples = 1;
- if (m_occlusionQuery != 0)
- glGetQueryObjectuivARB(m_occlusionQuery, GL_QUERY_RESULT_ARB, &samples);
- return samples==0;
+ if ( m_occlusionQuery != 0 )
+ glDeleteQueriesARB( 1, &m_occlusionQuery );
+ m_occlusionQuery = 0;
}
+uint32_t OcclusionResult::GetSamples() const
+{
+ if (m_occlusionQuery == 0) return ~0;
+
+ uint32_t samples;
+ glGetQueryObjectuivARB(m_occlusionQuery, GL_QUERY_RESULT_ARB, &samples);
+ return samples;
+}
+
BoundingBox::BoundingBox(const MercuryVertex& center, const MercuryVertex& extend)
:m_center(center), m_extend(extend)
{
@@ -101,6 +111,11 @@
bool BoundingBox::FrustumCull() const
{
+ /*feedback in openGL is probably depreciated
+ and is known to fallback to software
+ the OcclusionTest provides the same performence
+ it is probably best to avoid using this function */
+
static float b[3];
uint32_t samples;
const float* center = GetCenter();
@@ -147,49 +162,36 @@
return samples==0;
}
-void BoundingBox::DoOcclusionTest()
+void BoundingBox::DoOcclusionTest( OcclusionResult& result )
{
const float* center = GetCenter();
const float* extend = GetExtend();
-
+
glPushAttrib( GL_CURRENT_BIT | GL_ENABLE_BIT | GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
glDisable(GL_CULL_FACE);
glPushMatrix();
glTranslatef(center[0], center[1], center[2]);
glScalef(extend[0],extend[1],extend[2]);
-/*
- uint8_t tCount = Texture::NumberActiveTextures();
- for (uint8_t i = 0; i < tCount; ++i)
+
+ if (m_vboID == 0) InitVBO();
+
+ if ( MercuryVBO::m_lastVBOrendered != &m_vboID )
{
- glActiveTexture( GL_TEXTURE0+i );
- glClientActiveTextureARB( GL_TEXTURE0+i );
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisable( GL_TEXTURE_2D );
+ MercuryVBO::m_lastVBOrendered = &m_vboID;
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, m_vboID); // once
+ glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0); // once
+ glVertexPointer(3, GL_FLOAT, 0, 0); // once
}
-*/
- InitVBO();
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, m_vboID);
- glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
- glVertexPointer(3, GL_FLOAT, 0, 0);
-
- if (m_occlusionQuery == 0) glGenQueriesARB(1, &m_occlusionQuery);
- glBeginQueryARB(GL_SAMPLES_PASSED_ARB, m_occlusionQuery);
+ if (result.GetQueryID() == 0) glGenQueriesARB(1, &result.GetQueryID());
+ glBeginQueryARB(GL_SAMPLES_PASSED_ARB, result.GetQueryID());
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
glDepthMask(GL_FALSE);
glDrawArrays(GL_QUADS, 0, 24);
-/*
- for (uint8_t i = 0; i < tCount; ++i)
- {
- glActiveTexture( GL_TEXTURE0+i );
- glClientActiveTextureARB(GL_TEXTURE0+i);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glEnable( GL_TEXTURE_2D );
- }
-*/
+
glEndQueryARB(GL_SAMPLES_PASSED_ARB);
// glGetQueryObjectuivARB(q, GL_QUERY_RESULT_ARB, &samples);
@@ -323,8 +325,6 @@
void BoundingBox::InitVBO()
{
- if (m_vboID != 0) return;
-
glGenBuffersARB(1, &m_vboID);
//vertex VBO
Modified: Mercury2/src/BoundingBox.h
===================================================================
--- Mercury2/src/BoundingBox.h 2009-07-05 12:55:17 UTC (rev 407)
+++ Mercury2/src/BoundingBox.h 2009-07-05 15:48:11 UTC (rev 408)
@@ -10,6 +10,21 @@
#include <AlignedBuffer.h>
+class OcclusionResult
+{
+ public:
+ OcclusionResult()
+ :m_occlusionQuery(0)
+ {}
+ ~OcclusionResult();
+
+ uint32_t GetSamples() const;
+ inline uint32_t IsOccluded() const { return GetSamples() == 0; }
+ inline uint32_t& GetQueryID() { return m_occlusionQuery; }
+ private:
+ uint32_t m_occlusionQuery;
+};
+
class BoundingVolume
{
public:
@@ -27,10 +42,15 @@
virtual bool Clip( const MercuryPlane& p ) = 0;
virtual bool Clip( const Frustum& f ) = 0;
- virtual bool FrustumCull() const = 0;
+ virtual bool FrustumCull() const = 0; //Do not use
// virtual bool OcclusionCull() const = 0;
- bool IsOccluded();
- virtual void DoOcclusionTest() = 0;
+
+ /** This uses openGL to do an occlusion test in hardware.
+ The answer is not immediately known, but this can be run on the GPU
+ while the CPU does something else. Get the anser later by calling
+ IsOccluded() on the result.
+ **/
+ virtual void DoOcclusionTest(OcclusionResult& result) = 0;
protected:
uint32_t m_occlusionQuery;
@@ -65,9 +85,9 @@
virtual bool Clip( const MercuryPlane& p );
virtual bool Clip( const Frustum& f );
- virtual bool FrustumCull() const;
+ virtual bool FrustumCull() const; //Do not use
// virtual bool OcclusionCull() const;
- virtual void DoOcclusionTest();
+ virtual void DoOcclusionTest(OcclusionResult& result);
private:
void ComputeNormals();
Modified: Mercury2/src/HGMDLModel.cpp
===================================================================
--- Mercury2/src/HGMDLModel.cpp 2009-07-05 12:55:17 UTC (rev 407)
+++ Mercury2/src/HGMDLModel.cpp 2009-07-05 15:48:11 UTC (rev 408)
@@ -1,5 +1,5 @@
#include <HGMDLModel.h>
-
+#include <MercuryNode.h>
REGISTER_ASSET_TYPE(HGMDLModel);
const uint16_t EXPCTMJRV = 2;
@@ -58,17 +58,21 @@
}
}
+void HGMDLModel::PreRender(const MercuryNode* node)
+{
+ if ( GetLoadState() != LOADING )
+ for(uint16_t i = 0; i < m_meshes.size(); ++i)
+ m_meshes[i]->PreRender(node);
+}
+
void HGMDLModel::Render(const MercuryNode* node)
{
- bool cull;
if ( GetLoadState() != LOADING )
{
for(uint16_t i = 0; i < m_meshes.size(); ++i)
{
- cull = false;
- const BoundingVolume* bv = m_meshes[i]->GetBoundingVolume();
- if (bv) cull = bv->FrustumCull();
- if ( !cull ) m_meshes[i]->Render(node);
+ if ( !node->GetOcclusionResult().IsOccluded() )
+ m_meshes[i]->Render(node);
}
}
}
Modified: Mercury2/src/HGMDLModel.h
===================================================================
--- Mercury2/src/HGMDLModel.h 2009-07-05 12:55:17 UTC (rev 407)
+++ Mercury2/src/HGMDLModel.h 2009-07-05 15:48:11 UTC (rev 408)
@@ -18,6 +18,8 @@
static void LoadModel(MercuryFile* hgmdl, HGMDLModel* model);
static HGMDLModel* Generate();
+
+ virtual void PreRender(const MercuryNode* node);
virtual void Render(const MercuryNode* node);
private:
Modified: Mercury2/src/Mercury2.cpp
===================================================================
--- Mercury2/src/Mercury2.cpp 2009-07-05 12:55:17 UTC (rev 407)
+++ Mercury2/src/Mercury2.cpp 2009-07-05 15:48:11 UTC (rev 408)
@@ -87,6 +87,7 @@
// renderGraph.Render();
// RenderableNode::RecursiveRender(root);
// printf("\n");
+ root->RecursivePreRender();
root->RecursiveRender();
renderGraph.RenderAlpha();
w->SwapBuffers();
Modified: Mercury2/src/MercuryAsset.cpp
===================================================================
--- Mercury2/src/MercuryAsset.cpp 2009-07-05 12:55:17 UTC (rev 407)
+++ Mercury2/src/MercuryAsset.cpp 2009-07-05 15:48:11 UTC (rev 408)
@@ -16,6 +16,7 @@
void MercuryAsset::Init(MercuryNode* node)
{
// RenderableNode* rn;
+ if ( node ) node->AddPreRender(this);
if ( node ) node->AddRender(this);
}
@@ -36,6 +37,13 @@
SetLoadState( LOADED );
}
+void MercuryAsset::PreRender(const MercuryNode* node)
+{
+ MercuryNode* n = const_cast<MercuryNode*>(node);
+ if ( m_boundingVolume )
+ m_boundingVolume->DoOcclusionTest( n->GetOcclusionResult() );
+}
+
void MercuryAsset::DrawAxes()
{
glBegin(GL_LINES);
Modified: Mercury2/src/MercuryAsset.h
===================================================================
--- Mercury2/src/MercuryAsset.h 2009-07-05 12:55:17 UTC (rev 407)
+++ Mercury2/src/MercuryAsset.h 2009-07-05 15:48:11 UTC (rev 408)
@@ -32,8 +32,13 @@
virtual void Init(MercuryNode* node);
- virtual void PreRender(const MercuryNode* node) {};
+ /** PreRender should be called before any real openGL render commands.
+ It is used to handles things like frustum culling, and occlusion culling.
+ Currently only occlusion culling test is run here.**/
+ virtual void PreRender(const MercuryNode* node);
+
virtual void Render(const MercuryNode* node) = 0;
+
virtual void PostRender(const MercuryNode* node) {};
///Loads an asset from an XMLAsset representing itself
@@ -43,7 +48,7 @@
inline void IsInstanced(bool b) { m_isInstanced = b; }
- inline const BoundingVolume* GetBoundingVolume() const { return m_boundingVolume; }
+ inline BoundingVolume* GetBoundingVolume() const { return m_boundingVolume; }
inline const MString& Path() const { return m_path; }
void DrawAxes();
Modified: Mercury2/src/MercuryNode.cpp
===================================================================
--- Mercury2/src/MercuryNode.cpp 2009-07-05 12:55:17 UTC (rev 407)
+++ Mercury2/src/MercuryNode.cpp 2009-07-05 15:48:11 UTC (rev 408)
@@ -129,25 +129,36 @@
child->RecursiveUpdate(dTime);
}
-void MercuryNode::RecursiveRender()
+void MercuryNode::RecursivePreRender()
{
- MercuryMatrix modelView;
- ShaderAttribute sa;
+ if ( IsHidden() ) return;
MercuryMatrix matrix = FindGlobalMatrix();
+ MercuryMatrix modelView = ManipulateMatrix( matrix );
+ glLoadMatrix( modelView );
+
PreRender( matrix ); //calls on children assets
-
- modelView = ManipulateMatrix( matrix );
+
+ for (MercuryNode* child = FirstChild(); child != NULL; child = NextChild(child))
+ child->RecursivePreRender();
+}
+
+void MercuryNode::RecursiveRender()
+{
+ if ( IsHidden() || m_occlusionResult.IsOccluded() ) return;
+
+ MercuryMatrix matrix = FindGlobalMatrix();
+ MercuryMatrix modelView = ManipulateMatrix( matrix );
// if ( IsHidden() || IsCulled(modelView) ) return;
- if ( IsHidden() ) return;
glLoadMatrix( modelView );
+ ShaderAttribute sa;
sa.type = ShaderAttribute::TYPE_MATRIX;
sa.value.matrix = matrix.Ptr();
Shader::SetAttribute("HG_ModelMatrix", sa);
-
+
Render( modelView ); //calls on children assets
//call render on other render graph entries under me
@@ -218,15 +229,9 @@
void MercuryNode::Render(const MercuryMatrix& matrix)
{
- bool cull;
list< MercuryAsset* >::iterator i;
for (i = m_render.begin(); i != m_render.end(); ++i )
- {
- cull = false;
- const BoundingVolume* bv = (*i)->GetBoundingVolume();
- if (bv) cull = bv->FrustumCull();
- if ( !cull ) (*i)->Render(this);
- }
+ (*i)->Render(this);
}
void MercuryNode::PostRender(const MercuryMatrix& matrix)
Modified: Mercury2/src/MercuryNode.h
===================================================================
--- Mercury2/src/MercuryNode.h 2009-07-05 12:55:17 UTC (rev 407)
+++ Mercury2/src/MercuryNode.h 2009-07-05 15:48:11 UTC (rev 408)
@@ -9,6 +9,7 @@
#include <MessageHandler.h>
#include <MercuryAsset.h>
+#include <BoundingBox.h>
/** This is the basic node of the scene graph. It is not intended to be instanced.
Each node exists as a single entity in the scene graph.
@@ -52,6 +53,7 @@
void ThreadedUpdate(float dTime);
+ void RecursivePreRender();
void RecursiveRender();
///Run on parent when a child is added
@@ -92,7 +94,9 @@
bool IsHidden() { return m_hidden; }
virtual MercuryMatrix ManipulateMatrix(const MercuryMatrix& matrix);
-
+
+ inline OcclusionResult& GetOcclusionResult() { return m_occlusionResult; }
+ inline const OcclusionResult& GetOcclusionResult() const { return m_occlusionResult; }
protected:
std::list< MercuryNode* > m_children; //These nodes are unique, not instanced
MercuryNode* m_parent;
@@ -106,6 +110,8 @@
private:
bool IsInAssetList(MercuryAsset* asset) const;
+ OcclusionResult m_occlusionResult;
+
//The asset is actually stored here
std::list< MAutoPtr< MercuryAsset > > m_assets;
Modified: Mercury2/src/MercuryVBO.cpp
===================================================================
--- Mercury2/src/MercuryVBO.cpp 2009-07-05 12:55:17 UTC (rev 407)
+++ Mercury2/src/MercuryVBO.cpp 2009-07-05 15:48:11 UTC (rev 408)
@@ -27,19 +27,13 @@
uint8_t numTextures = Texture::NumberActiveTextures();
uint16_t stride = sizeof(float)*8;
- if ( m_initiated )
- {
- if ( this != m_lastVBOrendered)
- {
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, m_bufferIDs[0]);
- glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, m_bufferIDs[1]);
- }
- }
- else
- InitVBO();
+ if ( !m_initiated ) InitVBO();
- if ( this != m_lastVBOrendered)
+ if ( this != m_lastVBOrendered )
{
+ m_lastVBOrendered = this;
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, m_bufferIDs[0]);
+ glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, m_bufferIDs[1]);
glVertexPointer(3, GL_FLOAT, stride, BUFFER_OFFSET(sizeof(float)*5));
++m_vboBinds;
}
@@ -57,9 +51,7 @@
glDrawRangeElements(GL_TRIANGLES, 0, m_indexData.Length()-1, m_indexData.Length(), GL_UNSIGNED_SHORT, NULL);
m_vboBatches++;
-
- m_lastVBOrendered = this;
-
+
if (m_boundingVolume && SHOWBOUNDINGVOLUME) m_boundingVolume->Render();
if ( SHOWAXISES ) DrawAxes();
}
Modified: Mercury2/src/MercuryVBO.h
===================================================================
--- Mercury2/src/MercuryVBO.h 2009-07-05 12:55:17 UTC (rev 407)
+++ Mercury2/src/MercuryVBO.h 2009-07-05 15:48:11 UTC (rev 408)
@@ -24,12 +24,14 @@
float * GetVertexHandle() { return &m_vertexData[0]; }
short unsigned int * GetIndexHandle() { return &m_indexData[0]; }
+
+ static void* m_lastVBOrendered;
+
private:
virtual void InitVBO();
unsigned int m_bufferIDs[2];
bool m_initiated;
- static void* m_lastVBOrendered;
protected:
AlignedBuffer<float> m_vertexData;
Modified: Mercury2/src/RenderBuffer.cpp
===================================================================
--- Mercury2/src/RenderBuffer.cpp 2009-07-05 12:55:17 UTC (rev 407)
+++ Mercury2/src/RenderBuffer.cpp 2009-07-05 15:48:11 UTC (rev 408)
@@ -24,18 +24,15 @@
RenderableNode* rn = RenderableNode::Cast( node );
if ( rn )
{
- rn->AddPreRender( this );
+// rn->AddPreRender( this );
rn->AddPostRender( this );
}
}
-void RenderBuffer::PreRender(const MercuryNode* node)
-{
- if ( !m_initiated ) InitRenderBuffer();
-}
-
void RenderBuffer::Render(const MercuryNode* node)
{
+ if ( !m_initiated ) InitRenderBuffer();
+
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_bufferID);
if ( NeedResize() ) AllocateSpace();
Modified: Mercury2/src/RenderBuffer.h
===================================================================
--- Mercury2/src/RenderBuffer.h 2009-07-05 12:55:17 UTC (rev 407)
+++ Mercury2/src/RenderBuffer.h 2009-07-05 15:48:11 UTC (rev 408)
@@ -20,7 +20,6 @@
virtual void Init(MercuryNode* node);
- virtual void PreRender(const MercuryNode* node);
virtual void Render(const MercuryNode* node);
virtual void PostRender(const MercuryNode* node);
virtual void LoadFromXML(const XMLNode& node);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-07-05 13:09:49
|
Revision: 407
http://hgengine.svn.sourceforge.net/hgengine/?rev=407&view=rev
Author: axlecrusher
Date: 2009-07-05 12:55:17 +0000 (Sun, 05 Jul 2009)
Log Message:
-----------
updates
Modified Paths:
--------------
Mercury2/src/BoundingBox.cpp
Mercury2/src/BoundingBox.h
Modified: Mercury2/src/BoundingBox.cpp
===================================================================
--- Mercury2/src/BoundingBox.cpp 2009-07-04 16:01:19 UTC (rev 406)
+++ Mercury2/src/BoundingBox.cpp 2009-07-05 12:55:17 UTC (rev 407)
@@ -2,21 +2,32 @@
#include <BoundingBox.h>
#include <string.h>
#include <Viewport.h>
+#include <Texture.h>
#define SIGNED_DIST(x) m_normal.DotProduct(x)
// origional algorithim was -x<0
#define BEHIND_PLANE(x) x>=0
+bool BoundingVolume::IsOccluded()
+{
+ uint32_t samples = 1;
+ if (m_occlusionQuery != 0)
+ glGetQueryObjectuivARB(m_occlusionQuery, GL_QUERY_RESULT_ARB, &samples);
+ return samples==0;
+}
+
BoundingBox::BoundingBox(const MercuryVertex& center, const MercuryVertex& extend)
:m_center(center), m_extend(extend)
{
+ PopulateVertices();
ComputeNormals();
-};
+}
BoundingBox::BoundingBox(const BoundingBox& bb)
:m_center(bb.m_center), m_extend(bb.m_extend)
{
+ PopulateVertices();
for (uint8_t i = 0; i < 3; ++i)
m_normals[i] = bb.m_normals[i];
}
@@ -94,113 +105,96 @@
uint32_t samples;
const float* center = GetCenter();
const float* extend = GetExtend();
-
+
glPushAttrib( GL_CURRENT_BIT | GL_ENABLE_BIT );
glDisable(GL_CULL_FACE);
+
+ glPushMatrix();
+ glTranslatef(center[0], center[1], center[2]);
+ glScalef(extend[0],extend[1],extend[2]);
+
+ uint8_t tCount = Texture::NumberActiveTextures();
+ for (uint8_t i = 0; i < tCount; ++i)
+ {
+ glActiveTexture( GL_TEXTURE0+i );
+ glClientActiveTextureARB( GL_TEXTURE0+i );
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ glDisable( GL_TEXTURE_2D );
+ }
glFeedbackBuffer(3, GL_3D, b);
glRenderMode( GL_FEEDBACK );
-
- glBegin(GL_QUADS);
-
- //front
- glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]+extend[2]);
- glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]+extend[2]);
- glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]+extend[2]);
- glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]+extend[2]);
-
- //back
- glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]-extend[2]);
- glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]-extend[2]);
- glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]-extend[2]);
- glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]-extend[2]);
-
- //top
- glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]+extend[2]);
- glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]-extend[2]);
- glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]-extend[2]);
- glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]+extend[2]);
-
- //bottom
- glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]+extend[2]);
- glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]-extend[2]);
- glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]-extend[2]);
- glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]+extend[2]);
- //left
- glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]-extend[2]);
- glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]-extend[2]);
- glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]+extend[2]);
- glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]+extend[2]);
+ InitVBO();
- //right
- glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]-extend[2]);
- glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]-extend[2]);
- glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]+extend[2]);
- glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]+extend[2]);
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, m_vboID);
+ glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
+ glVertexPointer(3, GL_FLOAT, 0, 0);
+ glDrawArrays(GL_QUADS, 0, 24);
+
+ for (uint8_t i = 0; i < tCount; ++i)
+ {
+ glActiveTexture( GL_TEXTURE0+i );
+ glClientActiveTextureARB(GL_TEXTURE0+i);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ glEnable( GL_TEXTURE_2D );
+ }
- glEnd();
samples = glRenderMode( GL_RENDER );
+ glPopMatrix();
glPopAttrib( );
+
+// return false;
return samples==0;
}
-bool BoundingBox::OcclusionCull() const
+void BoundingBox::DoOcclusionTest()
{
- static uint32_t q;
- uint32_t samples;
const float* center = GetCenter();
const float* extend = GetExtend();
-
- glPushAttrib( GL_CURRENT_BIT | GL_ENABLE_BIT );
+
+ glPushAttrib( GL_CURRENT_BIT | GL_ENABLE_BIT | GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
glDisable(GL_CULL_FACE);
- glGenQueriesARB(1, &q);
- glBeginQueryARB(GL_SAMPLES_PASSED_ARB, q);
- glBegin(GL_QUADS);
+ glPushMatrix();
+ glTranslatef(center[0], center[1], center[2]);
+ glScalef(extend[0],extend[1],extend[2]);
+/*
+ uint8_t tCount = Texture::NumberActiveTextures();
+ for (uint8_t i = 0; i < tCount; ++i)
+ {
+ glActiveTexture( GL_TEXTURE0+i );
+ glClientActiveTextureARB( GL_TEXTURE0+i );
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ glDisable( GL_TEXTURE_2D );
+ }
+*/
+ InitVBO();
+
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, m_vboID);
+ glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
+ glVertexPointer(3, GL_FLOAT, 0, 0);
+
+ if (m_occlusionQuery == 0) glGenQueriesARB(1, &m_occlusionQuery);
+ glBeginQueryARB(GL_SAMPLES_PASSED_ARB, m_occlusionQuery);
- //front
- glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]+extend[2]);
- glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]+extend[2]);
- glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]+extend[2]);
- glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]+extend[2]);
+ glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
+ glDepthMask(GL_FALSE);
- //back
- glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]-extend[2]);
- glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]-extend[2]);
- glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]-extend[2]);
- glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]-extend[2]);
-
- //top
- glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]+extend[2]);
- glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]-extend[2]);
- glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]-extend[2]);
- glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]+extend[2]);
-
- //bottom
- glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]+extend[2]);
- glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]-extend[2]);
- glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]-extend[2]);
- glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]+extend[2]);
-
- //left
- glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]-extend[2]);
- glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]-extend[2]);
- glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]+extend[2]);
- glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]+extend[2]);
-
- //right
- glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]-extend[2]);
- glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]-extend[2]);
- glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]+extend[2]);
- glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]+extend[2]);
-
- glEnd();
+ glDrawArrays(GL_QUADS, 0, 24);
+/*
+ for (uint8_t i = 0; i < tCount; ++i)
+ {
+ glActiveTexture( GL_TEXTURE0+i );
+ glClientActiveTextureARB(GL_TEXTURE0+i);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ glEnable( GL_TEXTURE_2D );
+ }
+*/
glEndQueryARB(GL_SAMPLES_PASSED_ARB);
- glGetQueryObjectuivARB(q, GL_QUERY_RESULT_ARB, &samples);
+// glGetQueryObjectuivARB(q, GL_QUERY_RESULT_ARB, &samples);
glPopAttrib( );
-
- return samples==0;
+ glPopMatrix();
}
void BoundingBox::Render()
@@ -283,6 +277,64 @@
// glPopMatrix();
}
+void BoundingBox::PopulateVertices()
+{
+ if (m_vertexData.Length() == 72) return;
+ m_vertexData.Allocate( 72 );
+
+ uint32_t i = 0;
+
+ //back
+ m_vertexData[i++] = -1.0f; m_vertexData[i++] = 1.0f; m_vertexData[i++] = -1.0f;
+ m_vertexData[i++] = -1.0f; m_vertexData[i++] = -1.0f; m_vertexData[i++] = -1.0f;
+ m_vertexData[i++] = 1.0f; m_vertexData[i++] = -1.0f; m_vertexData[i++] = -1.0f;
+ m_vertexData[i++] = 1.0f; m_vertexData[i++] = 1.0f; m_vertexData[i++] = -1.0f;
+
+ //front
+ m_vertexData[i++] = -1.0f; m_vertexData[i++] = 1.0f; m_vertexData[i++] = 1.0f;
+ m_vertexData[i++] = -1.0f; m_vertexData[i++] = -1.0f; m_vertexData[i++] = 1.0f;
+ m_vertexData[i++] = 1.0f; m_vertexData[i++] = -1.0f; m_vertexData[i++] = 1.0f;
+ m_vertexData[i++] = 1.0f; m_vertexData[i++] = 1.0f; m_vertexData[i++] = 1.0f;
+
+ //left
+ m_vertexData[i++] = -1.0f; m_vertexData[i++] = 1.0f; m_vertexData[i++] = -1.0f;
+ m_vertexData[i++] = -1.0f; m_vertexData[i++] = -1.0f; m_vertexData[i++] = -1.0f;
+ m_vertexData[i++] = -1.0f; m_vertexData[i++] = -1.0f; m_vertexData[i++] = 1.0f;
+ m_vertexData[i++] = -1.0f; m_vertexData[i++] = 1.0f; m_vertexData[i++] = 1.0f;
+
+ //right
+ m_vertexData[i++] = 1.0f; m_vertexData[i++] = 1.0f; m_vertexData[i++] = -1.0f;
+ m_vertexData[i++] = 1.0f; m_vertexData[i++] = -1.0f; m_vertexData[i++] = -1.0f;
+ m_vertexData[i++] = 1.0f; m_vertexData[i++] = -1.0f; m_vertexData[i++] = 1.0f;
+ m_vertexData[i++] = 1.0f; m_vertexData[i++] = 1.0f; m_vertexData[i++] = 1.0f;
+
+ //top
+ m_vertexData[i++] = -1.0f; m_vertexData[i++] = 1.0f; m_vertexData[i++] = -1.0f;
+ m_vertexData[i++] = -1.0f; m_vertexData[i++] = 1.0f; m_vertexData[i++] = 1.0f;
+ m_vertexData[i++] = 1.0f; m_vertexData[i++] = 1.0f; m_vertexData[i++] = 1.0f;
+ m_vertexData[i++] = 1.0f; m_vertexData[i++] = 1.0f; m_vertexData[i++] = -1.0f;
+
+ //bottom
+ m_vertexData[i++] = -1.0f; m_vertexData[i++] = -1.0f; m_vertexData[i++] = -1.0f;
+ m_vertexData[i++] = -1.0f; m_vertexData[i++] = -1.0f; m_vertexData[i++] = 1.0f;
+ m_vertexData[i++] = 1.0f; m_vertexData[i++] = -1.0f; m_vertexData[i++] = 1.0f;
+ m_vertexData[i++] = 1.0f; m_vertexData[i++] = -1.0f; m_vertexData[i++] = -1.0f;
+}
+
+void BoundingBox::InitVBO()
+{
+ if (m_vboID != 0) return;
+
+ glGenBuffersARB(1, &m_vboID);
+
+ //vertex VBO
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, m_vboID);
+ glBufferDataARB(GL_ARRAY_BUFFER_ARB, m_vertexData.LengthInBytes(), m_vertexData.Buffer(), GL_STATIC_DRAW_ARB);
+}
+
+AlignedBuffer<float> BoundingBox::m_vertexData;
+uint32_t BoundingBox::m_vboID = 0;
+
/****************************************************************************
* Copyright (C) 2008 by Joshua Allen *
* *
Modified: Mercury2/src/BoundingBox.h
===================================================================
--- Mercury2/src/BoundingBox.h 2009-07-04 16:01:19 UTC (rev 406)
+++ Mercury2/src/BoundingBox.h 2009-07-05 12:55:17 UTC (rev 407)
@@ -8,9 +8,15 @@
#include <Mint.h>
#include <MercuryPlane.h>
+#include <AlignedBuffer.h>
+
class BoundingVolume
{
public:
+ BoundingVolume()
+ :m_occlusionQuery(0)
+ {}
+
virtual ~BoundingVolume() {};
virtual void LoadFromBinary(char* data) = 0;
@@ -22,14 +28,25 @@
virtual bool Clip( const Frustum& f ) = 0;
virtual bool FrustumCull() const = 0;
- virtual bool OcclusionCull() const = 0;
+// virtual bool OcclusionCull() const = 0;
+ bool IsOccluded();
+ virtual void DoOcclusionTest() = 0;
+
+ protected:
+ uint32_t m_occlusionQuery;
};
class BoundingBox : public BoundingVolume
{
public:
- BoundingBox() {};
+ BoundingBox()
+ :BoundingVolume()
+ {
+ PopulateVertices();
+ }
+
BoundingBox(const MercuryVertex& center, const MercuryVertex& extend);
+
BoundingBox(const BoundingBox& bb);
virtual ~BoundingBox() {};
@@ -49,15 +66,21 @@
virtual bool Clip( const Frustum& f );
virtual bool FrustumCull() const;
- virtual bool OcclusionCull() const;
+// virtual bool OcclusionCull() const;
+ virtual void DoOcclusionTest();
private:
void ComputeNormals();
-
+ static void PopulateVertices();
+ static void InitVBO();
+
MercuryVertex m_center;
MercuryVertex m_extend;
MercuryVector m_normals[3];
+
+ static AlignedBuffer<float> m_vertexData;
+ static uint32_t m_vboID;
};
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-07-04 16:01:20
|
Revision: 406
http://hgengine.svn.sourceforge.net/hgengine/?rev=406&view=rev
Author: axlecrusher
Date: 2009-07-04 16:01:19 +0000 (Sat, 04 Jul 2009)
Log Message:
-----------
new culling
Modified Paths:
--------------
Mercury2/src/BoundingBox.cpp
Mercury2/src/BoundingBox.h
Mercury2/src/Mercury2.cpp
Mercury2/src/MercuryNode.cpp
Mercury2/src/MercuryVBO.cpp
Modified: Mercury2/src/BoundingBox.cpp
===================================================================
--- Mercury2/src/BoundingBox.cpp 2009-07-04 15:46:32 UTC (rev 405)
+++ Mercury2/src/BoundingBox.cpp 2009-07-04 16:01:19 UTC (rev 406)
@@ -35,27 +35,31 @@
void BoundingBox::ComputeNormals()
{
- MercuryVertex t(m_center);
+ //normals are probably just the cardinal axises
+/* MercuryVertex t(m_center, 0);
t.SetX( t.GetX() + m_extend.GetX() );
- m_normals[0] = (m_center - t).Normalize();
+ m_normals[0] = t;//.Normalize();
t = m_center;
t.SetY( t.GetY() + m_extend.GetY() );
- m_normals[1] = (m_center - t).Normalize();
+ m_normals[1] = t;//.Normalize();
t = m_center;
t.SetZ( t.GetZ() + m_extend.GetZ() );
- m_normals[2] = (m_center - t).Normalize();
+ m_normals[2] = t;//.Normalize();
+ */
}
void BoundingBox::Transform( const MercuryMatrix& m )
{
BoundingBox bb;
- bb.m_extend = m_center;
- bb.m_center = m * m_center;
- bb.m_normals[0] = (m * m_normals[0]).Normalize();
- bb.m_normals[1] = (m * m_normals[1]).Normalize();
- bb.m_normals[2] = (m * m_normals[2]).Normalize();
+ bb.m_extend = m_extend;
+ MercuryMatrix mm = m * FRUSTUM->GetMatrix();
+ bb.m_center = mm * MercuryVertex(m_center, 1);
+ bb.m_normals[0] = (mm * MercuryVector(1.0f,0,0,0)).Normalize();
+ bb.m_normals[1] = (mm * MercuryVector(0,1.0f,0,0)).Normalize();
+ bb.m_normals[2] = (mm * MercuryVector(0,0,1.0f,0)).Normalize();
+// bb.Render();
*this = bb;
}
@@ -84,7 +88,121 @@
return !inView;
}
+bool BoundingBox::FrustumCull() const
+{
+ static float b[3];
+ uint32_t samples;
+ const float* center = GetCenter();
+ const float* extend = GetExtend();
+
+ glPushAttrib( GL_CURRENT_BIT | GL_ENABLE_BIT );
+ glDisable(GL_CULL_FACE);
+ glFeedbackBuffer(3, GL_3D, b);
+ glRenderMode( GL_FEEDBACK );
+
+ glBegin(GL_QUADS);
+ //front
+ glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]+extend[2]);
+ glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]+extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]+extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]+extend[2]);
+
+ //back
+ glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]-extend[2]);
+
+ //top
+ glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]+extend[2]);
+ glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]+extend[2]);
+
+ //bottom
+ glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]+extend[2]);
+ glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]+extend[2]);
+
+ //left
+ glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]+extend[2]);
+ glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]+extend[2]);
+
+ //right
+ glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]+extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]+extend[2]);
+
+ glEnd();
+ samples = glRenderMode( GL_RENDER );
+ glPopAttrib( );
+ return samples==0;
+}
+
+bool BoundingBox::OcclusionCull() const
+{
+ static uint32_t q;
+ uint32_t samples;
+ const float* center = GetCenter();
+ const float* extend = GetExtend();
+
+ glPushAttrib( GL_CURRENT_BIT | GL_ENABLE_BIT );
+ glDisable(GL_CULL_FACE);
+ glGenQueriesARB(1, &q);
+ glBeginQueryARB(GL_SAMPLES_PASSED_ARB, q);
+
+ glBegin(GL_QUADS);
+
+ //front
+ glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]+extend[2]);
+ glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]+extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]+extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]+extend[2]);
+
+ //back
+ glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]-extend[2]);
+
+ //top
+ glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]+extend[2]);
+ glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]+extend[2]);
+
+ //bottom
+ glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]+extend[2]);
+ glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]+extend[2]);
+
+ //left
+ glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]-extend[0], center[1]-extend[1], center[2]+extend[2]);
+ glVertex3f(center[0]-extend[0], center[1]+extend[1], center[2]+extend[2]);
+
+ //right
+ glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]-extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]-extend[1], center[2]+extend[2]);
+ glVertex3f(center[0]+extend[0], center[1]+extend[1], center[2]+extend[2]);
+
+ glEnd();
+ glEndQueryARB(GL_SAMPLES_PASSED_ARB);
+ glGetQueryObjectuivARB(q, GL_QUERY_RESULT_ARB, &samples);
+
+ glPopAttrib( );
+
+ return samples==0;
+}
+
void BoundingBox::Render()
{
// BoundingBox gbb = *this;
@@ -95,6 +213,8 @@
const float* center = GetCenter();
const float* extend = GetExtend();
+// glPushMatrix();
+// glLoadIdentity();
glPushAttrib( GL_CURRENT_BIT );
glBegin(GL_LINES);
glColor3f(0,1.0f,0);
@@ -133,12 +253,34 @@
glEnd();
+ //center
glPointSize(4);
glBegin(GL_POINTS);
glVertex3f(center[0], center[1], center[2]);
glEnd();
+ //normals
+ MercuryVertex c;
+ glBegin(GL_LINES);
+ glColor3f(1.0f,0,0);
+ glVertex3f(center[0], center[1], center[2]);
+ c = center;
+ c += m_normals[0];
+ glVertex3f(c.GetX(), c.GetY(), c.GetZ());
+ glColor3f(0,1.0f,0);
+ glVertex3f(center[0], center[1], center[2]);
+ c = center;
+ c += m_normals[1];
+ glVertex3f(c.GetX(), c.GetY(), c.GetZ());
+ glColor3f(0,0,1.0f);
+ glVertex3f(center[0], center[1], center[2]);
+ c = center;
+ c += m_normals[2];
+ glVertex3f(c.GetX(), c.GetY(), c.GetZ());
+ glEnd();
+
glPopAttrib( );
+// glPopMatrix();
}
/****************************************************************************
Modified: Mercury2/src/BoundingBox.h
===================================================================
--- Mercury2/src/BoundingBox.h 2009-07-04 15:46:32 UTC (rev 405)
+++ Mercury2/src/BoundingBox.h 2009-07-04 16:01:19 UTC (rev 406)
@@ -20,6 +20,9 @@
virtual bool Clip( const MercuryPlane& p ) = 0;
virtual bool Clip( const Frustum& f ) = 0;
+
+ virtual bool FrustumCull() const = 0;
+ virtual bool OcclusionCull() const = 0;
};
class BoundingBox : public BoundingVolume
@@ -45,6 +48,9 @@
virtual bool Clip( const MercuryPlane& p );
virtual bool Clip( const Frustum& f );
+ virtual bool FrustumCull() const;
+ virtual bool OcclusionCull() const;
+
private:
void ComputeNormals();
Modified: Mercury2/src/Mercury2.cpp
===================================================================
--- Mercury2/src/Mercury2.cpp 2009-07-04 15:46:32 UTC (rev 405)
+++ Mercury2/src/Mercury2.cpp 2009-07-04 16:01:19 UTC (rev 406)
@@ -19,6 +19,7 @@
#include <ModuleManager.h>
#include <MercuryFile.h>
bool SHOWBOUNDINGVOLUME = false;
+bool SHOWAXISES = false;
MSemaphore UpdateLoopGo;
void* UpdateThread(void* node)
Modified: Mercury2/src/MercuryNode.cpp
===================================================================
--- Mercury2/src/MercuryNode.cpp 2009-07-04 15:46:32 UTC (rev 405)
+++ Mercury2/src/MercuryNode.cpp 2009-07-04 16:01:19 UTC (rev 406)
@@ -137,12 +137,13 @@
MercuryMatrix matrix = FindGlobalMatrix();
PreRender( matrix ); //calls on children assets
+
modelView = ManipulateMatrix( matrix );
- if ( IsHidden() || IsCulled(modelView) ) return;
- modelView.Transpose();
+// if ( IsHidden() || IsCulled(modelView) ) return;
+ if ( IsHidden() ) return;
+
+ glLoadMatrix( modelView );
- glLoadMatrixf( modelView.Ptr() );
-
sa.type = ShaderAttribute::TYPE_MATRIX;
sa.value.matrix = matrix.Ptr();
Shader::SetAttribute("HG_ModelMatrix", sa);
@@ -158,7 +159,7 @@
child->RecursiveRender();
}
- glLoadMatrixf( modelView.Ptr() );
+ glLoadMatrix( modelView );
Shader::SetAttribute("HG_ModelMatrix", sa);
PostRender( modelView ); //calls on children assets
}
@@ -217,9 +218,15 @@
void MercuryNode::Render(const MercuryMatrix& matrix)
{
+ bool cull;
list< MercuryAsset* >::iterator i;
for (i = m_render.begin(); i != m_render.end(); ++i )
- (*i)->Render(this);
+ {
+ cull = false;
+ const BoundingVolume* bv = (*i)->GetBoundingVolume();
+ if (bv) cull = bv->FrustumCull();
+ if ( !cull ) (*i)->Render(this);
+ }
}
void MercuryNode::PostRender(const MercuryMatrix& matrix)
@@ -283,22 +290,14 @@
bool MercuryNode::IsCulled(const MercuryMatrix& matrix)
{
bool clip = false;
-
+/*
std::list< MAutoPtr< MercuryAsset > >::iterator i;
for (i = m_assets.begin(); i != m_assets.end(); ++i )
{
- const BoundingVolume* bv = (*i)->GetBoundingVolume();
- if (bv)
- {
- BoundingVolume* v = bv->SpawnClone();
- v->Transform( matrix );
- clip = v->Clip( *FRUSTUM );
- delete v;
- if ( clip == false ) return false;
- }
- else
- return false;
+ clip = (*i)->IsCulled( matrix );
+ if ( clip == false ) return false;
}
+ */
return clip;
}
Modified: Mercury2/src/MercuryVBO.cpp
===================================================================
--- Mercury2/src/MercuryVBO.cpp 2009-07-04 15:46:32 UTC (rev 405)
+++ Mercury2/src/MercuryVBO.cpp 2009-07-04 16:01:19 UTC (rev 406)
@@ -8,6 +8,7 @@
#define BUFFER_OFFSET(i) ((char*)NULL + (i))
extern bool SHOWBOUNDINGVOLUME;
+extern bool SHOWAXISES;
MercuryVBO::MercuryVBO()
:MercuryAsset(), m_initiated(false)
@@ -60,7 +61,7 @@
m_lastVBOrendered = this;
if (m_boundingVolume && SHOWBOUNDINGVOLUME) m_boundingVolume->Render();
- DrawAxes();
+ if ( SHOWAXISES ) DrawAxes();
}
void MercuryVBO::InitVBO()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-07-04 15:46:37
|
Revision: 405
http://hgengine.svn.sourceforge.net/hgengine/?rev=405&view=rev
Author: axlecrusher
Date: 2009-07-04 15:46:32 +0000 (Sat, 04 Jul 2009)
Log Message:
-----------
updates
Modified Paths:
--------------
Mercury2/src/FullscreenQuad.cpp
Mercury2/src/GLHeaders.h
Modified: Mercury2/src/FullscreenQuad.cpp
===================================================================
--- Mercury2/src/FullscreenQuad.cpp 2009-07-04 15:43:36 UTC (rev 404)
+++ Mercury2/src/FullscreenQuad.cpp 2009-07-04 15:46:32 UTC (rev 405)
@@ -14,7 +14,7 @@
{
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
- glLoadMatrixf( m_matrix.Ptr() );
+ glLoadMatrixf( m_matrix.Ptr() ); //this is OK
glMatrixMode(GL_PROJECTION);
glPushMatrix();
Modified: Mercury2/src/GLHeaders.h
===================================================================
--- Mercury2/src/GLHeaders.h 2009-07-04 15:43:36 UTC (rev 404)
+++ Mercury2/src/GLHeaders.h 2009-07-04 15:46:32 UTC (rev 405)
@@ -19,6 +19,7 @@
#endif
#include <GLHelpers.h>
+#include <assert.h>
#define GLERRORCHECK { \
uint32_t e = glGetError(); \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-07-04 15:43:42
|
Revision: 404
http://hgengine.svn.sourceforge.net/hgengine/?rev=404&view=rev
Author: axlecrusher
Date: 2009-07-04 15:43:36 +0000 (Sat, 04 Jul 2009)
Log Message:
-----------
update
Modified Paths:
--------------
Mercury2/src/MercuryVertex.cpp
Mercury2/src/MercuryVertex.h
Modified: Mercury2/src/MercuryVertex.cpp
===================================================================
--- Mercury2/src/MercuryVertex.cpp 2009-07-04 15:42:50 UTC (rev 403)
+++ Mercury2/src/MercuryVertex.cpp 2009-07-04 15:43:36 UTC (rev 404)
@@ -28,6 +28,13 @@
(*this)[i] = v[i];
}
+MercuryVertex::MercuryVertex( const MercuryVertex& v, float w)
+{
+ for (unsigned int i = 0; i < 3; ++i)
+ (*this)[i] = v[i];
+ (*this)[3] = w;
+}
+
void MercuryVertex::NormalizeSelf()
{
float imag = 1.0f/Length();
Modified: Mercury2/src/MercuryVertex.h
===================================================================
--- Mercury2/src/MercuryVertex.h 2009-07-04 15:42:50 UTC (rev 403)
+++ Mercury2/src/MercuryVertex.h 2009-07-04 15:43:36 UTC (rev 404)
@@ -19,6 +19,7 @@
MercuryVertex( float ix, float iy, float iz, float iw = 0 );
MercuryVertex( const float * in );
MercuryVertex( const MercuryVertex& v);
+ MercuryVertex( const MercuryVertex& v, float w);
///Direct conversion to float*
__inline__ operator float* () { return (float*)&m_xyzw; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-07-04 15:42:50
|
Revision: 403
http://hgengine.svn.sourceforge.net/hgengine/?rev=403&view=rev
Author: axlecrusher
Date: 2009-07-04 15:42:50 +0000 (Sat, 04 Jul 2009)
Log Message:
-----------
unified load matrix
Modified Paths:
--------------
Mercury2/src/GLHelpers.h
Modified: Mercury2/src/GLHelpers.h
===================================================================
--- Mercury2/src/GLHelpers.h 2009-07-04 15:40:09 UTC (rev 402)
+++ Mercury2/src/GLHelpers.h 2009-07-04 15:42:50 UTC (rev 403)
@@ -1,7 +1,9 @@
#include <global.h>
#include <MercuryUtil.h>
+#include <MercuryMatrix.h>
MString GlError2String(uint32_t e);
+void glLoadMatrix(const MercuryMatrix& m);
/****************************************************************************
* Copyright (C) 2009 by Joshua Allen *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-07-04 15:40:10
|
Revision: 402
http://hgengine.svn.sourceforge.net/hgengine/?rev=402&view=rev
Author: axlecrusher
Date: 2009-07-04 15:40:09 +0000 (Sat, 04 Jul 2009)
Log Message:
-----------
use unified load matrix
Modified Paths:
--------------
Mercury2/src/RenderGraph.cpp
Modified: Mercury2/src/RenderGraph.cpp
===================================================================
--- Mercury2/src/RenderGraph.cpp 2009-07-04 15:38:52 UTC (rev 401)
+++ Mercury2/src/RenderGraph.cpp 2009-07-04 15:40:09 UTC (rev 402)
@@ -19,9 +19,8 @@
m_node->PreRender( *m_matrix ); //calls on children assets
modelView = m_node->ManipulateMatrix( *m_matrix );
if ( m_node->IsHidden() || m_node->IsCulled(modelView) ) return;
- modelView.Transpose();
- glLoadMatrixf( modelView.Ptr() );
+ glLoadMatrix( modelView );
sa.type = ShaderAttribute::TYPE_MATRIX;
sa.value.matrix = m_matrix->Ptr();
@@ -37,7 +36,7 @@
if (m_node)
{
- glLoadMatrixf( modelView.Ptr() );
+ glLoadMatrix( modelView );
Shader::SetAttribute("HG_ModelMatrix", sa);
m_node->PostRender( modelView ); //calls on children assets
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-07-04 15:38:53
|
Revision: 401
http://hgengine.svn.sourceforge.net/hgengine/?rev=401&view=rev
Author: axlecrusher
Date: 2009-07-04 15:38:52 +0000 (Sat, 04 Jul 2009)
Log Message:
-----------
add culling to render
Modified Paths:
--------------
Mercury2/src/HGMDLModel.cpp
Modified: Mercury2/src/HGMDLModel.cpp
===================================================================
--- Mercury2/src/HGMDLModel.cpp 2009-07-04 15:37:58 UTC (rev 400)
+++ Mercury2/src/HGMDLModel.cpp 2009-07-04 15:38:52 UTC (rev 401)
@@ -60,9 +60,17 @@
void HGMDLModel::Render(const MercuryNode* node)
{
+ bool cull;
if ( GetLoadState() != LOADING )
+ {
for(uint16_t i = 0; i < m_meshes.size(); ++i)
- m_meshes[i]->Render(node);
+ {
+ cull = false;
+ const BoundingVolume* bv = m_meshes[i]->GetBoundingVolume();
+ if (bv) cull = bv->FrustumCull();
+ if ( !cull ) m_meshes[i]->Render(node);
+ }
+ }
}
void HGMDLModel::LoadHGMDL( const MString& path )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-07-04 15:37:59
|
Revision: 400
http://hgengine.svn.sourceforge.net/hgengine/?rev=400&view=rev
Author: axlecrusher
Date: 2009-07-04 15:37:58 +0000 (Sat, 04 Jul 2009)
Log Message:
-----------
use unified matrix loader
Modified Paths:
--------------
Mercury2/src/Viewport.cpp
Modified: Mercury2/src/Viewport.cpp
===================================================================
--- Mercury2/src/Viewport.cpp 2009-07-04 15:36:52 UTC (rev 399)
+++ Mercury2/src/Viewport.cpp 2009-07-04 15:37:58 UTC (rev 400)
@@ -23,9 +23,7 @@
//Load the frustum into the projection
//"eye" position does not go into projection
glMatrixMode(GL_PROJECTION);
- MercuryMatrix f = m_frustum.GetMatrix();
- f.Transpose();
- glLoadMatrixf( f.Ptr() );
+ glLoadMatrix( m_frustum.GetMatrix() );
glMatrixMode(GL_MODELVIEW);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-07-04 15:37:03
|
Revision: 399
http://hgengine.svn.sourceforge.net/hgengine/?rev=399&view=rev
Author: axlecrusher
Date: 2009-07-04 15:36:52 +0000 (Sat, 04 Jul 2009)
Log Message:
-----------
unified load matrix
Modified Paths:
--------------
Mercury2/src/GLHelpers.cpp
Modified: Mercury2/src/GLHelpers.cpp
===================================================================
--- Mercury2/src/GLHelpers.cpp 2009-07-04 06:23:28 UTC (rev 398)
+++ Mercury2/src/GLHelpers.cpp 2009-07-04 15:36:52 UTC (rev 399)
@@ -39,6 +39,14 @@
return "Unknown Error";
}
+void glLoadMatrix(const MercuryMatrix& m)
+{
+ static MercuryMatrix l;
+ l = m;
+ l.Transpose();
+ glLoadMatrixf( l.Ptr() );
+}
+
/****************************************************************************
* Copyright (C) 2009 by Joshua Allen *
* *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2009-07-04 06:23:29
|
Revision: 398
http://hgengine.svn.sourceforge.net/hgengine/?rev=398&view=rev
Author: cnlohr
Date: 2009-07-04 06:23:28 +0000 (Sat, 04 Jul 2009)
Log Message:
-----------
add FindNode() (to find children by name
Modified Paths:
--------------
Mercury2/src/MercuryMath.h
Mercury2/src/MercuryNode.cpp
Mercury2/src/MercuryNode.h
Modified: Mercury2/src/MercuryMath.h
===================================================================
--- Mercury2/src/MercuryMath.h 2009-07-03 04:53:25 UTC (rev 397)
+++ Mercury2/src/MercuryMath.h 2009-07-04 06:23:28 UTC (rev 398)
@@ -15,6 +15,8 @@
#define INFINITY (std::numeric_limits<float>::infinity())
#endif
+#define MAXINT (0x7FFFFFFF)
+
void ZeroFloatRow(FloatRow& r);
#define DEGRAD 0.01745329251994329576f //degree to radian
Modified: Mercury2/src/MercuryNode.cpp
===================================================================
--- Mercury2/src/MercuryNode.cpp 2009-07-03 04:53:25 UTC (rev 397)
+++ Mercury2/src/MercuryNode.cpp 2009-07-04 06:23:28 UTC (rev 398)
@@ -97,6 +97,30 @@
return child->PrevSibling();
}
+MercuryNode* MercuryNode::FindChild( const MString & sNameOfNode, int depth )
+{
+ if( depth >= 0 )
+ {
+ for( std::list< MercuryNode* >::iterator i = m_children.begin(); i != m_children.end(); i++ )
+ {
+ if( (*i)->GetName().compare( sNameOfNode ) == 0 )
+ return (*i);
+ }
+
+ for( std::list< MercuryNode* >::iterator i = m_children.begin(); i != m_children.end(); i++ )
+ {
+ MercuryNode * ret;
+ if( ( ret = (*i)->FindChild( sNameOfNode, depth - 1 ) ) )
+ {
+ if( (*i)->GetName().compare( sNameOfNode ) == 0 )
+ return ret;
+ }
+ }
+ }
+ return NULL;
+}
+
+
void MercuryNode::RecursiveUpdate(float dTime)
{
Update(dTime);
Modified: Mercury2/src/MercuryNode.h
===================================================================
--- Mercury2/src/MercuryNode.h 2009-07-03 04:53:25 UTC (rev 397)
+++ Mercury2/src/MercuryNode.h 2009-07-04 06:23:28 UTC (rev 398)
@@ -42,7 +42,11 @@
MercuryNode* NextChild(const MercuryNode* n) const; ///Finds the next child in regards to n
MercuryNode* PrevChild(const MercuryNode* n) const; ///Finds the previous child in regards to n
const std::list< MercuryNode* >& Children() const { return m_children; }
-
+
+ ///Find a child node that has the name matching sNameOfNode.
+ /** The search order is breadth-first, however this may change without notice! */
+ MercuryNode* FindChild( const MString & sNameOfNode, int depth = MAXINT );
+
virtual void Update(float dTime) {};
virtual void RecursiveUpdate(float dTime);
void ThreadedUpdate(float dTime);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-07-03 04:53:25
|
Revision: 397
http://hgengine.svn.sourceforge.net/hgengine/?rev=397&view=rev
Author: axlecrusher
Date: 2009-07-03 04:53:25 +0000 (Fri, 03 Jul 2009)
Log Message:
-----------
fix for alpha
Modified Paths:
--------------
Mercury2/Themes/default/Graphic/testShader.frag
Modified: Mercury2/Themes/default/Graphic/testShader.frag
===================================================================
--- Mercury2/Themes/default/Graphic/testShader.frag 2009-07-01 17:27:00 UTC (rev 396)
+++ Mercury2/Themes/default/Graphic/testShader.frag 2009-07-03 04:53:25 UTC (rev 397)
@@ -1,9 +1,9 @@
-uniform sampler2D HG_Texture0;
+//uniform sampler2D HG_Texture0;
varying vec3 normal;
void main()
{
// gl_FragData[0] = texture2D(HG_Texture0, gl_TexCoord[0].st);
vec3 n = normalize(normal);
- gl_FragData[0].rgb = 0.5 + 0.5 * n;
+ gl_FragData[0] = vec4(0.5 + 0.5 * n, 1.0);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2009-07-01 17:27:03
|
Revision: 396
http://hgengine.svn.sourceforge.net/hgengine/?rev=396&view=rev
Author: cnlohr
Date: 2009-07-01 17:27:00 +0000 (Wed, 01 Jul 2009)
Log Message:
-----------
move stuff to the approprate places
Modified Paths:
--------------
Mercury2/src/Mercury2.cpp
Mercury2/src/MercuryFile.cpp
Mercury2/src/MercuryTheme.cpp
Mercury2/src/MercuryTheme.h
Mercury2/src/MercuryUtil.cpp
Mercury2/src/MercuryUtil.h
Added Paths:
-----------
Mercury2/Themes/default/File/
Mercury2/Themes/default/File/scenegraph.xml
Mercury2/Themes/default/Font/
Mercury2/Themes/default/Font/testfont.hgfont
Mercury2/Themes/default/Font/testfont.png
Mercury2/Themes/default/Graphic/
Mercury2/Themes/default/Graphic/flame.png
Mercury2/Themes/default/Graphic/test.bmp
Mercury2/Themes/default/Graphic/test.frag
Mercury2/Themes/default/Graphic/test.vert
Mercury2/Themes/default/Graphic/test2.bmp
Mercury2/Themes/default/Graphic/test2.png
Mercury2/Themes/default/Graphic/testShader.frag
Mercury2/Themes/default/Graphic/testShader.vert
Mercury2/Themes/default/Model/
Mercury2/Themes/default/Model/beerhall.hgmdl
Mercury2/Themes/default/Model/gunther.hgmdl
Mercury2/Themes/default/Model/gunther.png
Mercury2/Themes/default/Model/lamp.hgmdl
Mercury2/Themes/default/Model/lamp.png
Mercury2/Themes/default/Model/lampN.hgmdl
Mercury2/Themes/default/Model/map.hgmdl
Mercury2/Themes/default/Model/map.png
Removed Paths:
-------------
Mercury2/beerhall.hgmdl
Mercury2/flame.png
Mercury2/lamp.hgmdl
Mercury2/lamp.png
Mercury2/lampN.hgmdl
Mercury2/map.hgmdl
Mercury2/map.png
Mercury2/scenegraph.xml
Mercury2/test.bmp
Mercury2/test2.bmp
Mercury2/test2.png
Mercury2/testShader.frag
Mercury2/testShader.vert
Mercury2/testfont.hgfont
Mercury2/testfont.png
Added: Mercury2/Themes/default/File/scenegraph.xml
===================================================================
--- Mercury2/Themes/default/File/scenegraph.xml (rev 0)
+++ Mercury2/Themes/default/File/scenegraph.xml 2009-07-01 17:27:00 UTC (rev 396)
@@ -0,0 +1,50 @@
+<SceneGraph name="root">
+<!-- <node type="cameranode" movx="6" movz="-5.5" movy="3" rotx="-45" roty="90">
+ <node type="viewport" fov="45" aspect="1.3333" near="0.01" far="100"/>
+ </node>
+-->
+ <node type="cameranode" movx="0" movz="0" movy="0" rotx="0" roty="0" rotz="0" name="camera">
+ <node type="viewport" fov="45" aspect="1.3333" near="0.01" far="100" name="vp"/>
+ </node>
+
+ <node type="transformnode" movz="-5" >
+ <node type="TextNode" text="test font 123 HELLO WORLD!!! WOOT!" font="FONT:testfont.hgfont" size=".01" width="300" alphaPath="true" alignment="FIT_FULL" />
+ </node>
+<!-- <asset type="texture" file="screenFBO_0" dynamic="true"/>
+ <asset type="fullscreenquad"/>
+ <node type="mercuryfbo" width="640" height="480" depth="true" tnum="2" name="screenFBO" usescreensize="true">
+ <asset type="shader" file="testShader"/>
+--> <node type="transformnode" rotx="-90" movz="-10" movx="0" movy="-5">
+ <asset type="texture" file="MODEL:map.png"/>
+ <asset type="hgmdlmodel" file="MODEL:map.hgmdl" />
+ </node>
+ <node type="mercurynode" name="lampForest" >
+ <node type="transformnode" movz="-5" movx="0" movy="0" name="lamprow" >
+ <node type="mercurynode" name="lamp">
+ <node type="transformnode" rotx="-90" >
+ <asset type="texture" file="MODEL:lamp.png"/>
+ <asset type="hgmdlmodel" file="MODEL:lampN.hgmdl" />
+ </node>
+ <node type="billboardnode" billboardaxis="0,1,0" spheremode="true" >
+ <node type="transformnode" roty="180" scalex="0.1" scaley="0.1" alphaPath="true">
+ <asset type="texture" file="GRAPHIC:flame.png"/>
+ <asset type="quad"/>
+ </node>
+ </node>
+ </node>
+ <node type="transformnode" movx="1" fallback="lamprow.lamp" />
+ <node type="transformnode" movx="2" fallback="lamprow.lamp" />
+ <node type="transformnode" movx="3" fallback="lamprow.lamp" />
+ <node type="transformnode" movx="-1" fallback="lamprow.lamp" />
+ <node type="transformnode" movx="-2" fallback="lamprow.lamp" />
+ <node type="transformnode" movx="-3" fallback="lamprow.lamp" />
+ </node>
+ <node type="transformnode" movz="-6" fallback="lampForest.lamprow"/>
+ <node type="transformnode" movz="-7" fallback="lampForest.lamprow"/>
+ <node type="transformnode" movz="-8" fallback="lampForest.lamprow"/>
+ <node type="transformnode" movz="-9" fallback="lampForest.lamprow"/>
+ <node type="transformnode" movz="-4" fallback="lampForest.lamprow"/>
+ <node type="transformnode" movz="-3" fallback="lampForest.lamprow"/>
+ </node>
+<!-- </node> -->
+</SceneGraph>
Added: Mercury2/Themes/default/Font/testfont.hgfont
===================================================================
--- Mercury2/Themes/default/Font/testfont.hgfont (rev 0)
+++ Mercury2/Themes/default/Font/testfont.hgfont 2009-07-01 17:27:00 UTC (rev 396)
@@ -0,0 +1,258 @@
+FONT:testfont.png
+64 4.000000 15.000000 80.000000
+0 0.000000 0.000000 0.031250 0.040039 32 41 8 41
+1 0.062500 0.000000 0.093750 0.040039 32 41 8 41
+2 0.125000 0.000000 0.156250 0.040039 32 41 8 41
+3 0.187500 0.000000 0.218750 0.040039 32 41 8 41
+4 0.250000 0.000000 0.281250 0.040039 32 41 8 41
+5 0.312500 0.000000 0.343750 0.040039 32 41 8 41
+6 0.375000 0.000000 0.406250 0.040039 32 41 8 41
+7 0.437500 0.000000 0.468750 0.040039 32 41 8 41
+8 0.500000 0.000000 0.531250 0.040039 32 41 8 41
+9 0.562500 0.000000 0.593750 0.040039 32 41 8 41
+10 0.625000 0.000000 0.656250 0.040039 32 41 8 41
+11 0.687500 0.000000 0.718750 0.040039 32 41 8 41
+12 0.750000 0.000000 0.781250 0.040039 32 41 8 41
+13 0.812500 0.000000 0.843750 0.040039 32 41 8 41
+14 0.875000 0.000000 0.906250 0.040039 32 41 8 41
+15 0.937500 0.000000 0.968750 0.040039 32 41 8 41
+16 0.000000 0.062500 0.031250 0.102539 32 41 8 41
+17 0.062500 0.062500 0.093750 0.102539 32 41 8 41
+18 0.125000 0.062500 0.156250 0.102539 32 41 8 41
+19 0.187500 0.062500 0.218750 0.102539 32 41 8 41
+20 0.250000 0.062500 0.281250 0.102539 32 41 8 41
+21 0.312500 0.062500 0.343750 0.102539 32 41 8 41
+22 0.375000 0.062500 0.406250 0.102539 32 41 8 41
+23 0.437500 0.062500 0.468750 0.102539 32 41 8 41
+24 0.500000 0.062500 0.531250 0.102539 32 41 8 41
+25 0.562500 0.062500 0.593750 0.102539 32 41 8 41
+26 0.625000 0.062500 0.656250 0.102539 32 41 8 41
+27 0.687500 0.062500 0.718750 0.102539 32 41 8 41
+28 0.750000 0.062500 0.781250 0.102539 32 41 8 41
+29 0.812500 0.062500 0.843750 0.102539 32 41 8 41
+30 0.875000 0.062500 0.906250 0.102539 32 41 8 41
+31 0.937500 0.062500 0.968750 0.102539 32 41 8 41
+32 0.000000 0.125000 0.000000 0.125000 0 0 0 0
+33 0.062500 0.125000 0.068359 0.169922 6 46 7 46
+34 0.125000 0.125000 0.141602 0.140625 17 16 3 46
+35 0.187500 0.125000 0.221680 0.169922 35 46 0 46
+36 0.250000 0.125000 0.279297 0.178711 30 55 3 48
+37 0.312500 0.125000 0.360352 0.171875 49 48 4 47
+38 0.375000 0.125000 0.413086 0.171875 39 48 3 47
+39 0.437500 0.125000 0.443359 0.140625 6 16 3 46
+40 0.500000 0.125000 0.515625 0.182617 16 59 4 46
+41 0.562500 0.125000 0.578125 0.182617 16 59 1 46
+42 0.625000 0.125000 0.645508 0.143555 21 19 2 46
+43 0.687500 0.125000 0.717773 0.155273 31 31 3 38
+44 0.750000 0.125000 0.755859 0.139648 6 15 6 6
+45 0.812500 0.125000 0.829102 0.129883 17 5 2 19
+46 0.875000 0.125000 0.880859 0.130859 6 6 6 6
+47 0.937500 0.125000 0.956055 0.169922 19 46 0 46
+48 0.000000 0.187500 0.029297 0.233398 30 47 3 46
+49 0.062500 0.187500 0.079102 0.232422 17 46 7 46
+50 0.125000 0.187500 0.155273 0.232422 31 46 1 46
+51 0.187500 0.187500 0.216797 0.233398 30 47 3 46
+52 0.250000 0.187500 0.281250 0.231445 32 45 1 45
+53 0.312500 0.187500 0.341797 0.232422 30 46 3 45
+54 0.375000 0.187500 0.405273 0.233398 31 47 2 46
+55 0.437500 0.187500 0.466797 0.231445 30 45 3 45
+56 0.500000 0.187500 0.529297 0.233398 30 47 3 46
+57 0.562500 0.187500 0.591797 0.233398 30 47 3 46
+58 0.625000 0.187500 0.630859 0.220703 6 34 6 34
+59 0.687500 0.187500 0.693359 0.229492 6 43 6 34
+60 0.750000 0.187500 0.778320 0.217773 29 31 4 38
+61 0.812500 0.187500 0.841797 0.206055 30 19 3 32
+62 0.875000 0.187500 0.903320 0.217773 29 31 4 38
+63 0.937500 0.187500 0.966797 0.233398 30 47 3 47
+64 0.000000 0.250000 0.057617 0.308594 59 60 3 47
+65 0.062500 0.250000 0.106445 0.294922 45 46 -1 46
+66 0.125000 0.250000 0.159180 0.294922 35 46 5 46
+67 0.187500 0.250000 0.226562 0.296875 40 48 3 47
+68 0.250000 0.250000 0.287109 0.294922 38 46 5 46
+69 0.312500 0.250000 0.346680 0.294922 35 46 5 46
+70 0.375000 0.250000 0.405273 0.294922 31 46 5 46
+71 0.437500 0.250000 0.479492 0.296875 43 48 3 47
+72 0.500000 0.250000 0.535156 0.294922 36 46 5 46
+73 0.562500 0.250000 0.568359 0.294922 6 46 6 46
+74 0.625000 0.250000 0.650391 0.295898 26 47 1 46
+75 0.687500 0.250000 0.724609 0.294922 38 46 5 46
+76 0.750000 0.250000 0.778320 0.294922 29 46 5 46
+77 0.812500 0.250000 0.854492 0.294922 43 46 5 46
+78 0.875000 0.250000 0.910156 0.294922 36 46 5 46
+79 0.937500 0.250000 0.980469 0.296875 44 48 3 47
+80 0.000000 0.312500 0.034180 0.357422 35 46 5 46
+81 0.062500 0.312500 0.105469 0.362305 44 51 3 47
+82 0.125000 0.312500 0.164062 0.357422 40 46 5 46
+83 0.187500 0.312500 0.223633 0.359375 37 48 3 47
+84 0.250000 0.312500 0.285156 0.357422 36 46 2 46
+85 0.312500 0.312500 0.347656 0.358398 36 47 5 46
+86 0.375000 0.312500 0.418945 0.357422 45 46 -1 46
+87 0.437500 0.312500 0.499023 0.357422 63 46 0 46
+88 0.500000 0.312500 0.540039 0.357422 41 46 -1 46
+89 0.562500 0.312500 0.603516 0.357422 42 46 0 46
+90 0.625000 0.312500 0.660156 0.357422 36 46 1 46
+91 0.687500 0.312500 0.699219 0.370117 12 59 4 46
+92 0.750000 0.312500 0.768555 0.357422 19 46 -1 46
+93 0.812500 0.312500 0.824219 0.370117 12 59 2 46
+94 0.875000 0.312500 0.899414 0.336914 25 25 1 47
+95 0.937500 0.312500 0.973633 0.317383 37 5 -1 -8
+96 0.000000 0.375000 0.010742 0.383789 11 9 3 46
+97 0.062500 0.375000 0.091797 0.410156 30 36 3 35
+98 0.125000 0.375000 0.153320 0.420898 29 47 4 46
+99 0.187500 0.375000 0.215820 0.410156 29 36 3 35
+100 0.250000 0.375000 0.278320 0.420898 29 47 2 46
+101 0.312500 0.375000 0.342773 0.410156 31 36 2 35
+102 0.375000 0.375000 0.394531 0.420898 20 47 1 47
+103 0.437500 0.375000 0.465820 0.422852 29 49 2 35
+104 0.500000 0.375000 0.527344 0.419922 28 46 4 46
+105 0.562500 0.375000 0.568359 0.419922 6 46 4 46
+106 0.625000 0.375000 0.637695 0.433594 13 60 -3 46
+107 0.687500 0.375000 0.714844 0.419922 28 46 4 46
+108 0.750000 0.375000 0.755859 0.419922 6 46 4 46
+109 0.812500 0.375000 0.857422 0.409180 46 35 4 35
+110 0.875000 0.375000 0.902344 0.409180 28 35 4 35
+111 0.937500 0.375000 0.966797 0.410156 30 36 3 35
+112 0.000000 0.437500 0.028320 0.484375 29 48 4 35
+113 0.062500 0.437500 0.090820 0.484375 29 48 2 35
+114 0.125000 0.437500 0.142578 0.471680 18 35 4 35
+115 0.187500 0.437500 0.213867 0.472656 27 36 2 35
+116 0.250000 0.437500 0.265625 0.483398 16 47 1 46
+117 0.312500 0.437500 0.339844 0.471680 28 35 4 34
+118 0.375000 0.437500 0.405273 0.470703 31 34 1 34
+119 0.437500 0.437500 0.485352 0.470703 49 34 -1 34
+120 0.500000 0.437500 0.531250 0.470703 32 34 0 34
+121 0.562500 0.437500 0.593750 0.484375 32 48 0 34
+122 0.625000 0.437500 0.653320 0.470703 29 34 1 34
+123 0.687500 0.437500 0.705078 0.497070 18 61 1 47
+124 0.750000 0.437500 0.754883 0.496094 5 60 6 46
+125 0.812500 0.437500 0.830078 0.497070 18 61 2 47
+126 0.875000 0.437500 0.906250 0.448242 32 11 2 28
+127 0.937500 0.437500 0.968750 0.477539 32 41 8 41
+128 0.000000 0.500000 0.031250 0.540039 32 41 8 41
+129 0.062500 0.500000 0.093750 0.540039 32 41 8 41
+130 0.125000 0.500000 0.156250 0.540039 32 41 8 41
+131 0.187500 0.500000 0.218750 0.540039 32 41 8 41
+132 0.250000 0.500000 0.281250 0.540039 32 41 8 41
+133 0.312500 0.500000 0.343750 0.540039 32 41 8 41
+134 0.375000 0.500000 0.406250 0.540039 32 41 8 41
+135 0.437500 0.500000 0.468750 0.540039 32 41 8 41
+136 0.500000 0.500000 0.531250 0.540039 32 41 8 41
+137 0.562500 0.500000 0.593750 0.540039 32 41 8 41
+138 0.625000 0.500000 0.656250 0.540039 32 41 8 41
+139 0.687500 0.500000 0.718750 0.540039 32 41 8 41
+140 0.750000 0.500000 0.781250 0.540039 32 41 8 41
+141 0.812500 0.500000 0.843750 0.540039 32 41 8 41
+142 0.875000 0.500000 0.906250 0.540039 32 41 8 41
+143 0.937500 0.500000 0.968750 0.540039 32 41 8 41
+144 0.000000 0.562500 0.031250 0.602539 32 41 8 41
+145 0.062500 0.562500 0.093750 0.602539 32 41 8 41
+146 0.125000 0.562500 0.156250 0.602539 32 41 8 41
+147 0.187500 0.562500 0.218750 0.602539 32 41 8 41
+148 0.250000 0.562500 0.281250 0.602539 32 41 8 41
+149 0.312500 0.562500 0.343750 0.602539 32 41 8 41
+150 0.375000 0.562500 0.406250 0.602539 32 41 8 41
+151 0.437500 0.562500 0.468750 0.602539 32 41 8 41
+152 0.500000 0.562500 0.531250 0.602539 32 41 8 41
+153 0.562500 0.562500 0.593750 0.602539 32 41 8 41
+154 0.625000 0.562500 0.656250 0.602539 32 41 8 41
+155 0.687500 0.562500 0.718750 0.602539 32 41 8 41
+156 0.750000 0.562500 0.781250 0.602539 32 41 8 41
+157 0.812500 0.562500 0.843750 0.602539 32 41 8 41
+158 0.875000 0.562500 0.906250 0.602539 32 41 8 41
+159 0.937500 0.562500 0.968750 0.602539 32 41 8 41
+160 0.000000 0.625000 0.000000 0.625000 0 0 0 0
+161 0.062500 0.625000 0.068359 0.670898 6 47 7 34
+162 0.125000 0.625000 0.153320 0.682617 29 59 3 46
+163 0.187500 0.625000 0.219727 0.671875 33 48 1 47
+164 0.250000 0.625000 0.281250 0.652344 32 28 1 36
+165 0.312500 0.625000 0.346680 0.669922 35 46 -1 46
+166 0.375000 0.625000 0.379883 0.683594 5 60 6 46
+167 0.437500 0.625000 0.466797 0.683594 30 60 3 47
+168 0.500000 0.625000 0.517578 0.630859 18 6 2 46
+169 0.562500 0.625000 0.608398 0.671875 47 48 0 47
+170 0.625000 0.625000 0.646484 0.647461 22 23 1 47
+171 0.687500 0.625000 0.713867 0.653320 27 29 4 31
+172 0.750000 0.625000 0.779297 0.643555 30 19 3 32
+173 0.812500 0.625000 0.829102 0.629883 17 5 2 19
+174 0.875000 0.625000 0.920898 0.671875 47 48 0 47
+175 0.937500 0.625000 0.973633 0.629883 37 5 -1 54
+176 0.000000 0.687500 0.016602 0.704102 17 17 4 47
+177 0.062500 0.687500 0.092773 0.724609 31 38 2 38
+178 0.125000 0.687500 0.143555 0.709961 19 23 1 47
+179 0.187500 0.687500 0.206055 0.709961 19 23 1 47
+180 0.250000 0.687500 0.260742 0.696289 11 9 7 45
+181 0.312500 0.687500 0.338867 0.733398 27 47 5 34
+182 0.375000 0.687500 0.408203 0.745117 34 59 0 46
+183 0.437500 0.687500 0.443359 0.693359 6 6 6 25
+184 0.500000 0.687500 0.512695 0.701172 13 14 3 0
+185 0.562500 0.687500 0.574219 0.709961 12 23 4 47
+186 0.625000 0.687500 0.645508 0.709961 21 23 1 47
+187 0.687500 0.687500 0.713867 0.715820 27 29 5 31
+188 0.750000 0.687500 0.796875 0.735352 48 49 4 47
+189 0.812500 0.687500 0.859375 0.734375 48 48 4 47
+190 0.875000 0.687500 0.924805 0.735352 51 49 1 47
+191 0.937500 0.687500 0.965820 0.734375 29 48 5 34
+192 0.000000 0.750000 0.043945 0.806641 45 58 -1 58
+193 0.062500 0.750000 0.106445 0.806641 45 58 -1 58
+194 0.125000 0.750000 0.168945 0.806641 45 58 -1 58
+195 0.187500 0.750000 0.231445 0.805664 45 57 -1 57
+196 0.250000 0.750000 0.293945 0.803711 45 55 -1 55
+197 0.312500 0.750000 0.356445 0.803711 45 55 -1 55
+198 0.375000 0.750000 0.435547 0.794922 62 46 -1 46
+199 0.437500 0.750000 0.476562 0.809570 40 61 3 47
+200 0.500000 0.750000 0.534180 0.806641 35 58 5 58
+201 0.562500 0.750000 0.596680 0.806641 35 58 5 58
+202 0.625000 0.750000 0.659180 0.806641 35 58 5 58
+203 0.687500 0.750000 0.721680 0.803711 35 55 5 55
+204 0.750000 0.750000 0.760742 0.806641 11 58 2 58
+205 0.812500 0.750000 0.823242 0.806641 11 58 5 58
+206 0.875000 0.750000 0.894531 0.806641 20 58 -1 58
+207 0.937500 0.750000 0.955078 0.803711 18 55 0 55
+208 0.000000 0.812500 0.041992 0.857422 43 46 0 46
+209 0.062500 0.812500 0.097656 0.868164 36 57 5 57
+210 0.125000 0.812500 0.167969 0.870117 44 59 3 58
+211 0.187500 0.812500 0.230469 0.870117 44 59 3 58
+212 0.250000 0.812500 0.292969 0.870117 44 59 3 58
+213 0.312500 0.812500 0.355469 0.869141 44 58 3 57
+214 0.375000 0.812500 0.417969 0.867188 44 56 3 55
+215 0.437500 0.812500 0.463867 0.838867 27 27 5 36
+216 0.500000 0.812500 0.543945 0.861328 45 50 3 47
+217 0.562500 0.812500 0.597656 0.870117 36 59 5 58
+218 0.625000 0.812500 0.660156 0.870117 36 59 5 58
+219 0.687500 0.812500 0.722656 0.870117 36 59 5 58
+220 0.750000 0.812500 0.785156 0.867188 36 56 5 55
+221 0.812500 0.812500 0.853516 0.869141 42 58 0 58
+222 0.875000 0.812500 0.909180 0.857422 35 46 5 46
+223 0.937500 0.812500 0.968750 0.859375 32 48 5 47
+224 0.000000 0.875000 0.029297 0.920898 30 47 3 46
+225 0.062500 0.875000 0.091797 0.920898 30 47 3 46
+226 0.125000 0.875000 0.154297 0.920898 30 47 3 46
+227 0.187500 0.875000 0.216797 0.919922 30 46 3 45
+228 0.250000 0.875000 0.279297 0.917969 30 44 3 43
+229 0.312500 0.875000 0.341797 0.922852 30 49 3 48
+230 0.375000 0.875000 0.425781 0.910156 52 36 2 35
+231 0.437500 0.875000 0.465820 0.922852 29 49 3 35
+232 0.500000 0.875000 0.530273 0.920898 31 47 2 46
+233 0.562500 0.875000 0.592773 0.920898 31 47 2 46
+234 0.625000 0.875000 0.655273 0.920898 31 47 2 46
+235 0.687500 0.875000 0.717773 0.917969 31 44 2 43
+236 0.750000 0.875000 0.760742 0.919922 11 46 2 46
+237 0.812500 0.875000 0.823242 0.919922 11 46 5 46
+238 0.875000 0.875000 0.894531 0.919922 20 46 -1 46
+239 0.937500 0.875000 0.955078 0.916992 18 43 0 43
+240 0.000000 0.937500 0.030273 0.983398 31 47 2 46
+241 0.062500 0.937500 0.089844 0.981445 28 45 4 45
+242 0.125000 0.937500 0.154297 0.983398 30 47 3 46
+243 0.187500 0.937500 0.216797 0.983398 30 47 3 46
+244 0.250000 0.937500 0.279297 0.983398 30 47 3 46
+245 0.312500 0.937500 0.341797 0.982422 30 46 3 45
+246 0.375000 0.937500 0.404297 0.980469 30 44 3 43
+247 0.437500 0.937500 0.468750 0.961914 32 25 3 35
+248 0.500000 0.937500 0.531250 0.977539 32 41 3 38
+249 0.562500 0.937500 0.589844 0.983398 28 47 4 46
+250 0.625000 0.937500 0.652344 0.983398 28 47 4 46
+251 0.687500 0.937500 0.714844 0.983398 28 47 4 46
+252 0.750000 0.937500 0.777344 0.980469 28 44 4 43
+253 0.812500 0.937500 0.843750 0.996094 32 60 0 46
+254 0.875000 0.937500 0.903320 0.995117 29 59 4 46
+255 0.937500 0.937500 0.968750 0.993164 32 57 0 43
Added: Mercury2/Themes/default/Font/testfont.png
===================================================================
(Binary files differ)
Property changes on: Mercury2/Themes/default/Font/testfont.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/Themes/default/Graphic/flame.png
===================================================================
(Binary files differ)
Property changes on: Mercury2/Themes/default/Graphic/flame.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/Themes/default/Graphic/test.bmp
===================================================================
(Binary files differ)
Property changes on: Mercury2/Themes/default/Graphic/test.bmp
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/Themes/default/Graphic/test.frag
===================================================================
--- Mercury2/Themes/default/Graphic/test.frag (rev 0)
+++ Mercury2/Themes/default/Graphic/test.frag 2009-07-01 17:27:00 UTC (rev 396)
@@ -0,0 +1,4 @@
+void main()
+{
+ gl_FragColor = vec4( 1., 0., 1., 1. );
+}
\ No newline at end of file
Added: Mercury2/Themes/default/Graphic/test.vert
===================================================================
--- Mercury2/Themes/default/Graphic/test.vert (rev 0)
+++ Mercury2/Themes/default/Graphic/test.vert 2009-07-01 17:27:00 UTC (rev 396)
@@ -0,0 +1,4 @@
+void main()
+{
+ gl_Position = ftransform();
+}
\ No newline at end of file
Added: Mercury2/Themes/default/Graphic/test2.bmp
===================================================================
(Binary files differ)
Property changes on: Mercury2/Themes/default/Graphic/test2.bmp
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/Themes/default/Graphic/test2.png
===================================================================
(Binary files differ)
Property changes on: Mercury2/Themes/default/Graphic/test2.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/Themes/default/Graphic/testShader.frag
===================================================================
--- Mercury2/Themes/default/Graphic/testShader.frag (rev 0)
+++ Mercury2/Themes/default/Graphic/testShader.frag 2009-07-01 17:27:00 UTC (rev 396)
@@ -0,0 +1,9 @@
+uniform sampler2D HG_Texture0;
+varying vec3 normal;
+
+void main()
+{
+// gl_FragData[0] = texture2D(HG_Texture0, gl_TexCoord[0].st);
+ vec3 n = normalize(normal);
+ gl_FragData[0].rgb = 0.5 + 0.5 * n;
+}
Added: Mercury2/Themes/default/Graphic/testShader.vert
===================================================================
--- Mercury2/Themes/default/Graphic/testShader.vert (rev 0)
+++ Mercury2/Themes/default/Graphic/testShader.vert 2009-07-01 17:27:00 UTC (rev 396)
@@ -0,0 +1,13 @@
+varying vec3 normal;
+uniform mat4 HG_ModelMatrix;
+
+void main()
+{
+ gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_Position = ftransform();
+
+ vec4 n = vec4(gl_Normal, 0);
+
+ //normalize in fragment
+ normal = (HG_ModelMatrix * n).xyz;
+}
Added: Mercury2/Themes/default/Model/beerhall.hgmdl
===================================================================
(Binary files differ)
Property changes on: Mercury2/Themes/default/Model/beerhall.hgmdl
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/Themes/default/Model/gunther.hgmdl
===================================================================
(Binary files differ)
Property changes on: Mercury2/Themes/default/Model/gunther.hgmdl
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/Themes/default/Model/gunther.png
===================================================================
(Binary files differ)
Property changes on: Mercury2/Themes/default/Model/gunther.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/Themes/default/Model/lamp.hgmdl
===================================================================
(Binary files differ)
Property changes on: Mercury2/Themes/default/Model/lamp.hgmdl
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/Themes/default/Model/lamp.png
===================================================================
(Binary files differ)
Property changes on: Mercury2/Themes/default/Model/lamp.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/Themes/default/Model/lampN.hgmdl
===================================================================
(Binary files differ)
Property changes on: Mercury2/Themes/default/Model/lampN.hgmdl
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/Themes/default/Model/map.hgmdl
===================================================================
(Binary files differ)
Property changes on: Mercury2/Themes/default/Model/map.hgmdl
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/Themes/default/Model/map.png
===================================================================
(Binary files differ)
Property changes on: Mercury2/Themes/default/Model/map.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: Mercury2/beerhall.hgmdl
===================================================================
(Binary files differ)
Deleted: Mercury2/flame.png
===================================================================
(Binary files differ)
Deleted: Mercury2/lamp.hgmdl
===================================================================
(Binary files differ)
Deleted: Mercury2/lamp.png
===================================================================
(Binary files differ)
Deleted: Mercury2/lampN.hgmdl
===================================================================
(Binary files differ)
Deleted: Mercury2/map.hgmdl
===================================================================
(Binary files differ)
Deleted: Mercury2/map.png
===================================================================
(Binary files differ)
Deleted: Mercury2/scenegraph.xml
===================================================================
--- Mercury2/scenegraph.xml 2009-06-30 03:01:02 UTC (rev 395)
+++ Mercury2/scenegraph.xml 2009-07-01 17:27:00 UTC (rev 396)
@@ -1,50 +0,0 @@
-<SceneGraph name="root">
-<!-- <node type="cameranode" movx="6" movz="-5.5" movy="3" rotx="-45" roty="90">
- <node type="viewport" fov="45" aspect="1.3333" near="0.01" far="100"/>
- </node>
--->
- <node type="cameranode" movx="0" movz="0" movy="0" rotx="0" roty="0" rotz="0" name="camera">
- <node type="viewport" fov="45" aspect="1.3333" near="0.01" far="100" name="vp"/>
- </node>
-
- <node type="transformnode" movz="-5" >
- <node type="TextNode" text="test font 123 HELLO WORLD!!! WOOT!" font="testfont.hgfont" size=".01" width="300" alphaPath="true" alignment="FIT_FULL" />
- </node>
-<!-- <asset type="texture" file="screenFBO_0" dynamic="true"/>
- <asset type="fullscreenquad"/>
- <node type="mercuryfbo" width="640" height="480" depth="true" tnum="2" name="screenFBO" usescreensize="true">
- <asset type="shader" file="testShader"/>
---> <node type="transformnode" rotx="-90" movz="-10" movx="0" movy="-5">
- <asset type="texture" file="map.png"/>
- <asset type="hgmdlmodel" file="map.hgmdl" />
- </node>
- <node type="mercurynode" name="lampForest" >
- <node type="transformnode" movz="-5" movx="0" movy="0" name="lamprow" >
- <node type="mercurynode" name="lamp">
- <node type="transformnode" rotx="-90" >
- <asset type="texture" file="lamp.png"/>
- <asset type="hgmdlmodel" file="lampN.hgmdl" />
- </node>
- <node type="billboardnode" billboardaxis="0,1,0" spheremode="true" >
- <node type="transformnode" roty="180" scalex="0.1" scaley="0.1" alphaPath="true">
- <asset type="texture" file="flame.png"/>
- <asset type="quad"/>
- </node>
- </node>
- </node>
- <node type="transformnode" movx="1" fallback="lamprow.lamp" />
- <node type="transformnode" movx="2" fallback="lamprow.lamp" />
- <node type="transformnode" movx="3" fallback="lamprow.lamp" />
- <node type="transformnode" movx="-1" fallback="lamprow.lamp" />
- <node type="transformnode" movx="-2" fallback="lamprow.lamp" />
- <node type="transformnode" movx="-3" fallback="lamprow.lamp" />
- </node>
- <node type="transformnode" movz="-6" fallback="lampForest.lamprow"/>
- <node type="transformnode" movz="-7" fallback="lampForest.lamprow"/>
- <node type="transformnode" movz="-8" fallback="lampForest.lamprow"/>
- <node type="transformnode" movz="-9" fallback="lampForest.lamprow"/>
- <node type="transformnode" movz="-4" fallback="lampForest.lamprow"/>
- <node type="transformnode" movz="-3" fallback="lampForest.lamprow"/>
- </node>
-<!-- </node> -->
-</SceneGraph>
Modified: Mercury2/src/Mercury2.cpp
===================================================================
--- Mercury2/src/Mercury2.cpp 2009-06-30 03:01:02 UTC (rev 395)
+++ Mercury2/src/Mercury2.cpp 2009-07-01 17:27:00 UTC (rev 396)
@@ -17,7 +17,7 @@
#include <Texture.h>
#include <GLHeaders.h>
#include <ModuleManager.h>
-
+#include <MercuryFile.h>
bool SHOWBOUNDINGVOLUME = false;
MSemaphore UpdateLoopGo;
@@ -57,7 +57,7 @@
MercuryNode* root = new MercuryNode();
- XMLDocument* doc = XMLDocument::Load("scenegraph.xml");
+ XMLDocument* doc = XMLDocument::Load("FILE:scenegraph.xml");
XMLNode r = doc->GetRootNode();
root->LoadFromXML( r );
Modified: Mercury2/src/MercuryFile.cpp
===================================================================
--- Mercury2/src/MercuryFile.cpp 2009-06-30 03:01:02 UTC (rev 395)
+++ Mercury2/src/MercuryFile.cpp 2009-07-01 17:27:00 UTC (rev 396)
@@ -1,10 +1,11 @@
#include "MercuryFile.h"
-#include <MercuryVector.h>
-#include <MercuryFileDriverDirect.h>
-#include <MercuryFileDriverNet.h>
-#include <MercuryFileDriverMem.h>
-#include <MercuryFileDriverZipped.h>
-#include <MercuryFileDriverPacked.h>
+#include "MercuryVector.h"
+#include "MercuryFileDriverDirect.h"
+#include "MercuryFileDriverNet.h"
+#include "MercuryFileDriverMem.h"
+#include "MercuryFileDriverZipped.h"
+#include "MercuryFileDriverPacked.h"
+#include "MercuryTheme.h"
/********************FILE MANAGER**************************/
@@ -50,19 +51,27 @@
if( sPath.empty() )
return NULL;
-//XXX !!! XXX NOTE TODO
-//This code below is very useful, but cannot be implemented until we get a theme system. Once then, we can give it a shot.
+ //Tricky: We can support all caps colon (GRAPHIC:, FILE:, etc.)
+ //So, instead of doing some checking in multiple passes, we are doing
+ //a generalized system to handle getting it.
+ {
+ const char * c;
+ for( c = sPath.c_str(); (*c <= 'Z' && *c >= 'A'); c++ );
+ if( *c == ':' )
+ {
+ c++;
+ MString ExtString = ToProper( MString( sPath.c_str(), c-sPath.c_str()-1 ) ) + "/" + c;
+ const MVector< MercuryThemeManager::Theme > & th = THEME.GetThemes();
+ for( int i = (int)th.size()-1; i >= 0; i-- )
+ {
+ MercuryFile * ret = FILEMAN.Open( ssprintf( "Themes/%s/%s", th[i].sTheme.c_str(),ExtString.c_str() ), p );
+ if( ret )
+ return ret;
+ }
+ return 0;
+ }
+ }
-//First check to see if we are using an associated FS
-//Currently these are only theme supported.
-// if ( sPath.find( "GRAPHIC:" ) == 0 )
-// return Open( THEME.GetPathToGraphic( sPath.substr( 8 ) ), p );
-// if ( sPath.find( "MODEL:" ) == 0 )
-// return Open( THEME.GetPathToModel( sPath.substr( 6 ) ), p );
-// if ( sPath.find( "FILE:" ) == 0 )
-// return Open( THEME.GetPathToFile( sPath.substr( 5 ) ), p );
-
-
MercuryFile * ret;
for ( unsigned int i = 0; i < m_Drivers->size(); i++ )
{
@@ -139,7 +148,7 @@
/*
- * Copyright (c) 2005-2006, Charles Lohr
+ * Copyright (c) 2005-2009, Charles Lohr
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or
Modified: Mercury2/src/MercuryTheme.cpp
===================================================================
--- Mercury2/src/MercuryTheme.cpp 2009-06-30 03:01:02 UTC (rev 395)
+++ Mercury2/src/MercuryTheme.cpp 2009-07-01 17:27:00 UTC (rev 396)
@@ -41,9 +41,34 @@
bool MercuryThemeManager::GetValue( const MString & sDataPointer, MString & sReturn )
{
- //XXX: Incomplete
- //This code needs to be filled out.
- return true;
+ MString * cacheret;
+ if( (cacheret = m_hCache.get( sDataPointer ) ) != 0 )
+ {
+ sReturn = *cacheret;
+ return true;
+ }
+
+ MVector< MString > out;
+ SplitStrings( sDataPointer, out, ".", " ", 1, 1 );
+
+ for( unsigned i = out.size() - 1; i > 0; i-- )
+ {
+ MString sOut;
+ for( int j = 0; j < (int)i; j++ )
+ sOut += out[j] + '.';
+ sOut += out[out.size()-1];
+
+ for( int j = (int)m_vThemes.size() - 1; j >= 0; j-- )
+ {
+ if( m_vThemes[j].m_xNode->GetValue( sOut, sReturn ) )
+ {
+ m_hCache[sDataPointer] = sReturn;
+ return true;
+ }
+ }
+ }
+
+ return false;
}
MercuryThemeManager::Theme::Theme()
Modified: Mercury2/src/MercuryTheme.h
===================================================================
--- Mercury2/src/MercuryTheme.h 2009-06-30 03:01:02 UTC (rev 395)
+++ Mercury2/src/MercuryTheme.h 2009-07-01 17:27:00 UTC (rev 396)
@@ -3,6 +3,7 @@
#include <MercuryNamedResource.h>
#include <MercuryUtil.h> //huh?
+#include <MercuryHash.h>
#include <MercuryVector.h>
class XMLNode;
@@ -13,11 +14,7 @@
public:
MercuryThemeManager();
~MercuryThemeManager();
-
- static MercuryThemeManager& GetInstance();
- virtual bool GetValue( const MString & sDataPointer, MString & sReturn );
-private:
class Theme
{
public:
@@ -28,12 +25,19 @@
XMLNode * m_xNode;
XMLDocument * m_xDoc;
};
+
+ static MercuryThemeManager& GetInstance();
+
+ virtual bool GetValue( const MString & sDataPointer, MString & sReturn );
+ const MVector< Theme > & GetThemes() { return m_vThemes; }
+private:
MVector< Theme > m_vThemes;
+ MHash< MString > m_hCache;
};
-static InstanceCounter<MercuryThemeManager> MFMcounter("MercuryThemeManager");
+static InstanceCounter<MercuryThemeManager> MTMcounter("MercuryThemeManager");
-#define THEME MercuryFileManager::GetInstance()
+#define THEME MercuryThemeManager::GetInstance()
#endif
Modified: Mercury2/src/MercuryUtil.cpp
===================================================================
--- Mercury2/src/MercuryUtil.cpp 2009-06-30 03:01:02 UTC (rev 395)
+++ Mercury2/src/MercuryUtil.cpp 2009-07-01 17:27:00 UTC (rev 396)
@@ -15,6 +15,40 @@
return t;
}
+MString ToLower(const MString & s)
+{
+ MString t = s;
+ char * ti = (char*)t.c_str();
+ for (unsigned long i = 0; i < s.length(); ++i)
+ {
+ if( ti[i] >= 'A' && ti[i] <= 'Z' )
+ ti[i] += ( 'a' - 'A' );
+ }
+ return t;
+}
+
+MString ToProper(const MString & s)
+{
+ if( s.length() == 0 )
+ return "";
+
+ MString t = s;
+ char * ti = (char*)t.c_str();
+
+ if( ti[0] >= 'a' && ti[0] <= 'z' )
+ ti[0] -= ( 'a' - 'A' );
+
+ for (unsigned long i = 1; i < s.length(); ++i)
+ {
+ if( ti[i] >= 'A' && ti[i] <= 'Z' )
+ ti[i] += ( 'a' - 'A' );
+ }
+ return t;
+
+}
+
+
+
float StrToFloat(const MString & s, float d)
{
float x = d;
Modified: Mercury2/src/MercuryUtil.h
===================================================================
--- Mercury2/src/MercuryUtil.h 2009-06-30 03:01:02 UTC (rev 395)
+++ Mercury2/src/MercuryUtil.h 2009-07-01 17:27:00 UTC (rev 396)
@@ -25,8 +25,15 @@
#define M_ALIGN(n)
#endif
+///Make a string all upper case
MString ToUpper(const MString & s);
+///Make a string all lower case
+MString ToLower(const MString & s);
+
+///Make a string proper case (HELLO -> Hello, hello -> Hello)
+MString ToProper(const MString & s);
+
float StrToFloat(const MString & s, float d = 0);
int32_t StrToInt(const MString & s, int32_t d = 0);
Deleted: Mercury2/test.bmp
===================================================================
(Binary files differ)
Deleted: Mercury2/test2.bmp
===================================================================
(Binary files differ)
Deleted: Mercury2/test2.png
===================================================================
(Binary files differ)
Deleted: Mercury2/testShader.frag
===================================================================
--- Mercury2/testShader.frag 2009-06-30 03:01:02 UTC (rev 395)
+++ Mercury2/testShader.frag 2009-07-01 17:27:00 UTC (rev 396)
@@ -1,9 +0,0 @@
-uniform sampler2D HG_Texture0;
-varying vec3 normal;
-
-void main()
-{
-// gl_FragData[0] = texture2D(HG_Texture0, gl_TexCoord[0].st);
- vec3 n = normalize(normal);
- gl_FragData[0].rgb = 0.5 + 0.5 * n;
-}
Deleted: Mercury2/testShader.vert
===================================================================
--- Mercury2/testShader.vert 2009-06-30 03:01:02 UTC (rev 395)
+++ Mercury2/testShader.vert 2009-07-01 17:27:00 UTC (rev 396)
@@ -1,13 +0,0 @@
-varying vec3 normal;
-uniform mat4 HG_ModelMatrix;
-
-void main()
-{
- gl_TexCoord[0] = gl_MultiTexCoord0;
- gl_Position = ftransform();
-
- vec4 n = vec4(gl_Normal, 0);
-
- //normalize in fragment
- normal = (HG_ModelMatrix * n).xyz;
-}
Deleted: Mercury2/testfont.hgfont
===================================================================
--- Mercury2/testfont.hgfont 2009-06-30 03:01:02 UTC (rev 395)
+++ Mercury2/testfont.hgfont 2009-07-01 17:27:00 UTC (rev 396)
@@ -1,258 +0,0 @@
-testfont.png
-64 4.000000 15.000000 80.000000
-0 0.000000 0.000000 0.031250 0.040039 32 41 8 41
-1 0.062500 0.000000 0.093750 0.040039 32 41 8 41
-2 0.125000 0.000000 0.156250 0.040039 32 41 8 41
-3 0.187500 0.000000 0.218750 0.040039 32 41 8 41
-4 0.250000 0.000000 0.281250 0.040039 32 41 8 41
-5 0.312500 0.000000 0.343750 0.040039 32 41 8 41
-6 0.375000 0.000000 0.406250 0.040039 32 41 8 41
-7 0.437500 0.000000 0.468750 0.040039 32 41 8 41
-8 0.500000 0.000000 0.531250 0.040039 32 41 8 41
-9 0.562500 0.000000 0.593750 0.040039 32 41 8 41
-10 0.625000 0.000000 0.656250 0.040039 32 41 8 41
-11 0.687500 0.000000 0.718750 0.040039 32 41 8 41
-12 0.750000 0.000000 0.781250 0.040039 32 41 8 41
-13 0.812500 0.000000 0.843750 0.040039 32 41 8 41
-14 0.875000 0.000000 0.906250 0.040039 32 41 8 41
-15 0.937500 0.000000 0.968750 0.040039 32 41 8 41
-16 0.000000 0.062500 0.031250 0.102539 32 41 8 41
-17 0.062500 0.062500 0.093750 0.102539 32 41 8 41
-18 0.125000 0.062500 0.156250 0.102539 32 41 8 41
-19 0.187500 0.062500 0.218750 0.102539 32 41 8 41
-20 0.250000 0.062500 0.281250 0.102539 32 41 8 41
-21 0.312500 0.062500 0.343750 0.102539 32 41 8 41
-22 0.375000 0.062500 0.406250 0.102539 32 41 8 41
-23 0.437500 0.062500 0.468750 0.102539 32 41 8 41
-24 0.500000 0.062500 0.531250 0.102539 32 41 8 41
-25 0.562500 0.062500 0.593750 0.102539 32 41 8 41
-26 0.625000 0.062500 0.656250 0.102539 32 41 8 41
-27 0.687500 0.062500 0.718750 0.102539 32 41 8 41
-28 0.750000 0.062500 0.781250 0.102539 32 41 8 41
-29 0.812500 0.062500 0.843750 0.102539 32 41 8 41
-30 0.875000 0.062500 0.906250 0.102539 32 41 8 41
-31 0.937500 0.062500 0.968750 0.102539 32 41 8 41
-32 0.000000 0.125000 0.000000 0.125000 0 0 0 0
-33 0.062500 0.125000 0.068359 0.169922 6 46 7 46
-34 0.125000 0.125000 0.141602 0.140625 17 16 3 46
-35 0.187500 0.125000 0.221680 0.169922 35 46 0 46
-36 0.250000 0.125000 0.279297 0.178711 30 55 3 48
-37 0.312500 0.125000 0.360352 0.171875 49 48 4 47
-38 0.375000 0.125000 0.413086 0.171875 39 48 3 47
-39 0.437500 0.125000 0.443359 0.140625 6 16 3 46
-40 0.500000 0.125000 0.515625 0.182617 16 59 4 46
-41 0.562500 0.125000 0.578125 0.182617 16 59 1 46
-42 0.625000 0.125000 0.645508 0.143555 21 19 2 46
-43 0.687500 0.125000 0.717773 0.155273 31 31 3 38
-44 0.750000 0.125000 0.755859 0.139648 6 15 6 6
-45 0.812500 0.125000 0.829102 0.129883 17 5 2 19
-46 0.875000 0.125000 0.880859 0.130859 6 6 6 6
-47 0.937500 0.125000 0.956055 0.169922 19 46 0 46
-48 0.000000 0.187500 0.029297 0.233398 30 47 3 46
-49 0.062500 0.187500 0.079102 0.232422 17 46 7 46
-50 0.125000 0.187500 0.155273 0.232422 31 46 1 46
-51 0.187500 0.187500 0.216797 0.233398 30 47 3 46
-52 0.250000 0.187500 0.281250 0.231445 32 45 1 45
-53 0.312500 0.187500 0.341797 0.232422 30 46 3 45
-54 0.375000 0.187500 0.405273 0.233398 31 47 2 46
-55 0.437500 0.187500 0.466797 0.231445 30 45 3 45
-56 0.500000 0.187500 0.529297 0.233398 30 47 3 46
-57 0.562500 0.187500 0.591797 0.233398 30 47 3 46
-58 0.625000 0.187500 0.630859 0.220703 6 34 6 34
-59 0.687500 0.187500 0.693359 0.229492 6 43 6 34
-60 0.750000 0.187500 0.778320 0.217773 29 31 4 38
-61 0.812500 0.187500 0.841797 0.206055 30 19 3 32
-62 0.875000 0.187500 0.903320 0.217773 29 31 4 38
-63 0.937500 0.187500 0.966797 0.233398 30 47 3 47
-64 0.000000 0.250000 0.057617 0.308594 59 60 3 47
-65 0.062500 0.250000 0.106445 0.294922 45 46 -1 46
-66 0.125000 0.250000 0.159180 0.294922 35 46 5 46
-67 0.187500 0.250000 0.226562 0.296875 40 48 3 47
-68 0.250000 0.250000 0.287109 0.294922 38 46 5 46
-69 0.312500 0.250000 0.346680 0.294922 35 46 5 46
-70 0.375000 0.250000 0.405273 0.294922 31 46 5 46
-71 0.437500 0.250000 0.479492 0.296875 43 48 3 47
-72 0.500000 0.250000 0.535156 0.294922 36 46 5 46
-73 0.562500 0.250000 0.568359 0.294922 6 46 6 46
-74 0.625000 0.250000 0.650391 0.295898 26 47 1 46
-75 0.687500 0.250000 0.724609 0.294922 38 46 5 46
-76 0.750000 0.250000 0.778320 0.294922 29 46 5 46
-77 0.812500 0.250000 0.854492 0.294922 43 46 5 46
-78 0.875000 0.250000 0.910156 0.294922 36 46 5 46
-79 0.937500 0.250000 0.980469 0.296875 44 48 3 47
-80 0.000000 0.312500 0.034180 0.357422 35 46 5 46
-81 0.062500 0.312500 0.105469 0.362305 44 51 3 47
-82 0.125000 0.312500 0.164062 0.357422 40 46 5 46
-83 0.187500 0.312500 0.223633 0.359375 37 48 3 47
-84 0.250000 0.312500 0.285156 0.357422 36 46 2 46
-85 0.312500 0.312500 0.347656 0.358398 36 47 5 46
-86 0.375000 0.312500 0.418945 0.357422 45 46 -1 46
-87 0.437500 0.312500 0.499023 0.357422 63 46 0 46
-88 0.500000 0.312500 0.540039 0.357422 41 46 -1 46
-89 0.562500 0.312500 0.603516 0.357422 42 46 0 46
-90 0.625000 0.312500 0.660156 0.357422 36 46 1 46
-91 0.687500 0.312500 0.699219 0.370117 12 59 4 46
-92 0.750000 0.312500 0.768555 0.357422 19 46 -1 46
-93 0.812500 0.312500 0.824219 0.370117 12 59 2 46
-94 0.875000 0.312500 0.899414 0.336914 25 25 1 47
-95 0.937500 0.312500 0.973633 0.317383 37 5 -1 -8
-96 0.000000 0.375000 0.010742 0.383789 11 9 3 46
-97 0.062500 0.375000 0.091797 0.410156 30 36 3 35
-98 0.125000 0.375000 0.153320 0.420898 29 47 4 46
-99 0.187500 0.375000 0.215820 0.410156 29 36 3 35
-100 0.250000 0.375000 0.278320 0.420898 29 47 2 46
-101 0.312500 0.375000 0.342773 0.410156 31 36 2 35
-102 0.375000 0.375000 0.394531 0.420898 20 47 1 47
-103 0.437500 0.375000 0.465820 0.422852 29 49 2 35
-104 0.500000 0.375000 0.527344 0.419922 28 46 4 46
-105 0.562500 0.375000 0.568359 0.419922 6 46 4 46
-106 0.625000 0.375000 0.637695 0.433594 13 60 -3 46
-107 0.687500 0.375000 0.714844 0.419922 28 46 4 46
-108 0.750000 0.375000 0.755859 0.419922 6 46 4 46
-109 0.812500 0.375000 0.857422 0.409180 46 35 4 35
-110 0.875000 0.375000 0.902344 0.409180 28 35 4 35
-111 0.937500 0.375000 0.966797 0.410156 30 36 3 35
-112 0.000000 0.437500 0.028320 0.484375 29 48 4 35
-113 0.062500 0.437500 0.090820 0.484375 29 48 2 35
-114 0.125000 0.437500 0.142578 0.471680 18 35 4 35
-115 0.187500 0.437500 0.213867 0.472656 27 36 2 35
-116 0.250000 0.437500 0.265625 0.483398 16 47 1 46
-117 0.312500 0.437500 0.339844 0.471680 28 35 4 34
-118 0.375000 0.437500 0.405273 0.470703 31 34 1 34
-119 0.437500 0.437500 0.485352 0.470703 49 34 -1 34
-120 0.500000 0.437500 0.531250 0.470703 32 34 0 34
-121 0.562500 0.437500 0.593750 0.484375 32 48 0 34
-122 0.625000 0.437500 0.653320 0.470703 29 34 1 34
-123 0.687500 0.437500 0.705078 0.497070 18 61 1 47
-124 0.750000 0.437500 0.754883 0.496094 5 60 6 46
-125 0.812500 0.437500 0.830078 0.497070 18 61 2 47
-126 0.875000 0.437500 0.906250 0.448242 32 11 2 28
-127 0.937500 0.437500 0.968750 0.477539 32 41 8 41
-128 0.000000 0.500000 0.031250 0.540039 32 41 8 41
-129 0.062500 0.500000 0.093750 0.540039 32 41 8 41
-130 0.125000 0.500000 0.156250 0.540039 32 41 8 41
-131 0.187500 0.500000 0.218750 0.540039 32 41 8 41
-132 0.250000 0.500000 0.281250 0.540039 32 41 8 41
-133 0.312500 0.500000 0.343750 0.540039 32 41 8 41
-134 0.375000 0.500000 0.406250 0.540039 32 41 8 41
-135 0.437500 0.500000 0.468750 0.540039 32 41 8 41
-136 0.500000 0.500000 0.531250 0.540039 32 41 8 41
-137 0.562500 0.500000 0.593750 0.540039 32 41 8 41
-138 0.625000 0.500000 0.656250 0.540039 32 41 8 41
-139 0.687500 0.500000 0.718750 0.540039 32 41 8 41
-140 0.750000 0.500000 0.781250 0.540039 32 41 8 41
-141 0.812500 0.500000 0.843750 0.540039 32 41 8 41
-142 0.875000 0.500000 0.906250 0.540039 32 41 8 41
-143 0.937500 0.500000 0.968750 0.540039 32 41 8 41
-144 0.000000 0.562500 0.031250 0.602539 32 41 8 41
-145 0.062500 0.562500 0.093750 0.602539 32 41 8 41
-146 0.125000 0.562500 0.156250 0.602539 32 41 8 41
-147 0.187500 0.562500 0.218750 0.602539 32 41 8 41
-148 0.250000 0.562500 0.281250 0.602539 32 41 8 41
-149 0.312500 0.562500 0.343750 0.602539 32 41 8 41
-150 0.375000 0.562500 0.406250 0.602539 32 41 8 41
-151 0.437500 0.562500 0.468750 0.602539 32 41 8 41
-152 0.500000 0.562500 0.531250 0.602539 32 41 8 41
-153 0.562500 0.562500 0.593750 0.602539 32 41 8 41
-154 0.625000 0.562500 0.656250 0.602539 32 41 8 41
-155 0.687500 0.562500 0.718750 0.602539 32 41 8 41
-156 0.750000 0.562500 0.781250 0.602539 32 41 8 41
-157 0.812500 0.562500 0.843750 0.602539 32 41 8 41
-158 0.875000 0.562500 0.906250 0.602539 32 41 8 41
-159 0.937500 0.562500 0.968750 0.602539 32 41 8 41
-160 0.000000 0.625000 0.000000 0.625000 0 0 0 0
-161 0.062500 0.625000 0.068359 0.670898 6 47 7 34
-162 0.125000 0.625000 0.153320 0.682617 29 59 3 46
-163 0.187500 0.625000 0.219727 0.671875 33 48 1 47
-164 0.250000 0.625000 0.281250 0.652344 32 28 1 36
-165 0.312500 0.625000 0.346680 0.669922 35 46 -1 46
-166 0.375000 0.625000 0.379883 0.683594 5 60 6 46
-167 0.437500 0.625000 0.466797 0.683594 30 60 3 47
-168 0.500000 0.625000 0.517578 0.630859 18 6 2 46
-169 0.562500 0.625000 0.608398 0.671875 47 48 0 47
-170 0.625000 0.625000 0.646484 0.647461 22 23 1 47
-171 0.687500 0.625000 0.713867 0.653320 27 29 4 31
-172 0.750000 0.625000 0.779297 0.643555 30 19 3 32
-173 0.812500 0.625000 0.829102 0.629883 17 5 2 19
-174 0.875000 0.625000 0.920898 0.671875 47 48 0 47
-175 0.937500 0.625000 0.973633 0.629883 37 5 -1 54
-176 0.000000 0.687500 0.016602 0.704102 17 17 4 47
-177 0.062500 0.687500 0.092773 0.724609 31 38 2 38
-178 0.125000 0.687500 0.143555 0.709961 19 23 1 47
-179 0.187500 0.687500 0.206055 0.709961 19 23 1 47
-180 0.250000 0.687500 0.260742 0.696289 11 9 7 45
-181 0.312500 0.687500 0.338867 0.733398 27 47 5 34
-182 0.375000 0.687500 0.408203 0.745117 34 59 0 46
-183 0.437500 0.687500 0.443359 0.693359 6 6 6 25
-184 0.500000 0.687500 0.512695 0.701172 13 14 3 0
-185 0.562500 0.687500 0.574219 0.709961 12 23 4 47
-186 0.625000 0.687500 0.645508 0.709961 21 23 1 47
-187 0.687500 0.687500 0.713867 0.715820 27 29 5 31
-188 0.750000 0.687500 0.796875 0.735352 48 49 4 47
-189 0.812500 0.687500 0.859375 0.734375 48 48 4 47
-190 0.875000 0.687500 0.924805 0.735352 51 49 1 47
-191 0.937500 0.687500 0.965820 0.734375 29 48 5 34
-192 0.000000 0.750000 0.043945 0.806641 45 58 -1 58
-193 0.062500 0.750000 0.106445 0.806641 45 58 -1 58
-194 0.125000 0.750000 0.168945 0.806641 45 58 -1 58
-195 0.187500 0.750000 0.231445 0.805664 45 57 -1 57
-196 0.250000 0.750000 0.293945 0.803711 45 55 -1 55
-197 0.312500 0.750000 0.356445 0.803711 45 55 -1 55
-198 0.375000 0.750000 0.435547 0.794922 62 46 -1 46
-199 0.437500 0.750000 0.476562 0.809570 40 61 3 47
-200 0.500000 0.750000 0.534180 0.806641 35 58 5 58
-201 0.562500 0.750000 0.596680 0.806641 35 58 5 58
-202 0.625000 0.750000 0.659180 0.806641 35 58 5 58
-203 0.687500 0.750000 0.721680 0.803711 35 55 5 55
-204 0.750000 0.750000 0.760742 0.806641 11 58 2 58
-205 0.812500 0.750000 0.823242 0.806641 11 58 5 58
-206 0.875000 0.750000 0.894531 0.806641 20 58 -1 58
-207 0.937500 0.750000 0.955078 0.803711 18 55 0 55
-208 0.000000 0.812500 0.041992 0.857422 43 46 0 46
-209 0.062500 0.812500 0.097656 0.868164 36 57 5 57
-210 0.125000 0.812500 0.167969 0.870117 44 59 3 58
-211 0.187500 0.812500 0.230469 0.870117 44 59 3 58
-212 0.250000 0.812500 0.292969 0.870117 44 59 3 58
-213 0.312500 0.812500 0.355469 0.869141 44 58 3 57
-214 0.375000 0.812500 0.417969 0.867188 44 56 3 55
-215 0.437500 0.812500 0.463867 0.838867 27 27 5 36
-216 0.500000 0.812500 0.543945 0.861328 45 50 3 47
-217 0.562500 0.812500 0.597656 0.870117 36 59 5 58
-218 0.625000 0.812500 0.660156 0.870117 36 59 5 58
-219 0.687500 0.812500 0.722656 0.870117 36 59 5 58
-220 0.750000 0.812500 0.785156 0.867188 36 56 5 55
-221 0.812500 0.812500 0.853516 0.869141 42 58 0 58
-222 0.875000 0.812500 0.909180 0.857422 35 46 5 46
-223 0.937500 0.812500 0.968750 0.859375 32 48 5 47
-224 0.000000 0.875000 0.029297 0.920898 30 47 3 46
-225 0.062500 0.875000 0.091797 0.920898 30 47 3 46
-226 0.125000 0.875000 0.154297 0.920898 30 47 3 46
-227 0.187500 0.875000 0.216797 0.919922 30 46 3 45
-228 0.250000 0.875000 0.279297 0.917969 30 44 3 43
-229 0.312500 0.875000 0.341797 0.922852 30 49 3 48
-230 0.375000 0.875000 0.425781 0.910156 52 36 2 35
-231 0.437500 0.875000 0.465820 0.922852 29 49 3 35
-232 0.500000 0.875000 0.530273 0.920898 31 47 2 46
-233 0.562500 0.875000 0.592773 0.920898 31 47 2 46
-234 0.625000 0.875000 0.655273 0.920898 31 47 2 46
-235 0.687500 0.875000 0.717773 0.917969 31 44 2 43
-236 0.750000 0.875000 0.760742 0.919922 11 46 2 46
-237 0.812500 0.875000 0.823242 0.919922 11 46 5 46
-238 0.875000 0.875000 0.894531 0.919922 20 46 -1 46
-239 0.937500 0.875000 0.955078 0.916992 18 43 0 43
-240 0.000000 0.937500 0.030273 0.983398 31 47 2 46
-241 0.062500 0.937500 0.089844 0.981445 28 45 4 45
-242 0.125000 0.937500 0.154297 0.983398 30 47 3 46
-243 0.187500 0.937500 0.216797 0.983398 30 47 3 46
-244 0.250000 0.937500 0.279297 0.983398 30 47 3 46
-245 0.312500 0.937500 0.341797 0.982422 30 46 3 45
-246 0.375000 0.937500 0.404297 0.980469 30 44 3 43
-247 0.437500 0.937500 0.468750 0.961914 32 25 3 35
-248 0.500000 0.937500 0.531250 0.977539 32 41 3 38
-249 0.562500 0.937500 0.589844 0.983398 28 47 4 46
-250 0.625000 0.937500 0.652344 0.983398 28 47 4 46
-251 0.687500 0.937500 0.714844 0.983398 28 47 4 46
-252 0.750000 0.937500 0.777344 0.980469 28 44 4 43
-253 0.812500 0.937500 0.843750 0.996094 32 60 0 46
-254 0.875000 0.937500 0.903320 0.995117 29 59 4 46
-255 0.937500 0.937500 0.968750 0.993164 32 57 0 43
Deleted: Mercury2/testfont.png
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2009-06-30 03:01:04
|
Revision: 395
http://hgengine.svn.sourceforge.net/hgengine/?rev=395&view=rev
Author: cnlohr
Date: 2009-06-30 03:01:02 +0000 (Tue, 30 Jun 2009)
Log Message:
-----------
add themes folder!
Added Paths:
-----------
Mercury2/Themes/
Mercury2/Themes/default/
Mercury2/Themes/default/metrics.xml
Added: Mercury2/Themes/default/metrics.xml
===================================================================
--- Mercury2/Themes/default/metrics.xml (rev 0)
+++ Mercury2/Themes/default/metrics.xml 2009-06-30 03:01:02 UTC (rev 395)
@@ -0,0 +1,3 @@
+<xml>
+ <test val="5" />
+</xml>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|