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: <axl...@us...> - 2009-03-02 20:00:26
|
Revision: 162
http://hgengine.svn.sourceforge.net/hgengine/?rev=162&view=rev
Author: axlecrusher
Date: 2009-03-02 20:00:18 +0000 (Mon, 02 Mar 2009)
Log Message:
-----------
update
Modified Paths:
--------------
Mercury2/scenegraph.xml
Mercury2/src/BoundingBox.cpp
Mercury2/src/MercuryMatrix.cpp
Mercury2/src/MercuryVertex.cpp
Mercury2/src/MercuryVertex.h
Modified: Mercury2/scenegraph.xml
===================================================================
--- Mercury2/scenegraph.xml 2009-03-02 19:51:29 UTC (rev 161)
+++ Mercury2/scenegraph.xml 2009-03-02 20:00:18 UTC (rev 162)
@@ -20,7 +20,7 @@
<asset type="quad"/>
</node>
</node>
- <node type="rotatornode" movy="0" movz="-2" scalex="0.25" scaley="0.25" scalez="0.25" >
+ <node type="rotatornode" movy="0" movz="-20" scalex="0.25" scaley="0.25" scalez="0.25" >
<node type="renderablenode">
<asset type="texture" file="gunther.png"/>
<asset type="hgmdlmodel" file="gunther.hgmdl"/>
Modified: Mercury2/src/BoundingBox.cpp
===================================================================
--- Mercury2/src/BoundingBox.cpp 2009-03-02 19:51:29 UTC (rev 161)
+++ Mercury2/src/BoundingBox.cpp 2009-03-02 20:00:18 UTC (rev 162)
@@ -22,7 +22,7 @@
MercuryVertex c = GetGlobalMatrix() * m_bb->GetCenter();
// GetGlobalMatrix().Print();
-// c.Print();
+ c.Print();
BoundingBox gbb( c, bb.GetExtend() );
Modified: Mercury2/src/MercuryMatrix.cpp
===================================================================
--- Mercury2/src/MercuryMatrix.cpp 2009-03-02 19:51:29 UTC (rev 161)
+++ Mercury2/src/MercuryMatrix.cpp 2009-03-02 20:00:18 UTC (rev 162)
@@ -203,7 +203,6 @@
Float2FloatRow( tmp, &r );
VectorMultiply4f( m_matrix, &r, &tvo);
FloatRow2Float( &tvo, tmp );
- MercuryVertex(tmp).Print();
return MercuryVertex(tmp);
}
Modified: Mercury2/src/MercuryVertex.cpp
===================================================================
--- Mercury2/src/MercuryVertex.cpp 2009-03-02 19:51:29 UTC (rev 161)
+++ Mercury2/src/MercuryVertex.cpp 2009-03-02 20:00:18 UTC (rev 162)
@@ -20,6 +20,12 @@
m_xyz[i] = in[i];
}
+MercuryVertex::MercuryVertex( const MercuryVertex& v)
+{
+ for (unsigned int i = 0; i < 3; ++i)
+ m_xyz[i] = v.m_xyz[i];
+}
+
void MercuryVertex::NormalizeSelf()
{
float imag = 1.0f/Length();
Modified: Mercury2/src/MercuryVertex.h
===================================================================
--- Mercury2/src/MercuryVertex.h 2009-03-02 19:51:29 UTC (rev 161)
+++ Mercury2/src/MercuryVertex.h 2009-03-02 20:00:18 UTC (rev 162)
@@ -7,6 +7,7 @@
MercuryVertex();
MercuryVertex( float ix, float iy, float iz );
MercuryVertex( const float * in );
+ MercuryVertex( const MercuryVertex& v);
///Direct conversion to float*
operator float* () { return m_xyz; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-03-02 19:51:33
|
Revision: 161
http://hgengine.svn.sourceforge.net/hgengine/?rev=161&view=rev
Author: axlecrusher
Date: 2009-03-02 19:51:29 +0000 (Mon, 02 Mar 2009)
Log Message:
-----------
fix
Modified Paths:
--------------
Mercury2/src/MercuryMath.cpp
Modified: Mercury2/src/MercuryMath.cpp
===================================================================
--- Mercury2/src/MercuryMath.cpp 2009-03-02 19:46:08 UTC (rev 160)
+++ Mercury2/src/MercuryMath.cpp 2009-03-02 19:51:29 UTC (rev 161)
@@ -172,10 +172,11 @@
void Float2FloatRow(const float* f, FloatRow* r)
{
- *r[0] = f[0];
- *r[1] = f[1];
- *r[2] = f[2];
- *r[3] = f[3];
+ float* row = (float*)r;
+ row[0] = f[0];
+ row[1] = f[1];
+ row[2] = f[2];
+ row[3] = f[3];
}
void FloatRow2Float( const FloatRow* fr, float* f)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-03-02 19:46:14
|
Revision: 160
http://hgengine.svn.sourceforge.net/hgengine/?rev=160&view=rev
Author: axlecrusher
Date: 2009-03-02 19:46:08 +0000 (Mon, 02 Mar 2009)
Log Message:
-----------
update everything
Modified Paths:
--------------
Mercury2/mercury2.kdevelop
Mercury2/scenegraph.xml
Mercury2/src/BoundingBox.cpp
Mercury2/src/BoundingBox.h
Mercury2/src/MercuryAsset.cpp
Mercury2/src/MercuryAsset.h
Mercury2/src/MercuryMath.cpp
Mercury2/src/MercuryMath.h
Mercury2/src/MercuryMatrix.cpp
Mercury2/src/MercuryMatrix.h
Mercury2/src/RenderableNode.cpp
Mercury2/src/RenderableNode.h
Mercury2/src/Viewport.cpp
Mercury2/src/Viewport.h
Modified: Mercury2/mercury2.kdevelop
===================================================================
--- Mercury2/mercury2.kdevelop 2009-03-02 19:41:32 UTC (rev 159)
+++ Mercury2/mercury2.kdevelop 2009-03-02 19:46:08 UTC (rev 160)
@@ -26,8 +26,8 @@
<run>
<mainprogram>/home/josh/Mercury2/debug/src/mercury2</mainprogram>
<terminal>false</terminal>
- <programargs/>
- <globaldebugarguments/>
+ <programargs></programargs>
+ <globaldebugarguments></globaldebugarguments>
<globalcwd>/home/josh/Mercury2</globalcwd>
<useglobalprogram>true</useglobalprogram>
<autocompile>false</autocompile>
@@ -59,16 +59,16 @@
<ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevg77options</f77compiler>
- <cxxflags>-O2 -g -Wall</cxxflags>
+ <cxxflags>-O0 -g -Wall</cxxflags>
<envvars/>
- <topsourcedir/>
- <cppflags>-Isrc/ -I/usr/include/libxml2/ -DHGENGINE -DRUN_FROM_START_FOLDER -DUSE_SSE</cppflags>
+ <topsourcedir></topsourcedir>
+ <cppflags>-Isrc/ -I/usr/include/libxml2/ -DHGENGINE -DRUN_FROM_START_FOLDER</cppflags>
<ldflags>-lpthread -lX11 -lGL -lxml2 -lpng</ldflags>
- <ccompilerbinary/>
- <cxxcompilerbinary/>
- <f77compilerbinary/>
- <cflags>-O2 -g -Wall</cflags>
- <f77flags/>
+ <ccompilerbinary></ccompilerbinary>
+ <cxxcompilerbinary></cxxcompilerbinary>
+ <f77compilerbinary></f77compilerbinary>
+ <cflags>-O0 -g -Wall</cflags>
+ <f77flags></f77flags>
</debug>
<default>
<envvars/>
Modified: Mercury2/scenegraph.xml
===================================================================
--- Mercury2/scenegraph.xml 2009-03-02 19:41:32 UTC (rev 159)
+++ Mercury2/scenegraph.xml 2009-03-02 19:46:08 UTC (rev 160)
@@ -1,5 +1,5 @@
<SceneGraph>
- <node type="transformnode" movz="-1" roty="13">
+ <node type="transformnode" movz="0" roty="0">
<node type="viewport" fov="45" aspect="1.3333" near="0.01" far="100"/>
</node>
<node type="transformnode" movz="-3">
@@ -20,14 +20,8 @@
<asset type="quad"/>
</node>
</node>
- <node type="rotatornode" movz="-2" scalex="0.25" scaley="0.25" scalez="0.25" >
+ <node type="rotatornode" movy="0" movz="-2" scalex="0.25" scaley="0.25" scalez="0.25" >
<node type="renderablenode">
- <asset type="texture" file="test.bmp"/>
- <asset type="hgmdlmodel" file="beerhall.hgmdl"/>
- </node>
- </node>
- <node type="rotatornode" movz="-2" movx="2" scalex="0.25" scaley="0.25" scalez="0.25" >
- <node type="renderablenode">
<asset type="texture" file="gunther.png"/>
<asset type="hgmdlmodel" file="gunther.hgmdl"/>
</node>
Modified: Mercury2/src/BoundingBox.cpp
===================================================================
--- Mercury2/src/BoundingBox.cpp 2009-03-02 19:41:32 UTC (rev 159)
+++ Mercury2/src/BoundingBox.cpp 2009-03-02 19:46:08 UTC (rev 160)
@@ -2,6 +2,8 @@
#include <GL/glext.h>
#include <BoundingBox.h>
+#include <Viewport.h>
+
void BoundingBox::LoadFromBinary(char* data)
{
memcpy(m_center, data, sizeof(float)*3);
@@ -15,6 +17,17 @@
void RenderableBoundingBox::Render(MercuryNode* node)
{
+ const BoundingBox& bb = *m_bb;
+
+ MercuryVertex c = GetGlobalMatrix() * m_bb->GetCenter();
+
+// GetGlobalMatrix().Print();
+// c.Print();
+
+ BoundingBox gbb( c, bb.GetExtend() );
+
+// printf("clip %d\n", FRUSTUM->Clip(gbb) );
+
const float* center = m_bb->GetCenter();
const float* extend = m_bb->GetExtend();
Modified: Mercury2/src/BoundingBox.h
===================================================================
--- Mercury2/src/BoundingBox.h 2009-03-02 19:41:32 UTC (rev 159)
+++ Mercury2/src/BoundingBox.h 2009-03-02 19:46:08 UTC (rev 160)
@@ -2,16 +2,24 @@
#define BOUNDINGBOX_H
#include <MercuryAsset.h>
+#include <MercuryVertex.h>
class BoundingBox
{
public:
+ BoundingBox() {};
+ BoundingBox(const MercuryVertex& center, const MercuryVertex& extend)
+ :m_center(center), m_extend(extend)
+ {};
+
void LoadFromBinary(char* data);
- inline const float* GetCenter() const { return m_center; }
- inline const float* GetExtend() const { return m_extend; }
+
+ inline const MercuryVertex& GetCenter() const { return m_center; }
+ inline const MercuryVertex& GetExtend() const { return m_extend; }
+
private:
- float m_center[3];
- float m_extend[3];
+ MercuryVertex m_center;
+ MercuryVertex m_extend;
};
class RenderableBoundingBox : public MercuryAsset
Modified: Mercury2/src/MercuryAsset.cpp
===================================================================
--- Mercury2/src/MercuryAsset.cpp 2009-03-02 19:41:32 UTC (rev 159)
+++ Mercury2/src/MercuryAsset.cpp 2009-03-02 19:46:08 UTC (rev 160)
@@ -65,8 +65,14 @@
m_assetInstances.erase( asset );
printf("removed asset %s\n", key.c_str());
}
+
}
+const MercuryMatrix& MercuryAsset::GetGlobalMatrix() const
+{
+ return GLOBALMATRIX;
+}
+
std::map<MString, MercuryAsset*> AssetFactory::m_assetInstances;
/***************************************************************************
Modified: Mercury2/src/MercuryAsset.h
===================================================================
--- Mercury2/src/MercuryAsset.h 2009-03-02 19:41:32 UTC (rev 159)
+++ Mercury2/src/MercuryAsset.h 2009-03-02 19:46:08 UTC (rev 160)
@@ -5,6 +5,7 @@
#include <MercuryNode.h>
#include <MessageHandler.h>
#include <map>
+#include <MercuryMatrix.h>
class MercuryAsset : public RefBase, MessageHandler
{
@@ -22,6 +23,7 @@
virtual void LoadFromXML(const XMLNode& node) {};
inline void IsInstanced(bool b) { m_isInstanced = b; }
+ const MercuryMatrix& GetGlobalMatrix() const;
protected:
bool m_isInstanced;
};
Modified: Mercury2/src/MercuryMath.cpp
===================================================================
--- Mercury2/src/MercuryMath.cpp 2009-03-02 19:41:32 UTC (rev 159)
+++ Mercury2/src/MercuryMath.cpp 2009-03-02 19:46:08 UTC (rev 160)
@@ -170,6 +170,22 @@
out[3] = p[0] * m[12] + p[1] * m[13] + p[2] * m[14] + p[3] * m[15];
}
+void Float2FloatRow(const float* f, FloatRow* r)
+{
+ *r[0] = f[0];
+ *r[1] = f[1];
+ *r[2] = f[2];
+ *r[3] = f[3];
+}
+
+void FloatRow2Float( const FloatRow* fr, float* f)
+{
+ f[0] = (*fr)[0];
+ f[1] = (*fr)[1];
+ f[2] = (*fr)[2];
+ f[3] = (*fr)[3];
+}
+
#else
//inline __m128 Hadd4(__m128 x);
@@ -289,6 +305,16 @@
r = (FloatRow)_mm_setzero_ps();
}
+FloatRow Float2FloatRow(const float* f, , FloatRow* r)
+{
+ r = _mm_load_ps( f );
+}
+
+void FloatRow2Float( const FloatRow* fr, float* f)
+{
+ _mm_store_ps( f, *fr );
+}
+
#endif
/*
Modified: Mercury2/src/MercuryMath.h
===================================================================
--- Mercury2/src/MercuryMath.h 2009-03-02 19:41:32 UTC (rev 159)
+++ Mercury2/src/MercuryMath.h 2009-03-02 19:46:08 UTC (rev 160)
@@ -42,7 +42,7 @@
#define SQ(x) ((x)*(x));
-#define DotProduct(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2])
+//#define DotProduct(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2])
void Mul4f(const FloatRow* first, const FloatRow* second, FloatRow* out);
void Div4f(const FloatRow* first, const FloatRow* second, FloatRow* out);
@@ -55,6 +55,9 @@
void VectorMultiply4f(const FloatRow* matrix, const FloatRow* p, FloatRow* out );
void TransposeMatrix( FloatRow* m );
+void Float2FloatRow(const float* f, FloatRow* r);
+void FloatRow2Float( const FloatRow* fr, float* f);
+
const FloatRow gfrZero = { 0.f, 0.f, 0.f, 0.f };
#endif
Modified: Mercury2/src/MercuryMatrix.cpp
===================================================================
--- Mercury2/src/MercuryMatrix.cpp 2009-03-02 19:41:32 UTC (rev 159)
+++ Mercury2/src/MercuryMatrix.cpp 2009-03-02 19:46:08 UTC (rev 160)
@@ -39,27 +39,6 @@
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f };
Copy16f(&m_matrix[0], Identity );
-/*
- (*this)[0][0] = 1;
- (*this)[0][1] = 0;
- (*this)[0][2] = 0;
- (*this)[0][3] = 0;
-
- (*this)[1][0] = 0;
- (*this)[1][1] = 1;
- (*this)[1][2] = 0;
- (*this)[1][3] = 0;
-
- (*this)[2][0] = 0;
- (*this)[2][1] = 0;
- (*this)[2][2] = 1;
- (*this)[2][3] = 0;
-
- (*this)[3][0] = 0;
- (*this)[3][1] = 0;
- (*this)[3][2] = 0;
- (*this)[3][3] = 1;
- */
}
void MercuryMatrix::Translate(float x, float y, float z)
@@ -207,7 +186,7 @@
return *this;
}
-void MercuryMatrix::Print()
+void MercuryMatrix::Print() const
{
for (int i = 0; i < 4; ++i)
{
@@ -216,6 +195,19 @@
printf("\n");
}
+MercuryVector MercuryMatrix::operator*(const MercuryVector& v) const
+{
+ float tmp[4];
+ v.ConvertToVector4( tmp );
+ FloatRow r, tvo;
+ Float2FloatRow( tmp, &r );
+ VectorMultiply4f( m_matrix, &r, &tvo);
+ FloatRow2Float( &tvo, tmp );
+ MercuryVertex(tmp).Print();
+ return MercuryVertex(tmp);
+}
+
+
/*
* Copyright (c) 2006 Joshua Allen
* All rights reserved.
Modified: Mercury2/src/MercuryMatrix.h
===================================================================
--- Mercury2/src/MercuryMatrix.h 2009-03-02 19:41:32 UTC (rev 159)
+++ Mercury2/src/MercuryMatrix.h 2009-03-02 19:46:08 UTC (rev 160)
@@ -4,6 +4,7 @@
//This matrix will work identically to float[16]
#include "MercuryMath.h"
#include "MercuryUtil.h"
+#include <MercuryVertex.h>
class MercuryMatrix;
@@ -27,6 +28,8 @@
MercuryMatrix operator*(const MercuryMatrix& m) const;
MercuryMatrix& operator*=(const MercuryMatrix& m);
+
+ MercuryVector operator*(const MercuryVertex& v) const;
void Translate(float x, float y, float z);
///Rotate along the 3 primariy axes by given amounts (in deg)
@@ -40,7 +43,7 @@
void Zero();
void Identity();
- void Print();
+ void Print() const;
}
#if !defined( WIN32 ) || defined( _MSC_VER )
M_ALIGN(64);
Modified: Mercury2/src/RenderableNode.cpp
===================================================================
--- Mercury2/src/RenderableNode.cpp 2009-03-02 19:41:32 UTC (rev 159)
+++ Mercury2/src/RenderableNode.cpp 2009-03-02 19:46:08 UTC (rev 160)
@@ -10,6 +10,8 @@
uint64_t RenderWaited = 0;
uint64_t UpdateWaited = 0;
+MercuryMatrix GLOBALMATRIX;
+
RenderableNode::RenderableNode()
:m_hidden(false)
{
@@ -45,7 +47,7 @@
if (m_hidden || IsCulled()) return;
- MercuryMatrix m = FindGlobalMatrix();
+ MercuryMatrix m = GLOBALMATRIX = FindGlobalMatrix();
m.Transpose();
glLoadMatrixf( m.Ptr() );
Modified: Mercury2/src/RenderableNode.h
===================================================================
--- Mercury2/src/RenderableNode.h 2009-03-02 19:41:32 UTC (rev 159)
+++ Mercury2/src/RenderableNode.h 2009-03-02 19:46:08 UTC (rev 160)
@@ -11,6 +11,7 @@
extern uint64_t RenderWaited;
extern uint64_t UpdateWaited;
+extern MercuryMatrix GLOBALMATRIX;
class RenderableNode : public MercuryNode
{
Modified: Mercury2/src/Viewport.cpp
===================================================================
--- Mercury2/src/Viewport.cpp 2009-03-02 19:41:32 UTC (rev 159)
+++ Mercury2/src/Viewport.cpp 2009-03-02 19:46:08 UTC (rev 160)
@@ -3,15 +3,22 @@
REGISTER_NODE_TYPE(Viewport);
+const Frustum* FRUSTUM = NULL;
+
void Viewport::Render()
{
+ FRUSTUM = &m_frustum;
+
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
MercuryMatrix m = FindGlobalMatrix();
m.Transpose();
+
+ MercuryMatrix f = m_frustum.GetMatrix();
+ f.Transpose();
- glLoadMatrixf( (m * m_frustum.GetMatrix()).Ptr() );
+ glLoadMatrixf( (m * f).Ptr() );
//The following 2 are equivelent to above
// glLoadMatrixf( m_frustum.Ptr() );
// glMultMatrixf( m.Ptr() );
@@ -76,7 +83,7 @@
m_frustum[2][3] = D;
m_frustum[3][2] = -1;
- m_frustum.Transpose(); //XXX fix it to remove this
+// m_frustum.Transpose(); //XXX fix it to remove this
}
void Frustum::LookAt(const MercuryVertex& eye, const MercuryVector& look, const MercuryVector& up)
@@ -117,6 +124,17 @@
m_planes[PRIGHT].Setup(m_nc+X*m_nw,normal);
}
+bool Frustum::Clip(const BoundingBox& bb) const
+{
+ bool inView = false;
+ for (uint8_t i = 0; (i < 6) && !inView; ++i)
+ {
+ inView = m_planes[i].IsBehindPlane( bb )?inView:true;
+ }
+
+ return !inView;
+};
+
/*
void Frustum::LookAt()
{
Modified: Mercury2/src/Viewport.h
===================================================================
--- Mercury2/src/Viewport.h 2009-03-02 19:41:32 UTC (rev 159)
+++ Mercury2/src/Viewport.h 2009-03-02 19:46:08 UTC (rev 160)
@@ -6,17 +6,18 @@
#include <MercuryVertex.h>
#include <MercuryPlane.h>
+enum PlanePos
+{
+ PTOP = 0,
+ PBOTTOM,
+ PLEFT,
+ PRIGHT,
+ PNEAR,
+ PFAR
+};
+
class Frustum
{
- enum PlanePos
- {
- PTOP = 0,
- PBOTTOM,
- PLEFT,
- PRIGHT,
- PNEAR,
- PFAR
- };
public:
void SetPerspective( float fov, float aspect, float znear, float zfar );
@@ -24,6 +25,10 @@
void ComputeFrustum(float left, float right, float bottom, float top, float zNear, float zFar);
void LookAt(const MercuryVertex& eye, const MercuryVector& look, const MercuryVector& up);
+
+ bool Clip(const BoundingBox& bb) const;
+
+ MercuryPlane m_planes[6];
private:
MercuryMatrix m_frustum;
@@ -31,9 +36,10 @@
float m_nh, m_nw, m_fh, m_fw;
MercuryVector m_nc, m_fc;
- MercuryPlane m_planes[6];
};
+extern const Frustum* FRUSTUM;
+
class Viewport : public RenderableNode
{
public:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-03-02 19:41:42
|
Revision: 159
http://hgengine.svn.sourceforge.net/hgengine/?rev=159&view=rev
Author: axlecrusher
Date: 2009-03-02 19:41:32 +0000 (Mon, 02 Mar 2009)
Log Message:
-----------
update
Modified Paths:
--------------
Mercury2/src/MercuryVertex.cpp
Mercury2/src/MercuryVertex.h
Modified: Mercury2/src/MercuryVertex.cpp
===================================================================
--- Mercury2/src/MercuryVertex.cpp 2009-03-02 19:35:20 UTC (rev 158)
+++ Mercury2/src/MercuryVertex.cpp 2009-03-02 19:41:32 UTC (rev 159)
@@ -17,7 +17,7 @@
MercuryVertex::MercuryVertex( const float * in )
{
for (unsigned int i = 0; i < 3; ++i)
- m_xyz[i] *= in[i];
+ m_xyz[i] = in[i];
}
void MercuryVertex::NormalizeSelf()
@@ -86,7 +86,18 @@
return ret;
}
+float MercuryVertex::DotProduct(const MercuryVertex& rhs) const
+{
+ return (m_xyz[0]*rhs.m_xyz[0]+m_xyz[1]*rhs.m_xyz[1]+m_xyz[2]*rhs.m_xyz[2]);
+}
+void MercuryVertex::Print() const
+{
+ printf("%f %f %f\n", m_xyz[0], m_xyz[1], m_xyz[2]);
+}
+
+
+
/****************************************************************************
* Copyright (C) 2009 by Joshua Allen *
* *
Modified: Mercury2/src/MercuryVertex.h
===================================================================
--- Mercury2/src/MercuryVertex.h 2009-03-02 19:35:20 UTC (rev 158)
+++ Mercury2/src/MercuryVertex.h 2009-03-02 19:41:32 UTC (rev 159)
@@ -61,6 +61,9 @@
///Obtain the cross product (*this) x p
MercuryVertex CrossProduct(const MercuryVertex& p) const;
+
+ float DotProduct(const MercuryVertex& rhs) const;
+ void Print() const;
float m_xyz[3];
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-03-02 19:35:25
|
Revision: 158
http://hgengine.svn.sourceforge.net/hgengine/?rev=158&view=rev
Author: axlecrusher
Date: 2009-03-02 19:35:20 +0000 (Mon, 02 Mar 2009)
Log Message:
-----------
Add Plane
Added Paths:
-----------
Mercury2/src/MercuryPlane.cpp
Mercury2/src/MercuryPlane.h
Added: Mercury2/src/MercuryPlane.cpp
===================================================================
--- Mercury2/src/MercuryPlane.cpp (rev 0)
+++ Mercury2/src/MercuryPlane.cpp 2009-03-02 19:35:20 UTC (rev 158)
@@ -0,0 +1,65 @@
+#include <MercuryPlane.h>
+#include <stdio.h>
+#include <MercuryMath.h>
+
+bool MercuryPlane::IsBehindPlane(const MercuryVertex& point) const
+{
+ return m_normal.DotProduct( point ) < 0;
+}
+
+bool MercuryPlane::IsBehindPlane(const BoundingBox& bb) const
+{
+ const MercuryVertex& center = bb.GetCenter();
+ const MercuryVertex& extends = bb.GetExtend();
+
+ MercuryVertex A1, A2, A3, tmp;
+
+ tmp = center+MercuryVertex( extends.GetX(), 0, 0 );
+ A1 = (center-tmp).Normalize();
+ tmp = center+MercuryVertex( 0, extends.GetY(), 0 );
+ A2 = (center-tmp).Normalize();
+ tmp = center+MercuryVertex( 0, 0, extends.GetZ() );
+ A3 = (center-tmp).Normalize();
+
+ float x = ABS( extends.GetX() * m_normal.DotProduct( A1 ) );
+ x += ABS( extends.GetY() * m_normal.DotProduct( A2 ) );
+ x += ABS( extends.GetZ() * m_normal.DotProduct( A3 ) );
+
+ float d = m_normal.DotProduct( m_center );
+
+ return ABS( d ) > x;
+}
+
+
+
+/****************************************************************************
+ * Copyright (C) 2009 by Joshua Allen *
+ * *
+ * *
+ * All rights reserved. *
+ * *
+ * Redistribution and use in source and binary forms, with or without *
+ * modification, are permitted provided that the following conditions *
+ * are met: *
+ * * Redistributions of source code must retain the above copyright *
+ * notice, this list of conditions and the following disclaimer. *
+ * * Redistributions in binary form must reproduce the above *
+ * copyright notice, this list of conditions and the following *
+ * disclaimer in the documentation and/or other materials provided *
+ * with the distribution. *
+ * * Neither the name of the Mercury Engine nor the names of its *
+ * contributors may be used to endorse or promote products derived *
+ * from this software without specific prior written permission. *
+ * *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
+ ***************************************************************************/
Added: Mercury2/src/MercuryPlane.h
===================================================================
--- Mercury2/src/MercuryPlane.h (rev 0)
+++ Mercury2/src/MercuryPlane.h 2009-03-02 19:35:20 UTC (rev 158)
@@ -0,0 +1,58 @@
+#ifndef MERCURYPLANE_H
+#define MERCURYPLANE_H
+
+#include <MercuryVertex.h>
+#include <BoundingBox.h>
+
+class MercuryPlane
+{
+ public:
+ inline void Setup( const MercuryVertex& center, const MercuryVertex& normal)
+ {
+ m_center = center;
+ SetNormal(normal);
+ }
+
+ inline void SetCenter(const MercuryVertex& center) { m_center = center; }
+ inline void SetNormal(const MercuryVertex& normal) { m_normal = normal.Normalize(); }
+
+ bool IsBehindPlane(const MercuryVertex& point) const;
+ bool IsBehindPlane(const BoundingBox& bb) const;
+ private:
+ MercuryVertex m_center;
+ MercuryVector m_normal;
+};
+
+#endif
+
+/****************************************************************************
+ * Copyright (C) 2009 by Joshua Allen *
+ * *
+ * *
+ * All rights reserved. *
+ * *
+ * Redistribution and use in source and binary forms, with or without *
+ * modification, are permitted provided that the following conditions *
+ * are met: *
+ * * Redistributions of source code must retain the above copyright *
+ * notice, this list of conditions and the following disclaimer. *
+ * * Redistributions in binary form must reproduce the above *
+ * copyright notice, this list of conditions and the following *
+ * disclaimer in the documentation and/or other materials provided *
+ * with the distribution. *
+ * * Neither the name of the Mercury Engine nor the names of its *
+ * contributors may be used to endorse or promote products derived *
+ * from this software without specific prior written permission. *
+ * *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
+ ***************************************************************************/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-03-02 01:59:33
|
Revision: 157
http://hgengine.svn.sourceforge.net/hgengine/?rev=157&view=rev
Author: axlecrusher
Date: 2009-03-02 01:59:30 +0000 (Mon, 02 Mar 2009)
Log Message:
-----------
fixing up frustum, preparing for culling
Modified Paths:
--------------
Mercury2/beerhall.hgmdl
Mercury2/docs/MercuryBinaryModelFormat.odt
Mercury2/mercury2.kdevelop
Mercury2/src/HGMDLModel.cpp
Mercury2/src/MercuryUtil.cpp
Mercury2/src/MercuryUtil.h
Mercury2/src/Viewport.cpp
Mercury2/src/Viewport.h
Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp
Added Paths:
-----------
Mercury2/src/MercuryVertex.cpp
Mercury2/src/MercuryVertex.h
Modified: Mercury2/beerhall.hgmdl
===================================================================
(Binary files differ)
Modified: Mercury2/docs/MercuryBinaryModelFormat.odt
===================================================================
(Binary files differ)
Modified: Mercury2/mercury2.kdevelop
===================================================================
--- Mercury2/mercury2.kdevelop 2009-03-01 21:10:09 UTC (rev 156)
+++ Mercury2/mercury2.kdevelop 2009-03-02 01:59:30 UTC (rev 157)
@@ -2,7 +2,7 @@
<kdevelop>
<general>
<author>Joshua Allen</author>
- <email/>
+ <email></email>
<version>2.0</version>
<projectmanagement>KDevAutoProject</projectmanagement>
<primarylanguage>C++</primarylanguage>
@@ -14,8 +14,8 @@
<projectname>Mercury2</projectname>
<projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath>
- <description/>
- <defaultencoding/>
+ <description></description>
+ <defaultencoding></defaultencoding>
<versioncontrol/>
</general>
<kdevautoproject>
@@ -222,7 +222,7 @@
<includePaths>.;</includePaths>
</codecompletion>
<creategettersetter>
- <prefixGet/>
+ <prefixGet></prefixGet>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>
@@ -243,11 +243,11 @@
</cppsupportpart>
<kdevdebugger>
<general>
- <gdbpath/>
+ <gdbpath></gdbpath>
<dbgshell>libtool</dbgshell>
- <configGdbScript/>
- <runShellScript/>
- <runGdbScript/>
+ <configGdbScript></configGdbScript>
+ <runShellScript></runShellScript>
+ <runGdbScript></runGdbScript>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar>
Modified: Mercury2/src/HGMDLModel.cpp
===================================================================
--- Mercury2/src/HGMDLModel.cpp 2009-03-01 21:10:09 UTC (rev 156)
+++ Mercury2/src/HGMDLModel.cpp 2009-03-02 01:59:30 UTC (rev 157)
@@ -2,6 +2,9 @@
REGISTER_ASSET_TYPE(HGMDLModel);
+const uint16_t EXPCTMJRV = 2;
+const uint16_t EXPCTMNRV = 3;
+
HGMDLModel::HGMDLModel()
:MercuryAsset()
{
@@ -32,13 +35,15 @@
return;
}
- uint32_t version;
- //fread(&version, 4, 1, hgmdl);
- hgmdl->Read( &version, 4 );
+ uint16_t majorVersion;
+ uint16_t minorVersion;
- if (version != 200)
+ hgmdl->Read( &majorVersion, 2 );
+ hgmdl->Read( &minorVersion, 2 );
+
+ if ((majorVersion != EXPCTMJRV) || (minorVersion != EXPCTMNRV))
{
- printf("Invalid HGMDL version %d\n", version);
+ printf("Can only read HGMDL version %d.%d, this file is %d.%d\n", EXPCTMJRV,EXPCTMNRV,majorVersion,minorVersion);
return;
}
Modified: Mercury2/src/MercuryUtil.cpp
===================================================================
--- Mercury2/src/MercuryUtil.cpp 2009-03-01 21:10:09 UTC (rev 156)
+++ Mercury2/src/MercuryUtil.cpp 2009-03-02 01:59:30 UTC (rev 157)
@@ -66,7 +66,6 @@
return length;
}
-
/***************************************************************************
* Copyright (C) 2008 by Joshua Allen *
* *
Modified: Mercury2/src/MercuryUtil.h
===================================================================
--- Mercury2/src/MercuryUtil.h 2009-03-01 21:10:09 UTC (rev 156)
+++ Mercury2/src/MercuryUtil.h 2009-03-02 01:59:30 UTC (rev 157)
@@ -31,6 +31,18 @@
float StrToFloat(const MString & s);
+template<typename T>
+const T& max(const T& t1, const T& t2)
+{
+ return t1>t2?t1:t2;
+}
+
+template<typename T>
+const T& min(const T& t1, const T& t2)
+{
+ return t1<t2?t1:t2;
+}
+
//This counter is used with singletons to
//ensure proper destruction order of the
//singleton
Added: Mercury2/src/MercuryVertex.cpp
===================================================================
--- Mercury2/src/MercuryVertex.cpp (rev 0)
+++ Mercury2/src/MercuryVertex.cpp 2009-03-02 01:59:30 UTC (rev 157)
@@ -0,0 +1,120 @@
+#include <MercuryVertex.h>
+#include <MercuryUtil.h>
+#include <MercuryMath.h>
+
+MercuryVertex::MercuryVertex()
+{
+ m_xyz[0] = m_xyz[1] = m_xyz[2] = 0;
+}
+
+MercuryVertex::MercuryVertex( float ix, float iy, float iz )
+{
+ m_xyz[0] = ix;
+ m_xyz[1] = iy;
+ m_xyz[2] = iz;
+}
+
+MercuryVertex::MercuryVertex( const float * in )
+{
+ for (unsigned int i = 0; i < 3; ++i)
+ m_xyz[i] *= in[i];
+}
+
+void MercuryVertex::NormalizeSelf()
+{
+ float imag = 1.0f/Length();
+ for (unsigned int i = 0; i < 3; ++i)
+ m_xyz[i] *= imag;
+}
+
+MercuryVertex MercuryVertex::Normalize() const
+{
+ MercuryVertex r(*this);
+ r.NormalizeSelf();
+ return r;
+}
+
+float MercuryVertex::Length() const
+{
+ float length = m_xyz[0]*m_xyz[0];
+ length += m_xyz[1]*m_xyz[1];
+ length += m_xyz[2]*m_xyz[2];
+ return SQRT(length);
+}
+
+float MercuryVertex::GetBiggestElement() const
+{
+ float tmp = m_xyz[0];
+ tmp = max<float>(tmp, m_xyz[1]);
+ return max<float>(tmp, m_xyz[2]);
+}
+
+const MercuryVertex& MercuryVertex::operator *= (const MercuryVertex& p)
+{
+ for (unsigned int i = 0; i < 3; ++i)
+ m_xyz[i] *= p.m_xyz[i];
+ return *this;
+}
+
+const MercuryVertex& MercuryVertex::operator /= (const MercuryVertex& p)
+{
+ for (unsigned int i = 0; i < 3; ++i)
+ m_xyz[i] /= p.m_xyz[i];
+ return *this;
+}
+
+bool MercuryVertex::operator==(const MercuryVertex& p) const
+{
+ for (unsigned int i = 0; i < 3; ++i)
+ if (m_xyz[i] != p.m_xyz[i]) return false;
+ return true;
+}
+
+bool MercuryVertex::operator==(const float f) const
+{
+ for (unsigned int i = 0; i < 3; ++i)
+ if (m_xyz[i] != f) return false;
+ return true;
+}
+
+MercuryVertex MercuryVertex::CrossProduct(const MercuryVertex& p) const
+{
+ MercuryVertex ret;
+ ret.m_xyz[0] = m_xyz[1]*p.m_xyz[2] - m_xyz[2]*p.m_xyz[1];
+ ret.m_xyz[1] = m_xyz[2]*p.m_xyz[0] - m_xyz[0]*p.m_xyz[2];
+ ret.m_xyz[2] = m_xyz[0]*p.m_xyz[1] - m_xyz[1]*p.m_xyz[0];
+ return ret;
+}
+
+
+/****************************************************************************
+ * Copyright (C) 2009 by Joshua Allen *
+ * *
+ * *
+ * All rights reserved. *
+ * *
+ * Redistribution and use in source and binary forms, with or without *
+ * modification, are permitted provided that the following conditions *
+ * are met: *
+ * * Redistributions of source code must retain the above copyright *
+ * notice, this list of conditions and the following disclaimer. *
+ * * Redistributions in binary form must reproduce the above *
+ * copyright notice, this list of conditions and the following *
+ * disclaimer in the documentation and/or other materials provided *
+ * with the distribution. *
+ * * Neither the name of the Mercury Engine nor the names of its *
+ * contributors may be used to endorse or promote products derived *
+ * from this software without specific prior written permission. *
+ * *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
+ ***************************************************************************/
Added: Mercury2/src/MercuryVertex.h
===================================================================
--- Mercury2/src/MercuryVertex.h (rev 0)
+++ Mercury2/src/MercuryVertex.h 2009-03-02 01:59:30 UTC (rev 157)
@@ -0,0 +1,101 @@
+#ifndef MERCURYVECTOR_H
+#define MERCURYVECTOR_H
+
+class MercuryVertex
+{
+ public:
+ MercuryVertex();
+ MercuryVertex( float ix, float iy, float iz );
+ MercuryVertex( const float * in );
+
+ ///Direct conversion to float*
+ operator float* () { return m_xyz; }
+ ///Direct conversion to const float*
+ operator const float* () const { return m_xyz; }
+
+ inline const float GetX() const { return m_xyz[0]; }
+ inline const float GetY() const { return m_xyz[1]; }
+ inline const float GetZ() const { return m_xyz[2]; }
+ inline void SetX(const float ix) { m_xyz[0] = ix; }
+ inline void SetY(const float iy) { m_xyz[1] = iy; }
+ inline void SetZ(const float iz) { m_xyz[2] = iz; }
+
+ inline void Zero() { m_xyz[0] = 0; m_xyz[1] = 0; m_xyz[2] = 0; }
+
+ ///Normalize (make |point| = 1)
+ void NormalizeSelf();
+ ///Return a normalized point
+ MercuryVertex Normalize() const;
+ ///Return the length of |this|
+ float Length() const;
+
+ float GetBiggestElement() const;
+
+ ///Write out to be = to this point
+ inline void ConvertToVector3( float* out ) const { out[0] = m_xyz[0]; out[1] = m_xyz[1]; out[2] = m_xyz[2]; }
+ ///Write out to be = to this point, however the 4th element will be 0
+ inline void ConvertToVector4( float* out ) const { out[0] = m_xyz[0]; out[1] = m_xyz[1]; out[2] = m_xyz[2]; out[3] = 0; }
+ ///Write out to be = - to this point, however the 4th element will be 0
+ inline void ConvertToIVector4( float* out ) const { out[0] = -m_xyz[0]; out[1] = -m_xyz[1]; out[2] = -m_xyz[2]; out[3] = 0; }
+
+ const MercuryVertex& operator *= (const MercuryVertex& p);
+ const MercuryVertex& operator /= (const MercuryVertex& p);
+ inline MercuryVertex operator * (const MercuryVertex& p) const { MercuryVertex r(*this); r*=p; return r; }
+ inline MercuryVertex operator / (const MercuryVertex& p) const { MercuryVertex r(*this); r/=p; return r; }
+
+ inline MercuryVertex& operator += ( const MercuryVertex& other ) { m_xyz[0]+=other.m_xyz[0]; m_xyz[1]+=other.m_xyz[1]; m_xyz[2]+=other.m_xyz[2]; return *this; }
+ inline MercuryVertex& operator -= ( const MercuryVertex& other ) { m_xyz[0]-=other.m_xyz[0]; m_xyz[1]-=other.m_xyz[1]; m_xyz[2]-=other.m_xyz[2]; return *this; }
+ inline MercuryVertex& operator *= ( float f ) { m_xyz[0]*=f; m_xyz[1]*=f; m_xyz[2]*=f; return *this; }
+ inline MercuryVertex& operator /= ( float f ) { m_xyz[0]/=f; m_xyz[1]/=f; m_xyz[2]/=f; return *this; }
+
+ inline MercuryVertex operator + ( const MercuryVertex& other ) const { return MercuryVertex( m_xyz[0]+other.m_xyz[0], m_xyz[1]+other.m_xyz[1], m_xyz[2]+other.m_xyz[2] ); }
+ inline MercuryVertex operator - ( const MercuryVertex& other ) const { return MercuryVertex( m_xyz[0]-other.m_xyz[0], m_xyz[1]-other.m_xyz[1], m_xyz[2]-other.m_xyz[2] ); }
+ inline MercuryVertex operator * ( float f ) const { return MercuryVertex( m_xyz[0]*f, m_xyz[1]*f, m_xyz[2]*f ); }
+ inline MercuryVertex operator / ( float f ) const { return MercuryVertex( m_xyz[0]/f, m_xyz[1]/f, m_xyz[2]/f ); }
+
+ bool operator==(const MercuryVertex& p) const;
+ inline bool operator!=(const MercuryVertex& p) const { return !(*this == p); }
+
+ bool operator==(const float f) const;
+ inline bool operator!=(const float f) const { return !(*this == f); }
+
+ ///Obtain the cross product (*this) x p
+ MercuryVertex CrossProduct(const MercuryVertex& p) const;
+
+ float m_xyz[3];
+};
+
+typedef MercuryVertex MercuryVector;
+
+#endif
+/****************************************************************************
+ * Copyright (C) 2009 by Joshua Allen *
+ * *
+ * *
+ * All rights reserved. *
+ * *
+ * Redistribution and use in source and binary forms, with or without *
+ * modification, are permitted provided that the following conditions *
+ * are met: *
+ * * Redistributions of source code must retain the above copyright *
+ * notice, this list of conditions and the following disclaimer. *
+ * * Redistributions in binary form must reproduce the above *
+ * copyright notice, this list of conditions and the following *
+ * disclaimer in the documentation and/or other materials provided *
+ * with the distribution. *
+ * * Neither the name of the Mercury Engine nor the names of its *
+ * contributors may be used to endorse or promote products derived *
+ * from this software without specific prior written permission. *
+ * *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
+ ***************************************************************************/
Modified: Mercury2/src/Viewport.cpp
===================================================================
--- Mercury2/src/Viewport.cpp 2009-03-01 21:10:09 UTC (rev 156)
+++ Mercury2/src/Viewport.cpp 2009-03-02 01:59:30 UTC (rev 157)
@@ -11,27 +11,49 @@
MercuryMatrix m = FindGlobalMatrix();
m.Transpose();
- glLoadMatrixf( (m * m_frustum).Ptr() );
+ glLoadMatrixf( (m * m_frustum.GetMatrix()).Ptr() );
//The following 2 are equivelent to above
// glLoadMatrixf( m_frustum.Ptr() );
// glMultMatrixf( m.Ptr() );
-
+
glMatrixMode(GL_MODELVIEW);
}
-void Viewport::Perspective( float fov, float aspect, float znear, float zfar )
+void Viewport::LoadFromXML(const XMLNode& node)
{
+ m_frustum.SetPerspective( StrToFloat(node.Attribute("fov")),
+ StrToFloat(node.Attribute("aspect")),
+ StrToFloat(node.Attribute("near")),
+ StrToFloat(node.Attribute("far")));
+
+ m_frustum.LookAt(MercuryVertex(), MercuryVertex(0,0,1), MercuryVertex(0,1,0));
+
+ RenderableNode::LoadFromXML(node);
+}
+
+void Frustum::SetPerspective( float fov, float aspect, float znear, float zfar )
+{
float xmin, xmax, ymin, ymax;
- ymax = znear * TAN(fov * Q_PI / 360.0);
+ m_fov = fov;
+ m_aspect = aspect;
+ m_zNear = znear;
+ m_zFar = zfar;
+
+ float tang = TAN(m_fov * Q_PI / 360.0);
+
+ m_nh = ymax = m_zNear * tang; //nh
ymin = -ymax;
- xmin = ymin * aspect;
- xmax = ymax * aspect;
+ xmin = ymin * m_aspect;
+ m_nw = xmax = ymax * m_aspect; //nw
+
+ m_fh = m_zFar*tang;
+ m_fw = m_fh*aspect;
- ComputeFrustum(xmin, xmax, ymin, ymax, znear, zfar);
+ ComputeFrustum(xmin, xmax, ymin, ymax, m_zNear, m_zFar);
}
-void Viewport::ComputeFrustum(float left, float right, float bottom, float top, float zNear, float zFar)
+void Frustum::ComputeFrustum(float left, float right, float bottom, float top, float zNear, float zFar)
{
float near2 = 2*zNear;
float rml = right-left;
@@ -57,16 +79,59 @@
m_frustum.Transpose(); //XXX fix it to remove this
}
-void Viewport::LoadFromXML(const XMLNode& node)
+void Frustum::LookAt(const MercuryVertex& eye, const MercuryVector& look, const MercuryVector& up)
{
- Perspective( StrToFloat(node.Attribute("fov")),
- StrToFloat(node.Attribute("aspect")),
- StrToFloat(node.Attribute("near")),
- StrToFloat(node.Attribute("far")));
+ //Right now this only builds the frustum planes
+ MercuryVector X,Y,Z;
- RenderableNode::LoadFromXML(node);
+ Z = (eye - look).Normalize(); //direction behind camera
+ X = (up * Z).Normalize(); //X axis
+ Y = Z.CrossProduct( X ); //real up
+
+ m_nc = up - Z * m_zNear;
+ m_fc = up - Z * m_zFar;
+
+ m_planes[PNEAR].Setup(m_nc, Z*-1);
+ m_planes[PFAR].Setup(m_fc, Z);
+
+ MercuryVector aux,normal;
+
+ aux = (m_nc + Y*m_nh) - eye;
+ aux.NormalizeSelf();
+ normal = aux * X;
+ m_planes[PTOP].Setup(m_nc+Y*m_nh,normal);
+
+ aux = (m_nc - Y*m_nh) - eye;
+ aux.NormalizeSelf();
+ normal = X * aux;
+ m_planes[PBOTTOM].Setup(m_nc-Y*m_nh,normal);
+
+ aux = (m_nc - X*m_nw) - eye;
+ aux.NormalizeSelf();
+ normal = aux * Y;
+ m_planes[PLEFT].Setup(m_nc-X*m_nw,normal);
+
+ aux = (m_nc + X*m_nw) - eye;
+ aux.NormalizeSelf();
+ normal = Y * aux;
+ m_planes[PRIGHT].Setup(m_nc+X*m_nw,normal);
}
+/*
+void Frustum::LookAt()
+{
+
+}
+*/
+/*
+bool Frustum::IsPointInFrustum( float x, float y, float z )
+{
+ for( uint16_t i = 0; i < 6; ++i )
+ if( frustum[i][0] * x + frustum[i][1] * y + frustum[i][2] * z + frustum[i][3] <= 0 )
+ return false;
+ return true;
+}*/
+
/***************************************************************************
* Copyright (C) 2008 by Joshua Allen *
* *
Modified: Mercury2/src/Viewport.h
===================================================================
--- Mercury2/src/Viewport.h 2009-03-01 21:10:09 UTC (rev 156)
+++ Mercury2/src/Viewport.h 2009-03-02 01:59:30 UTC (rev 157)
@@ -3,18 +3,47 @@
#include <RenderableNode.h>
#include <MercuryMatrix.h>
+#include <MercuryVertex.h>
+#include <MercuryPlane.h>
+
+class Frustum
+{
+ enum PlanePos
+ {
+ PTOP = 0,
+ PBOTTOM,
+ PLEFT,
+ PRIGHT,
+ PNEAR,
+ PFAR
+ };
+
+ public:
+ void SetPerspective( float fov, float aspect, float znear, float zfar );
+ const MercuryMatrix& GetMatrix() const { return m_frustum; }
+ void ComputeFrustum(float left, float right, float bottom, float top, float zNear, float zFar);
+
+ void LookAt(const MercuryVertex& eye, const MercuryVector& look, const MercuryVector& up);
+ private:
+ MercuryMatrix m_frustum;
+
+ float m_aspect, m_fov, m_zNear, m_zFar;
+ float m_nh, m_nw, m_fh, m_fw;
+
+ MercuryVector m_nc, m_fc;
+ MercuryPlane m_planes[6];
+};
+
class Viewport : public RenderableNode
{
public:
virtual void Render();
- void Perspective( float fov, float aspect, float znear, float zfar );
virtual void LoadFromXML(const XMLNode& node);
GENRTTI(Viewport);
private:
- void ComputeFrustum(float left, float right, float bottom, float top, float zNear, float zFar);
- MercuryMatrix m_frustum;
+ Frustum m_frustum;
};
#endif
Modified: Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp
===================================================================
--- Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp 2009-03-01 21:10:09 UTC (rev 156)
+++ Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp 2009-03-02 01:59:30 UTC (rev 157)
@@ -136,7 +136,8 @@
bool b;
fwrite("MBMF", 4, 1, mbmf);
- tmp32 = 200; fwrite(&tmp32, sizeof(uint32_t), 1, mbmf);
+ tmp16 = 2; fwrite(&tmp16, sizeof(uint16_t), 1, mbmf);
+ tmp16 = 3; fwrite(&tmp16, sizeof(uint16_t), 1, mbmf);
tmp16 = 1; fwrite(&tmp16, sizeof(uint16_t), 1, mbmf);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Charles L. <cn...@us...> - 2009-03-01 22:23:48
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21989/src Modified Files: global.h Log Message: oopsies on someone's part. This is an entertaining fix. Index: global.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/global.h,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** global.h 28 Jul 2007 23:22:17 -0000 1.31 --- global.h 1 Mar 2009 22:23:42 -0000 1.32 *************** *** 96,100 **** #define MIN( x, y ) ((x<y)?(x):(y)) ! #define MAX( x, y ) ((x<y)?(x):(y)) #if defined( PSTHREE ) --- 96,100 ---- #define MIN( x, y ) ((x<y)?(x):(y)) ! #define MAX( x, y ) ((x>y)?(x):(y)) #if defined( PSTHREE ) |
|
From: <axl...@us...> - 2009-03-01 21:10:19
|
Revision: 156
http://hgengine.svn.sourceforge.net/hgengine/?rev=156&view=rev
Author: axlecrusher
Date: 2009-03-01 21:10:09 +0000 (Sun, 01 Mar 2009)
Log Message:
-----------
Clean up bounding box
Modified Paths:
--------------
Mercury2/beerhall.hgmdl
Mercury2/scenegraph.xml
Mercury2/src/HGMDLMesh.cpp
Mercury2/src/HGMDLMesh.h
Mercury2/src/MercuryVBO.cpp
Mercury2/src/MercuryVBO.h
Added Paths:
-----------
Mercury2/src/BoundingBox.cpp
Mercury2/src/BoundingBox.h
Modified: Mercury2/beerhall.hgmdl
===================================================================
(Binary files differ)
Modified: Mercury2/scenegraph.xml
===================================================================
--- Mercury2/scenegraph.xml 2009-03-01 20:22:29 UTC (rev 155)
+++ Mercury2/scenegraph.xml 2009-03-01 21:10:09 UTC (rev 156)
@@ -28,8 +28,8 @@
</node>
<node type="rotatornode" movz="-2" movx="2" scalex="0.25" scaley="0.25" scalez="0.25" >
<node type="renderablenode">
- <asset type="texture" file="test.bmp"/>
- <asset type="hgmdlmodel" file="beerhall.hgmdl"/>
+ <asset type="texture" file="gunther.png"/>
+ <asset type="hgmdlmodel" file="gunther.hgmdl"/>
</node>
</node>
</SceneGraph>
Added: Mercury2/src/BoundingBox.cpp
===================================================================
--- Mercury2/src/BoundingBox.cpp (rev 0)
+++ Mercury2/src/BoundingBox.cpp 2009-03-01 21:10:09 UTC (rev 156)
@@ -0,0 +1,97 @@
+#include <GL/gl.h>
+#include <GL/glext.h>
+#include <BoundingBox.h>
+
+void BoundingBox::LoadFromBinary(char* data)
+{
+ memcpy(m_center, data, sizeof(float)*3);
+ memcpy(m_extend, data+(sizeof(float)*3), sizeof(float)*3);
+}
+
+RenderableBoundingBox::RenderableBoundingBox(const BoundingBox* bb)
+ :MercuryAsset(), m_bb(bb)
+{
+}
+
+void RenderableBoundingBox::Render(MercuryNode* node)
+{
+ const float* center = m_bb->GetCenter();
+ const float* extend = m_bb->GetExtend();
+
+ glPushAttrib( GL_CURRENT_BIT );
+ glBegin(GL_LINES);
+ glColor3f(0,1.0f,0);
+
+ //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]);
+ 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]);
+ 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]);
+
+ glEnd();
+
+ glPointSize(4);
+ glBegin(GL_POINTS);
+ glVertex3f(center[0], center[1], center[2]);
+ glEnd();
+
+ glPopAttrib( );
+}
+
+/****************************************************************************
+ * Copyright (C) 2008 by Joshua Allen *
+ * *
+ * *
+ * All rights reserved. *
+ * *
+ * Redistribution and use in source and binary forms, with or without *
+ * modification, are permitted provided that the following conditions *
+ * are met: *
+ * * Redistributions of source code must retain the above copyright *
+ * notice, this list of conditions and the following disclaimer. *
+ * * Redistributions in binary form must reproduce the above *
+ * copyright notice, this list of conditions and the following *
+ * disclaimer in the documentation and/or other materials provided *
+ * with the distribution. *
+ * * Neither the name of the Mercury Engine nor the names of its *
+ * contributors may be used to endorse or promote products derived *
+ * from this software without specific prior written permission. *
+ * *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
+ ***************************************************************************/
Added: Mercury2/src/BoundingBox.h
===================================================================
--- Mercury2/src/BoundingBox.h (rev 0)
+++ Mercury2/src/BoundingBox.h 2009-03-01 21:10:09 UTC (rev 156)
@@ -0,0 +1,59 @@
+#ifndef BOUNDINGBOX_H
+#define BOUNDINGBOX_H
+
+#include <MercuryAsset.h>
+
+class BoundingBox
+{
+ public:
+ void LoadFromBinary(char* data);
+ inline const float* GetCenter() const { return m_center; }
+ inline const float* GetExtend() const { return m_extend; }
+ private:
+ float m_center[3];
+ float m_extend[3];
+};
+
+class RenderableBoundingBox : public MercuryAsset
+{
+ public:
+ RenderableBoundingBox(const BoundingBox* bb);
+ virtual void Render(MercuryNode* node);
+
+ private:
+ const BoundingBox* m_bb;
+};
+
+#endif
+
+/****************************************************************************
+ * Copyright (C) 2008 by Joshua Allen *
+ * *
+ * *
+ * All rights reserved. *
+ * *
+ * Redistribution and use in source and binary forms, with or without *
+ * modification, are permitted provided that the following conditions *
+ * are met: *
+ * * Redistributions of source code must retain the above copyright *
+ * notice, this list of conditions and the following disclaimer. *
+ * * Redistributions in binary form must reproduce the above *
+ * copyright notice, this list of conditions and the following *
+ * disclaimer in the documentation and/or other materials provided *
+ * with the distribution. *
+ * * Neither the name of the Mercury Engine nor the names of its *
+ * contributors may be used to endorse or promote products derived *
+ * from this software without specific prior written permission. *
+ * *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
+ ***************************************************************************/
Modified: Mercury2/src/HGMDLMesh.cpp
===================================================================
--- Mercury2/src/HGMDLMesh.cpp 2009-03-01 20:22:29 UTC (rev 155)
+++ Mercury2/src/HGMDLMesh.cpp 2009-03-01 21:10:09 UTC (rev 156)
@@ -1,15 +1,5 @@
#include <HGMDLMesh.h>
-HGMDLMesh::HGMDLMesh()
- :MercuryVBO(), m_boundingBox(NULL)
-{
-}
-
-HGMDLMesh::~HGMDLMesh()
-{
- SAFE_DELETE(m_boundingBox);
-}
-
void HGMDLMesh::LoadFromFile(MercuryFile* hgmdl)
{
uint32_t nameLength;
@@ -98,117 +88,14 @@
data = new char[length];
hgmdl->Read( data, length );
- m_boundingBox = new OBB();
+ m_boundingBox = new BoundingBox();
m_boundingBox->LoadFromBinary( data );
}
SAFE_DELETE_ARRAY(data);
}
-void OBB::LoadFromBinary(char* data)
-{
- memcpy(center, data, sizeof(float)*3);
- memcpy(extend, data+(sizeof(float)*3), sizeof(float)*3);
-}
-#include <GL/gl.h>
-#include <GL/glext.h>
-
-void OBB::Render(MercuryNode* node)
-{
- glPushAttrib( GL_CURRENT_BIT );
- glBegin(GL_LINES);
- glColor3f(0,1.0f,0);
-
- //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]);
- 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]);
- 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]);
-
- glEnd();
-/*
- 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]);
-
- //left side
- 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 side
- 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]);
-
- glEnd();
-*/
- glPointSize(4);
- glBegin(GL_POINTS);
- glVertex3f(center[0], center[1], center[2]);
- glEnd();
-
- glPopAttrib( );
-}
-
-void HGMDLMesh::Render(MercuryNode* node)
-{
- MercuryVBO::Render(node);
-
- if (m_boundingBox)
- m_boundingBox->Render(node);
-}
-
/****************************************************************************
* Copyright (C) 2008 by Joshua Allen *
* *
Modified: Mercury2/src/HGMDLMesh.h
===================================================================
--- Mercury2/src/HGMDLMesh.h 2009-03-01 20:22:29 UTC (rev 155)
+++ Mercury2/src/HGMDLMesh.h 2009-03-01 21:10:09 UTC (rev 156)
@@ -4,33 +4,16 @@
#include <MercuryVBO.h>
#include <MercuryFile.h>
-class OBB : public MercuryAsset
-{
- public:
- void LoadFromBinary(char* data);
-
- virtual void Render(MercuryNode* node);
-
- float center[3];
- float extend[3];
-};
-
class HGMDLMesh : public MercuryVBO
{
public:
- HGMDLMesh();
- ~HGMDLMesh();
void LoadFromFile(MercuryFile* hgmdl);
void ReadExtraData(MercuryFile* hgmdl);
void LoadOBB(MercuryFile* hgmdl);
-
- virtual void Render(MercuryNode* node);
private:
MString m_name;
bool m_cachable;
-
- OBB* m_boundingBox;
};
#endif
Modified: Mercury2/src/MercuryVBO.cpp
===================================================================
--- Mercury2/src/MercuryVBO.cpp 2009-03-01 20:22:29 UTC (rev 155)
+++ Mercury2/src/MercuryVBO.cpp 2009-03-01 21:10:09 UTC (rev 156)
@@ -10,7 +10,7 @@
#define BUFFER_OFFSET(i) ((char*)NULL + (i))
MercuryVBO::MercuryVBO()
- :MercuryAsset(), m_initiated(false)
+ :MercuryAsset(), m_initiated(false), m_boundingBox(NULL)
{
m_bufferIDs[0] = m_bufferIDs[1] = 0;
}
@@ -19,6 +19,7 @@
{
if (m_bufferIDs[0]) glDeleteBuffersARB(2, m_bufferIDs);
m_bufferIDs[0] = m_bufferIDs[1] = 0;
+ SAFE_DELETE(m_boundingBox);
}
void MercuryVBO::Render(MercuryNode* node)
@@ -51,6 +52,12 @@
glDrawRangeElements(GL_TRIANGLES, 0, m_indexData.Length()-1, m_indexData.Length(), GL_UNSIGNED_SHORT, NULL);
m_lastVBOrendered = this;
+
+ if (m_boundingBox)
+ {
+ RenderableBoundingBox rbb(m_boundingBox);
+ rbb.Render(node);
+ }
}
void MercuryVBO::InitVBO()
Modified: Mercury2/src/MercuryVBO.h
===================================================================
--- Mercury2/src/MercuryVBO.h 2009-03-01 20:22:29 UTC (rev 155)
+++ Mercury2/src/MercuryVBO.h 2009-03-01 21:10:09 UTC (rev 156)
@@ -3,6 +3,7 @@
#include <MercuryAsset.h>
#include <AlignedBuffer.h>
+#include <BoundingBox.h>
class MercuryVBO : public MercuryAsset
{
@@ -25,6 +26,7 @@
protected:
AlignedBuffer<float> m_vertexData;
AlignedBuffer<uint16_t> m_indexData;
+ BoundingBox* m_boundingBox;
};
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-03-01 20:22:33
|
Revision: 155
http://hgengine.svn.sourceforge.net/hgengine/?rev=155&view=rev
Author: axlecrusher
Date: 2009-03-01 20:22:29 +0000 (Sun, 01 Mar 2009)
Log Message:
-----------
show bounding box info
Modified Paths:
--------------
Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp
Modified: Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp
===================================================================
--- Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp 2009-03-01 20:15:36 UTC (rev 154)
+++ Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp 2009-03-01 20:22:29 UTC (rev 155)
@@ -119,12 +119,14 @@
tmp[1] = (maxY+minY)/2.0f;
tmp[2] = (maxZ+minZ)/2.0f;
fwrite(tmp, sizeof(float)*3, 1, mbmf);
+ printf("center: %f %f %f\n", tmp[0], tmp[1], tmp[2]);
//extends
tmp[0] = (maxX-minX)/2.0;
tmp[1] = (maxY-minY)/2.0;
tmp[2] = (maxZ-minZ)/2.0;
fwrite(tmp, sizeof(float)*3, 1, mbmf);
+ printf("extends: %f %f %f\n", tmp[0], tmp[1], tmp[2]);
}
void WriteMBMF( FILE *mbmf )
@@ -187,11 +189,7 @@
{
if (line.length() > 0) LineParser(line);
}
-
- printf("X min:%f max:%f\n", minX, maxX );
- printf("Y min:%f max:%f\n", minY, maxY );
- printf("Z min:%f max:%f\n", minZ, maxZ );
-
+
WriteMBMF( mbmf );
fclose( mbmf );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-03-01 20:22:13
|
Revision: 152
http://hgengine.svn.sourceforge.net/hgengine/?rev=152&view=rev
Author: axlecrusher
Date: 2009-03-01 19:49:51 +0000 (Sun, 01 Mar 2009)
Log Message:
-----------
show bounding boxes
Modified Paths:
--------------
Mercury2/src/HGMDLMesh.cpp
Mercury2/src/HGMDLMesh.h
Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp
Modified: Mercury2/src/HGMDLMesh.cpp
===================================================================
--- Mercury2/src/HGMDLMesh.cpp 2009-03-01 16:19:05 UTC (rev 151)
+++ Mercury2/src/HGMDLMesh.cpp 2009-03-01 19:49:51 UTC (rev 152)
@@ -1,5 +1,15 @@
#include <HGMDLMesh.h>
+HGMDLMesh::HGMDLMesh()
+ :MercuryVBO(), m_boundingBox(NULL)
+{
+}
+
+HGMDLMesh::~HGMDLMesh()
+{
+ SAFE_DELETE(m_boundingBox);
+}
+
void HGMDLMesh::LoadFromFile(MercuryFile* hgmdl)
{
uint32_t nameLength;
@@ -50,16 +60,154 @@
void HGMDLMesh::ReadExtraData(MercuryFile* hgmdl)
{
- uint32_t type, length;
+ uint32_t type;
+ hgmdl->Read( &type, sizeof(char)*4 );
+
+ switch( type )
+ {
+ case 541213263:
+ {
+ LoadOBB(hgmdl);
+ break;
+ }
+ default:
+ {
+ printf("Junk extra type '%x'\n", type);
+ //read and discard as junk
+ uint32_t length;
+ hgmdl->Read( &length, sizeof(uint32_t) );
+ if ( length > 0 )
+ {
+ char* data = new char[length];
+ hgmdl->Read( data, length );
+ SAFE_DELETE_ARRAY(data);
+ }
+ break;
+ }
+ }
+}
+
+void HGMDLMesh::LoadOBB(MercuryFile* hgmdl)
+{
+ uint32_t length;
char* data = NULL;
- hgmdl->Read( &type, sizeof(char)*4 );
+
hgmdl->Read( &length, sizeof(uint32_t) );
+ if (length > 0)
+ {
+ data = new char[length];
+ hgmdl->Read( data, length );
+
+ m_boundingBox = new OBB();
+ m_boundingBox->LoadFromBinary( data );
+ }
+
+ SAFE_DELETE_ARRAY(data);
+}
+
+void OBB::LoadFromBinary(char* data)
+{
+ memcpy(center, data, sizeof(float)*3);
+ memcpy(extend, data, sizeof(float)*3);
+}
+
+#include <GL/gl.h>
+#include <GL/glext.h>
+
+void OBB::Render(MercuryNode* node)
+{
+ glPushAttrib( GL_CURRENT_BIT );
+ glBegin(GL_LINES);
+ glColor3f(0,1.0f,0);
+
+ //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]);
+ 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]);
+ 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]);
+
+/*
+ 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]);
- data = new char[length];
- hgmdl->Read( data, length );
- delete data;
+ //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]);
+
+ //left side
+ 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 side
+ 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]);
+*/
+ glEnd();
+
+ glPointSize(4);
+ glBegin(GL_POINTS);
+ glVertex3f(center[0], center[1], center[2]);
+ glEnd();
+
+ glPopAttrib( );
}
+void HGMDLMesh::Render(MercuryNode* node)
+{
+ MercuryVBO::Render(node);
+
+ if (m_boundingBox)
+ m_boundingBox->Render(node);
+}
+
/****************************************************************************
* Copyright (C) 2008 by Joshua Allen *
* *
Modified: Mercury2/src/HGMDLMesh.h
===================================================================
--- Mercury2/src/HGMDLMesh.h 2009-03-01 16:19:05 UTC (rev 151)
+++ Mercury2/src/HGMDLMesh.h 2009-03-01 19:49:51 UTC (rev 152)
@@ -4,14 +4,33 @@
#include <MercuryVBO.h>
#include <MercuryFile.h>
+class OBB : public MercuryAsset
+{
+ public:
+ void LoadFromBinary(char* data);
+
+ virtual void Render(MercuryNode* node);
+
+ float center[3];
+ float extend[3];
+};
+
class HGMDLMesh : public MercuryVBO
{
public:
+ HGMDLMesh();
+ ~HGMDLMesh();
void LoadFromFile(MercuryFile* hgmdl);
void ReadExtraData(MercuryFile* hgmdl);
+ void LoadOBB(MercuryFile* hgmdl);
+
+ virtual void Render(MercuryNode* node);
+
private:
MString m_name;
bool m_cachable;
+
+ OBB* m_boundingBox;
};
#endif
Modified: Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp
===================================================================
--- Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp 2009-03-01 16:19:05 UTC (rev 151)
+++ Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp 2009-03-01 19:49:51 UTC (rev 152)
@@ -188,9 +188,9 @@
if (line.length() > 0) LineParser(line);
}
- printf("%f %f %f\n", minX, maxX, (maxX-minX)/2.0f );
- printf("%f %f %f\n", minY, maxY, (maxY-minY)/2.0f );
- printf("%f %f %f\n", minZ, maxZ, (maxZ-minZ)/2.0f );
+ printf("X min:%f max:%f %f\n", minX, maxX, (maxX-minX)/2.0f );
+ printf("Y min:%f max:%f %f\n", minY, maxY, (maxY-minY)/2.0f );
+ printf("Z min:%f max:%f %f\n", minZ, maxZ, (maxZ-minZ)/2.0f );
WriteMBMF( mbmf );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2009-03-01 20:15:47
|
Revision: 154
http://hgengine.svn.sourceforge.net/hgengine/?rev=154&view=rev
Author: cnlohr
Date: 2009-03-01 20:15:36 +0000 (Sun, 01 Mar 2009)
Log Message:
-----------
fix bb's
Modified Paths:
--------------
Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp
Modified: Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp
===================================================================
--- Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp 2009-03-01 20:15:34 UTC (rev 153)
+++ Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp 2009-03-01 20:15:36 UTC (rev 154)
@@ -115,15 +115,15 @@
float tmp[3];
//center
- tmp[0] = (maxX-minX)/2.0f;
- tmp[1] = (maxY-minY)/2.0f;
- tmp[2] = (maxZ-minZ)/2.0f;
+ tmp[0] = (maxX+minX)/2.0f;
+ tmp[1] = (maxY+minY)/2.0f;
+ tmp[2] = (maxZ+minZ)/2.0f;
fwrite(tmp, sizeof(float)*3, 1, mbmf);
-
+
//extends
- tmp[0] = fabs(tmp[0]);
- tmp[1] = fabs(tmp[1]);
- tmp[2] = fabs(tmp[2]);
+ tmp[0] = (maxX-minX)/2.0;
+ tmp[1] = (maxY-minY)/2.0;
+ tmp[2] = (maxZ-minZ)/2.0;
fwrite(tmp, sizeof(float)*3, 1, mbmf);
}
@@ -188,9 +188,9 @@
if (line.length() > 0) LineParser(line);
}
- printf("X min:%f max:%f %f\n", minX, maxX, (maxX-minX)/2.0f );
- printf("Y min:%f max:%f %f\n", minY, maxY, (maxY-minY)/2.0f );
- printf("Z min:%f max:%f %f\n", minZ, maxZ, (maxZ-minZ)/2.0f );
+ printf("X min:%f max:%f\n", minX, maxX );
+ printf("Y min:%f max:%f\n", minY, maxY );
+ printf("Z min:%f max:%f\n", minZ, maxZ );
WriteMBMF( mbmf );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-03-01 20:15:44
|
Revision: 153
http://hgengine.svn.sourceforge.net/hgengine/?rev=153&view=rev
Author: axlecrusher
Date: 2009-03-01 20:15:34 +0000 (Sun, 01 Mar 2009)
Log Message:
-----------
Fix reading from file
Modified Paths:
--------------
Mercury2/src/HGMDLMesh.cpp
Modified: Mercury2/src/HGMDLMesh.cpp
===================================================================
--- Mercury2/src/HGMDLMesh.cpp 2009-03-01 19:49:51 UTC (rev 152)
+++ Mercury2/src/HGMDLMesh.cpp 2009-03-01 20:15:34 UTC (rev 153)
@@ -108,7 +108,7 @@
void OBB::LoadFromBinary(char* data)
{
memcpy(center, data, sizeof(float)*3);
- memcpy(extend, data, sizeof(float)*3);
+ memcpy(extend, data+(sizeof(float)*3), sizeof(float)*3);
}
#include <GL/gl.h>
@@ -152,6 +152,7 @@
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();
/*
glBegin(GL_QUADS);
//front
@@ -189,9 +190,9 @@
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();
-
+*/
glPointSize(4);
glBegin(GL_POINTS);
glVertex3f(center[0], center[1], center[2]);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-03-01 16:19:13
|
Revision: 151
http://hgengine.svn.sourceforge.net/hgengine/?rev=151&view=rev
Author: axlecrusher
Date: 2009-03-01 16:19:05 +0000 (Sun, 01 Mar 2009)
Log Message:
-----------
Update HGMDL with oriented bounding box as an extra data element for
meshes
Modified Paths:
--------------
Mercury2/beerhall.hgmdl
Mercury2/docs/MercuryBinaryModelFormat.odt
Mercury2/mercury2.kdevelop
Mercury2/scenegraph.xml
Mercury2/src/HGMDLMesh.cpp
Mercury2/src/HGMDLMesh.h
Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp
Modified: Mercury2/beerhall.hgmdl
===================================================================
(Binary files differ)
Modified: Mercury2/docs/MercuryBinaryModelFormat.odt
===================================================================
(Binary files differ)
Modified: Mercury2/mercury2.kdevelop
===================================================================
--- Mercury2/mercury2.kdevelop 2009-01-22 16:28:56 UTC (rev 150)
+++ Mercury2/mercury2.kdevelop 2009-03-01 16:19:05 UTC (rev 151)
@@ -2,7 +2,7 @@
<kdevelop>
<general>
<author>Joshua Allen</author>
- <email></email>
+ <email/>
<version>2.0</version>
<projectmanagement>KDevAutoProject</projectmanagement>
<primarylanguage>C++</primarylanguage>
@@ -14,8 +14,8 @@
<projectname>Mercury2</projectname>
<projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath>
- <description></description>
- <defaultencoding></defaultencoding>
+ <description/>
+ <defaultencoding/>
<versioncontrol/>
</general>
<kdevautoproject>
@@ -26,8 +26,8 @@
<run>
<mainprogram>/home/josh/Mercury2/debug/src/mercury2</mainprogram>
<terminal>false</terminal>
- <programargs></programargs>
- <globaldebugarguments></globaldebugarguments>
+ <programargs/>
+ <globaldebugarguments/>
<globalcwd>/home/josh/Mercury2</globalcwd>
<useglobalprogram>true</useglobalprogram>
<autocompile>false</autocompile>
@@ -43,15 +43,15 @@
<f77compiler>kdevg77options</f77compiler>
<cxxflags>-O2 -g -Wall</cxxflags>
<envvars/>
- <configargs></configargs>
- <topsourcedir></topsourcedir>
+ <configargs/>
+ <topsourcedir/>
<cppflags>-Isrc/ -I/usr/include/libxml2/ -DHGENGINE -DRUN_FROM_START_FOLDER -DUSE_SSE</cppflags>
<ldflags>-lpthread -lX11 -lGL -lxml2 -lpng</ldflags>
- <ccompilerbinary></ccompilerbinary>
- <cxxcompilerbinary></cxxcompilerbinary>
- <f77compilerbinary></f77compilerbinary>
+ <ccompilerbinary/>
+ <cxxcompilerbinary/>
+ <f77compilerbinary/>
<cflags>-O2 -g -Wall</cflags>
- <f77flags></f77flags>
+ <f77flags/>
</optimized>
<debug>
<configargs>--enable-debug=full</configargs>
@@ -61,14 +61,14 @@
<f77compiler>kdevg77options</f77compiler>
<cxxflags>-O2 -g -Wall</cxxflags>
<envvars/>
- <topsourcedir></topsourcedir>
+ <topsourcedir/>
<cppflags>-Isrc/ -I/usr/include/libxml2/ -DHGENGINE -DRUN_FROM_START_FOLDER -DUSE_SSE</cppflags>
<ldflags>-lpthread -lX11 -lGL -lxml2 -lpng</ldflags>
- <ccompilerbinary></ccompilerbinary>
- <cxxcompilerbinary></cxxcompilerbinary>
- <f77compilerbinary></f77compilerbinary>
+ <ccompilerbinary/>
+ <cxxcompilerbinary/>
+ <f77compilerbinary/>
<cflags>-O2 -g -Wall</cflags>
- <f77flags></f77flags>
+ <f77flags/>
</debug>
<default>
<envvars/>
@@ -222,7 +222,7 @@
<includePaths>.;</includePaths>
</codecompletion>
<creategettersetter>
- <prefixGet></prefixGet>
+ <prefixGet/>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>
@@ -243,11 +243,11 @@
</cppsupportpart>
<kdevdebugger>
<general>
- <gdbpath></gdbpath>
+ <gdbpath/>
<dbgshell>libtool</dbgshell>
- <configGdbScript></configGdbScript>
- <runShellScript></runShellScript>
- <runGdbScript></runGdbScript>
+ <configGdbScript/>
+ <runShellScript/>
+ <runGdbScript/>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar>
Modified: Mercury2/scenegraph.xml
===================================================================
--- Mercury2/scenegraph.xml 2009-01-22 16:28:56 UTC (rev 150)
+++ Mercury2/scenegraph.xml 2009-03-01 16:19:05 UTC (rev 151)
@@ -20,13 +20,13 @@
<asset type="quad"/>
</node>
</node>
- <node type="rotatornode" movz="-2" scalex="0.05" scaley="0.05" scalez="0.05" >
+ <node type="rotatornode" movz="-2" scalex="0.25" scaley="0.25" scalez="0.25" >
<node type="renderablenode">
<asset type="texture" file="test.bmp"/>
<asset type="hgmdlmodel" file="beerhall.hgmdl"/>
</node>
</node>
- <node type="rotatornode" movz="-2" movx="2" scalex="0.05" scaley="0.05" scalez="0.05" >
+ <node type="rotatornode" movz="-2" movx="2" scalex="0.25" scaley="0.25" scalez="0.25" >
<node type="renderablenode">
<asset type="texture" file="test.bmp"/>
<asset type="hgmdlmodel" file="beerhall.hgmdl"/>
Modified: Mercury2/src/HGMDLMesh.cpp
===================================================================
--- Mercury2/src/HGMDLMesh.cpp 2009-01-22 16:28:56 UTC (rev 150)
+++ Mercury2/src/HGMDLMesh.cpp 2009-03-01 16:19:05 UTC (rev 151)
@@ -38,8 +38,28 @@
//fread(m_indexData.Buffer(), numIndices*sizeof(uint16_t), 1, hgmdl);
hgmdl->Read( m_indexData.Buffer(), numIndices*sizeof(uint16_t) );
}
+
+ uint32_t extraDataCount;
+ hgmdl->Read( &extraDataCount, sizeof( uint32_t ) );
+ printf("has %d extras\n", extraDataCount);
+ for (uint32_t i = 0; i < extraDataCount; ++i)
+ {
+ ReadExtraData(hgmdl);
+ }
}
+void HGMDLMesh::ReadExtraData(MercuryFile* hgmdl)
+{
+ uint32_t type, length;
+ char* data = NULL;
+ hgmdl->Read( &type, sizeof(char)*4 );
+ hgmdl->Read( &length, sizeof(uint32_t) );
+
+ data = new char[length];
+ hgmdl->Read( data, length );
+ delete data;
+}
+
/****************************************************************************
* Copyright (C) 2008 by Joshua Allen *
* *
Modified: Mercury2/src/HGMDLMesh.h
===================================================================
--- Mercury2/src/HGMDLMesh.h 2009-01-22 16:28:56 UTC (rev 150)
+++ Mercury2/src/HGMDLMesh.h 2009-03-01 16:19:05 UTC (rev 151)
@@ -8,6 +8,7 @@
{
public:
void LoadFromFile(MercuryFile* hgmdl);
+ void ReadExtraData(MercuryFile* hgmdl);
private:
MString m_name;
bool m_cachable;
Modified: Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp
===================================================================
--- Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp 2009-01-22 16:28:56 UTC (rev 150)
+++ Mercury2/tools/obj2hgmdl/obj2hgmdl.cpp 2009-03-01 16:19:05 UTC (rev 151)
@@ -4,13 +4,19 @@
#include <stdint.h>
#include <MercuryPoint.h>
#include <map>
+#include <math.h>
using namespace std;
+float min(float x, float y) { return x<y?x:y; }
+float max(float x, float y) { return x>y?x:y; }
+
vector< MercuryPoint > v;
vector< MercuryPoint > vt;
vector< MercuryPoint > vn;
+float minX, maxX, minY, maxY, minZ, maxZ;
+
struct Vertex
{
MercuryPoint uv;
@@ -25,25 +31,7 @@
vector< Vertex > vertice;
vector< uint16_t > indice;
-/*
-struct Mesh
-{
- uint32_t nameLength;
- char* name;
- bool bCache;
-
- //Mercury2 imposes a limit of 65535 vertice in one VBO mesh
- uint32_t vertexDataLength; //in bytes
- char* vertexData;
-
- //Mercury2 imposes a limit of 65535 indices in one VBO mesh
- uint16_t numberOfIndices;
- uint16_t* indices;
-};
-
-Mesh currentMesh;
-*/
void LineParser(const string &line)
{
if (line.empty()) return;
@@ -53,6 +41,14 @@
MercuryPoint tv;
sscanf(line.c_str(), "v %f %f %f", &tv.x, &tv.y, &tv.z);
v.push_back(tv);
+
+ minX = min(minX, tv.x);
+ minY = min(minY, tv.y);
+ minZ = min(minZ, tv.z);
+
+ maxX = max(maxX, tv.x);
+ maxY = max(maxY, tv.y);
+ maxZ = max(maxZ, tv.z);
}
else if (token == "vt")
{
@@ -110,6 +106,27 @@
}
}
+void WriteOBB(FILE *mbmf)
+{
+ char type[] = "OBB ";
+ fwrite(type, sizeof(char)*4, 1, mbmf);
+
+ uint32_t tmp32 = sizeof(float)*6; fwrite(&tmp32, sizeof(uint32_t), 1, mbmf);
+ float tmp[3];
+
+ //center
+ tmp[0] = (maxX-minX)/2.0f;
+ tmp[1] = (maxY-minY)/2.0f;
+ tmp[2] = (maxZ-minZ)/2.0f;
+ fwrite(tmp, sizeof(float)*3, 1, mbmf);
+
+ //extends
+ tmp[0] = fabs(tmp[0]);
+ tmp[1] = fabs(tmp[1]);
+ tmp[2] = fabs(tmp[2]);
+ fwrite(tmp, sizeof(float)*3, 1, mbmf);
+}
+
void WriteMBMF( FILE *mbmf )
{
uint32_t tmp32;
@@ -140,6 +157,9 @@
tmp16 = indice.size(); fwrite(&tmp16, sizeof(uint16_t), 1, mbmf);
for (uint16_t i = 0; i < indice.size(); ++i)
fwrite(&indice[i], sizeof(uint16_t), 1, mbmf);
+
+ tmp32 = 1; fwrite(&tmp32, sizeof(uint32_t), 1, mbmf);
+ WriteOBB(mbmf);
}
tmp32 = 0;
@@ -159,13 +179,19 @@
mbmf = fopen(argv[2], "wb");
string line;
+
+ minX = minY = minZ = 1000000.0f;
+ maxX = maxY = maxZ = -1000000.0f;
-
while ( getline(obj, line) )
{
if (line.length() > 0) LineParser(line);
}
+ printf("%f %f %f\n", minX, maxX, (maxX-minX)/2.0f );
+ printf("%f %f %f\n", minY, maxY, (maxY-minY)/2.0f );
+ printf("%f %f %f\n", minZ, maxZ, (maxZ-minZ)/2.0f );
+
WriteMBMF( mbmf );
fclose( mbmf );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Charles L. <cn...@us...> - 2009-02-25 17:12:15
|
Update of /cvsroot/hgengine/Mercury/src/ode In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv7149 Modified Files: config.h Log Message: add notification of deprication Index: config.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/ode/config.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** config.h 25 Feb 2009 17:07:10 -0000 1.5 --- config.h 25 Feb 2009 17:12:10 -0000 1.6 *************** *** 1,2 **** --- 1,8 ---- + /* + + THIS FILE IS DEPRICATED! It will be removed! You should avoid including it. + + */ + /* ode/src/config.h. Generated from config.h.in by configure. */ /* ode/src/config.h.in. Generated from configure.in by autoheader. */ |
|
From: Charles L. <cn...@us...> - 2009-02-25 17:07:19
|
Update of /cvsroot/hgengine/Mercury/src/ode In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6639 Added Files: config.h Log Message: *shrug* I guess it's necessiary --- NEW FILE: config.h --- /* ode/src/config.h. Generated from config.h.in by configure. */ /* ode/src/config.h.in. Generated from configure.in by autoheader. */ #ifndef ODE_CONFIG_H #define ODE_CONFIG_H /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ /* #undef CRAY_STACKSEG_END */ /* Define to 1 if using `alloca.c'. */ /* #undef C_ALLOCA */ /* Define to 1 if you have `alloca', as a function or macro. */ #define HAVE_ALLOCA 1 /* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). */ #define HAVE_ALLOCA_H 1 /* Use the Apple OpenGL framework. */ /* #undef HAVE_APPLE_OPENGL_FRAMEWORK */ /* Define to 1 if you have the `atan2f' function. */ #define HAVE_ATAN2F 1 /* Define to 1 if you have the `copysign' function. */ #define HAVE_COPYSIGN 1 /* Define to 1 if you have the `copysignf' function. */ #define HAVE_COPYSIGNF 1 /* Define to 1 if you have the `cosf' function. */ #define HAVE_COSF 1 /* Define to 1 if you have the <dlfcn.h> header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ /* #undef HAVE_DOPRNT */ /* Define to 1 if you have the `fabsf' function. */ #define HAVE_FABSF 1 /* Define to 1 if you have the <float.h> header file. */ #define HAVE_FLOAT_H 1 /* Define to 1 if you have the `floor' function. */ #define HAVE_FLOOR 1 /* Define to 1 if you have the `fmodf' function. */ #define HAVE_FMODF 1 /* Define to 1 if you have the `gettimeofday' function. */ #define HAVE_GETTIMEOFDAY 1 /* Define to 1 if you have the <GL/glext.h> header file. */ #define HAVE_GL_GLEXT_H 1 /* Define to 1 if you have the <GL/glu.h> header file. */ #define HAVE_GL_GLU_H 1 /* Define to 1 if you have the <GL/gl.h> header file. */ #define HAVE_GL_GL_H 1 /* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the `isnan' function. */ #define HAVE_ISNAN 1 /* Define to 1 if you have the `isnanf' function. */ #define HAVE_ISNANF 1 /* Define to 1 if you have the `m' library (-lm). */ #define HAVE_LIBM 1 /* Define to 1 if you have the `sunmath' library (-lsunmath). */ /* #undef HAVE_LIBSUNMATH */ /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #define HAVE_MALLOC 1 /* Define to 1 if you have the <malloc.h> header file. */ #define HAVE_MALLOC_H 1 /* Define to 1 if you have the <math.h> header file. */ #define HAVE_MATH_H 1 /* Define to 1 if you have the `memmove' function. */ #define HAVE_MEMMOVE 1 /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `memset' function. */ #define HAVE_MEMSET 1 /* Define to 1 if libc includes obstacks. */ #define HAVE_OBSTACK 1 /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #define HAVE_REALLOC 1 /* Define to 1 if you have the `select' function. */ #define HAVE_SELECT 1 /* Define to 1 if you have the `sinf' function. */ #define HAVE_SINF 1 /* Define to 1 if you have the `snprintf' function. */ #define HAVE_SNPRINTF 1 /* Define to 1 if you have the `sqrt' function. */ #define HAVE_SQRT 1 /* Define to 1 if you have the `sqrtf' function. */ #define HAVE_SQRTF 1 /* Define to 1 if you have the <stdarg.h> header file. */ #define HAVE_STDARG_H 1 /* Define to 1 if stdbool.h conforms to C99. */ #define HAVE_STDBOOL_H 1 /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdio.h> header file. */ #define HAVE_STDIO_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the <sys/select.h> header file. */ #define HAVE_SYS_SELECT_H 1 /* Define to 1 if you have the <sys/socket.h> header file. */ #define HAVE_SYS_SOCKET_H 1 /* Define to 1 if you have the <sys/stat.h> header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the <sys/time.h> header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the <time.h> header file. */ #define HAVE_TIME_H 1 /* Define to 1 if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the `vprintf' function. */ #define HAVE_VPRINTF 1 /* Define to 1 if you have the `vsnprintf' function. */ #define HAVE_VSNPRINTF 1 /* Define to 1 if the system has the type `_Bool'. */ #define HAVE__BOOL 1 /* Define to 1 if you have the `_isnan' function. */ /* #undef HAVE__ISNAN */ /* Define to 1 if you have the `_isnanf' function. */ /* #undef HAVE__ISNANF */ /* Define to 1 if you have the `__isnan' function. */ #define HAVE___ISNAN 1 /* Define to 1 if you have the `__isnanf' function. */ #define HAVE___ISNANF 1 /* Mac OS X version setting for OU Library */ /* #undef MAC_OS_X_VERSION */ /* Define to 1 if your C compiler doesn't accept -c and -o together. */ /* #undef NO_MINUS_C_MINUS_O */ /* Name of package */ #define PACKAGE "ode" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "od...@od..." /* Define to the full name of this package. */ #define PACKAGE_NAME "ODE" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "ODE 0.11" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "ode" /* Define to the version of this package. */ #define PACKAGE_VERSION "0.11" /* compiling for a pentium on a gcc-based platform? */ /* #undef PENTIUM */ /* Define to the type of arg 1 for `select'. */ #define SELECT_TYPE_ARG1 int /* Define to the type of args 2, 3 and 4 for `select'. */ #define SELECT_TYPE_ARG234 (fd_set *) /* Define to the type of arg 5 for `select'. */ #define SELECT_TYPE_ARG5 (struct timeval *) /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ /* #undef STACK_DIRECTION */ /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ #define VERSION "0.11" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN /* # undef WORDS_BIGENDIAN */ # endif #endif /* compiling for a X86_64 system on a gcc-based platform? */ #define X86_64_SYSTEM 1 /* Define to 1 if the X Window System is missing or not being used. */ /* #undef X_DISPLAY_MISSING */ /* libou namespace for ODE */ /* #undef _OU_NAMESPACE */ /* Target OS setting for OU Library */ /* #undef _OU_TARGET_OS */ /* Atomic API of OU is enabled */ /* #undef dATOMICS_ENABLED */ /* Generic OU features are enabled */ /* #undef dOU_ENABLED */ /* Thread Local Storage API of OU is enabled */ /* #undef dTLS_ENABLED */ /* Use an alternative trimesh-trimesh collider which should yield better results */ /* #undef dTRIMESH_OPCODE_USE_NEW_TRIMESH_TRIMESH_COLLIDER */ /* use malloc() instead of alloca() */ /* #undef dUSE_MALLOC_FOR_ALLOCA */ /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus /* #undef inline */ #endif /* Define to rpl_malloc if the replacement function should be used. */ /* #undef malloc */ /* Define to rpl_realloc if the replacement function should be used. */ /* #undef realloc */ /* Define to `unsigned int' if <sys/types.h> does not define. */ /* #undef size_t */ /* Define to empty if the keyword `volatile' does not work. Warning: valid code using `volatile' can become incorrect without. Disable with care. */ /* #undef volatile */ #ifdef HAVE_ALLOCA_H #include <alloca.h> #endif #ifdef HAVE_MALLOC_H #include <malloc.h> #endif #ifdef HAVE_STDINT_H #include <stdint.h> #endif /* an integer type that we can safely cast a pointer to and * from without loss of bits. */ typedef uintptr_t intP; // Use the error-checking memory allocation system. Because this system uses heap // (malloc) instead of stack (alloca), it is slower. However, it allows you to // simulate larger scenes, as well as handle out-of-memory errors in a somewhat // graceful manner #ifdef dUSE_MALLOC_FOR_ALLOCA enum { d_MEMORY_OK = 0, /* no memory errors */ d_MEMORY_OUT_OF_MEMORY /* malloc failed due to out of memory error */ }; #endif #ifdef dSINGLE #define dEpsilon FLT_EPSILON #else #define dEpsilon DBL_EPSILON #endif #endif /* #define ODE_CONFIG_H */ |
|
From: Charles L. <cn...@us...> - 2009-02-24 05:57:30
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv5755/src Modified Files: ScreenCopper.cpp Log Message: clean up copper's hiding and visibility as well as enabling notification for copper's state Index: ScreenCopper.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/ScreenCopper.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ScreenCopper.cpp 23 Jul 2007 02:41:13 -0000 1.32 --- ScreenCopper.cpp 24 Feb 2009 05:57:21 -0000 1.33 *************** *** 97,110 **** //First check to see if we should be hiding/showing ourselves. if ( c.code == button_showmenu && c.type == IET_RELEASE ) ! if ( GetHide() ) ! { ! this->Tweening.StopTweening(); this->Tweening.AddCommand(THEME.GetMetricS(m_name, "HideOff" )); - } else - { - this->Tweening.StopTweening(); this->Tweening.AddCommand(THEME.GetMetricS(m_name, "HideOn" )); ! } if ( GetHide() ) --- 97,111 ---- //First check to see if we should be hiding/showing ourselves. if ( c.code == button_showmenu && c.type == IET_RELEASE ) ! { ! bool bHidden = GetHide(); ! ! this->Tweening.StopTweening(); ! MESSAGEMAN.PostSystemMessage( "CopperMenuOnOffStatus", PStack( PSElement( bHidden ) ), 0.0f ); ! ! if ( bHidden ) this->Tweening.AddCommand(THEME.GetMetricS(m_name, "HideOff" )); else this->Tweening.AddCommand(THEME.GetMetricS(m_name, "HideOn" )); ! } if ( GetHide() ) |
|
From: Charles L. <cn...@us...> - 2009-02-23 20:49:28
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29543/src Modified Files: MercuryOGL.cpp Log Message: disable global ambient. This makes lights click on and off. Index: MercuryOGL.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryOGL.cpp,v retrieving revision 1.341 retrieving revision 1.342 diff -C2 -d -r1.341 -r1.342 *** MercuryOGL.cpp 23 Nov 2008 19:28:31 -0000 1.341 --- MercuryOGL.cpp 23 Feb 2009 20:49:19 -0000 1.342 *************** *** 154,157 **** --- 154,161 ---- SetStates(gls); + //OpenGL sets all lights (even those with zero ambient) to have ambient, we want to standardize it... off + float gz[4] = { 0., 0., 0., 1. }; + glLightModelfv( GL_LIGHT_MODEL_AMBIENT, gz); + return true; } |
|
From: Charles L. <cn...@us...> - 2009-02-14 05:45:09
|
Update of /cvsroot/hgengine/Mercury/src/maclib In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv18047/src/maclib Modified Files: libode.a Log Message: ODE 0.11 for the final (except PS2 and PS3) platforms! Index: libode.a =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/maclib/libode.a,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsXtyIPg and /tmp/cvsO3ZCVO differ |
|
From: Charles L. <cn...@us...> - 2009-02-13 07:39:57
|
Update of /cvsroot/hgengine/Mercury/src/linuxlib In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6404/linuxlib Modified Files: libode-i386.a Log Message: ode 0.11 wooh! Index: libode-i386.a =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/linuxlib/libode-i386.a,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsEaCBLc and /tmp/cvsh69kUP differ |
|
From: Charles L. <cn...@us...> - 2009-02-13 07:39:06
|
Update of /cvsroot/hgengine/Mercury In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6304 Removed Files: BUILD.LINUX Log Message: remove note since it no longer applies --- BUILD.LINUX DELETED --- |
|
From: Charles L. <cn...@us...> - 2009-02-13 07:23:27
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4449/src Removed Files: ode.lib Log Message: full transition to ode 0.11 --- ode.lib DELETED --- |
|
From: Charles L. <cn...@us...> - 2009-02-13 07:23:27
|
Update of /cvsroot/hgengine/Mercury In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4449 Added Files: ode_single.dll Removed Files: ode.dll opcode.dll Log Message: full transition to ode 0.11 --- NEW FILE: ode_single.dll --- (This appears to be a binary file; contents omitted.) --- opcode.dll DELETED --- --- ode.dll DELETED --- |
|
From: Charles L. <cn...@us...> - 2009-02-13 07:23:02
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4378 Modified Files: Mercury-VC2008.vcproj MercuryODE.cpp Added Files: ode_single.lib Log Message: Fix visual studio project file and transition over to ode 0.11 --- NEW FILE: ode_single.lib --- (This appears to be a binary file; contents omitted.) Index: MercuryODE.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryODE.cpp,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** MercuryODE.cpp 13 Feb 2009 03:56:51 -0000 1.102 --- MercuryODE.cpp 13 Feb 2009 07:22:57 -0000 1.103 *************** *** 8,12 **** #include "MercuryPoly.h" ! #if ( defined( HAVE_ODE_STATIC ) ) extern "C" { --- 8,12 ---- #include "MercuryPoly.h" ! #if ( defined( HAVE_ODE_STATIC ) || ( defined(WIN32) && !defined(__GNUC__)) ) extern "C" { *************** *** 16,21 **** #if defined(WIN32) && !defined(__GNUC__) ! #pragma comment(lib, "ode.lib") ! void dInitODE() { } //XXX: The "ok" version for windows is REALLY old; before they had InitODE #endif --- 16,20 ---- #if defined(WIN32) && !defined(__GNUC__) ! #pragma comment(lib, "ode_single.lib") #endif *************** *** 244,248 **** { dMass pTempCyl; ! pTempCyl.setCappedCylinder( fDensity, 1, pINI.GetValueF( sShapeName, sPieceName + "Radius", 1 ), pINI.GetValueF( sShapeName, sPieceName + "Length", 1 )/2 ); --- 243,247 ---- { dMass pTempCyl; ! pTempCyl.setCapsule( fDensity, 1, pINI.GetValueF( sShapeName, sPieceName + "Radius", 1 ), pINI.GetValueF( sShapeName, sPieceName + "Length", 1 )/2 ); Index: Mercury-VC2008.vcproj =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/Mercury-VC2008.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mercury-VC2008.vcproj 3 Oct 2008 00:14:17 -0000 1.1 --- Mercury-VC2008.vcproj 13 Feb 2009 07:22:56 -0000 1.2 *************** *** 70,74 **** <Tool Name="VCPreLinkEventTool" ! CommandLine="Crash\windows\verinc2" /> <Tool --- 70,74 ---- <Tool Name="VCPreLinkEventTool" ! CommandLine="" /> <Tool *************** *** 107,111 **** <Tool Name="VCPostBuildEventTool" ! CommandLine="Crash\Windows\mapconv2 $(IntDir)/$(TargetName).map $(TargetDir)$(TargetName).vdi" /> </Configuration> --- 107,111 ---- <Tool Name="VCPostBuildEventTool" ! CommandLine="" /> </Configuration> *************** *** 268,280 **** <Tool Name="VCPreLinkEventTool" ! CommandLine="Crash\windows\verinc2" /> <Tool Name="VCLinkerTool" ! AdditionalDependencies="OpenGL32.lib GLu32.lib odbc32.lib odbccp32.lib libpng.lib zdll.lib Winmm.lib freetype.lib ode.lib" ! OutputFile=".\../Release/Mercury-VC2003.exe" LinkIncremental="2" SuppressStartupBanner="true" ! IgnoreDefaultLibraryNames="libci.lib" GenerateDebugInformation="false" ProgramDatabaseFile=".\../Release/Mercury-VC2003.pdb" --- 268,281 ---- <Tool Name="VCPreLinkEventTool" ! CommandLine="" /> <Tool Name="VCLinkerTool" ! AdditionalDependencies="OpenGL32.lib GLu32.lib odbc32.lib odbccp32.lib libpng.lib zdll.lib Winmm.lib freetype.lib" ! OutputFile="C:\Mercury\Mercury.exe" LinkIncremental="2" SuppressStartupBanner="true" ! IgnoreAllDefaultLibraries="false" ! IgnoreDefaultLibraryNames="libci.lib,LIBCMT.lib,libcmt.lib" GenerateDebugInformation="false" ProgramDatabaseFile=".\../Release/Mercury-VC2003.pdb" *************** *** 307,311 **** <Tool Name="VCPostBuildEventTool" ! CommandLine="Crash\Windows\mapconv2 $(IntDir)\$(TargetName).map $(TargetDir)$(TargetName).vdi" /> </Configuration> --- 308,312 ---- <Tool Name="VCPostBuildEventTool" ! CommandLine="" /> </Configuration> *************** *** 680,892 **** > <File ! RelativePath="Crash\archCrash.h" ! > ! </File> ! <File ! RelativePath="Crash\Windows\BACKUPCrash.h" ! > ! </File> ! <File ! RelativePath="Crash\Windows\Crash.cpp" ! > ! <FileConfiguration ! Name="Debug|Win32" ! > ! <Tool ! Name="VCCLCompilerTool" ! AdditionalIncludeDirectories="" ! PreprocessorDefinitions="" ! BasicRuntimeChecks="3" ! BrowseInformation="1" ! /> ! </FileConfiguration> ! <FileConfiguration ! Name="AllIn|Win32" ! > ! <Tool ! Name="VCCLCompilerTool" ! Optimization="2" ! AdditionalIncludeDirectories="" ! PreprocessorDefinitions="" ! /> ! </FileConfiguration> ! <FileConfiguration ! Name="Release|Win32" ! > ! <Tool ! Name="VCCLCompilerTool" ! Optimization="2" ! AdditionalIncludeDirectories="" ! PreprocessorDefinitions="" ! /> ! </FileConfiguration> ! <FileConfiguration ! Name="Debug_Memory|Win32" ! > ! <Tool ! Name="VCCLCompilerTool" ! AdditionalIncludeDirectories="" ! PreprocessorDefinitions="" ! BasicRuntimeChecks="3" ! BrowseInformation="1" ! /> ! </FileConfiguration> ! </File> ! <File ! RelativePath="Crash\Windows\Crash.h" ! > ! </File> ! <File ! RelativePath="Crash\crashDefines.cpp" ! > ! <FileConfiguration ! Name="Debug|Win32" ! > ! <Tool ! Name="VCCLCompilerTool" ! AdditionalIncludeDirectories="" ! PreprocessorDefinitions="" ! BasicRuntimeChecks="3" ! BrowseInformation="1" ! /> ! </FileConfiguration> ! <FileConfiguration ! Name="AllIn|Win32" ! > ! <Tool ! Name="VCCLCompilerTool" ! Optimization="2" ! AdditionalIncludeDirectories="" ! PreprocessorDefinitions="" ! /> ! </FileConfiguration> ! <FileConfiguration ! Name="Release|Win32" ! > ! <Tool ! Name="VCCLCompilerTool" ! Optimization="2" ! AdditionalIncludeDirectories="" ! PreprocessorDefinitions="" ! /> ! </FileConfiguration> ! <FileConfiguration ! Name="Debug_Memory|Win32" ! > ! <Tool ! Name="VCCLCompilerTool" ! AdditionalIncludeDirectories="" ! PreprocessorDefinitions="" ! BasicRuntimeChecks="3" ! BrowseInformation="1" ! /> ! </FileConfiguration> ! </File> ! <File ! RelativePath="Crash\crashDefines.h" ! > ! </File> ! <File ! RelativePath="Crash\Windows\RestartProgram.cpp" ! > ! <FileConfiguration ! Name="Debug|Win32" ! > ! <Tool ! Name="VCCLCompilerTool" ! AdditionalIncludeDirectories="" ! PreprocessorDefinitions="" ! BasicRuntimeChecks="3" ! BrowseInformation="1" ! /> ! </FileConfiguration> ! <FileConfiguration ! Name="AllIn|Win32" ! > ! <Tool ! Name="VCCLCompilerTool" ! Optimization="2" ! AdditionalIncludeDirectories="" ! PreprocessorDefinitions="" ! /> ! </FileConfiguration> ! <FileConfiguration ! Name="Release|Win32" ! > ! <Tool ! Name="VCCLCompilerTool" ! Optimization="2" ! AdditionalIncludeDirectories="" ! PreprocessorDefinitions="" ! /> ! </FileConfiguration> ! <FileConfiguration ! Name="Debug_Memory|Win32" ! > ! <Tool ! Name="VCCLCompilerTool" ! AdditionalIncludeDirectories="" ! PreprocessorDefinitions="" ! BasicRuntimeChecks="3" ! BrowseInformation="1" ! /> ! </FileConfiguration> ! </File> ! <File ! RelativePath="Crash\Windows\RestartProgram.h" > </File> <File ! RelativePath="Crash\StdString.h" > </File> <File ! RelativePath="Crash\Windows\verstub.cpp" > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - BasicRuntimeChecks="3" - BrowseInformation="1" - /> - </FileConfiguration> - <FileConfiguration - Name="AllIn|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - Optimization="2" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug_Memory|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - BasicRuntimeChecks="3" - BrowseInformation="1" - /> - </FileConfiguration> </File> <File ! RelativePath="Crash\Windows\WindowsResources.h" > </File> --- 681,697 ---- > <File ! RelativePath=".\Crash\cnbacktrace.c" > </File> <File ! RelativePath=".\Crash\cnbacktrace.h" > </File> <File ! RelativePath=".\Crash\cncrash.c" > </File> <File ! RelativePath=".\Crash\cncrash.h" > </File> |
|
From: Charles L. <cn...@us...> - 2009-02-13 07:18:19
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv3552 Added Files: ogg.lib vorbis.lib Log Message: I think these are needed - I have no idea why I haven't committed them earlier. --- NEW FILE: vorbis.lib --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ogg.lib --- (This appears to be a binary file; contents omitted.) |
|
From: Charles L. <cn...@us...> - 2009-02-13 03:56:58
|
Update of /cvsroot/hgengine/Mercury/src/linuxlib In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv13225/src/linuxlib Modified Files: README libode-x86_64.a Log Message: new ODE, and all static ODEs are upgraded. Index: README =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/linuxlib/README,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** README 18 Nov 2008 23:20:27 -0000 1.1 --- README 13 Feb 2009 03:56:51 -0000 1.2 *************** *** 15,16 **** --- 15,20 ---- It is suggested when compiling Mercury as a library and need ODE, you use the static ODE libraries. + + + In .11 we go back to trying to use opcode, so it seems to work much better. + ./configure --with-pic --with-trimesh=opcode --enable-new-trimesh --enable-release --disable-asserts Index: libode-x86_64.a =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/linuxlib/libode-x86_64.a,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsDR9wcZ and /tmp/cvsDyp0tk differ |