You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(140) |
Feb
(98) |
Mar
(152) |
Apr
(104) |
May
(71) |
Jun
(94) |
Jul
(169) |
Aug
(83) |
Sep
(47) |
Oct
(134) |
Nov
(7) |
Dec
(20) |
| 2004 |
Jan
(41) |
Feb
(14) |
Mar
(42) |
Apr
(47) |
May
(68) |
Jun
(143) |
Jul
(65) |
Aug
(29) |
Sep
(40) |
Oct
(34) |
Nov
(33) |
Dec
(97) |
| 2005 |
Jan
(29) |
Feb
(30) |
Mar
(9) |
Apr
(37) |
May
(13) |
Jun
(31) |
Jul
(22) |
Aug
(23) |
Sep
|
Oct
(37) |
Nov
(34) |
Dec
(117) |
| 2006 |
Jan
(48) |
Feb
(6) |
Mar
(2) |
Apr
(71) |
May
(10) |
Jun
(16) |
Jul
(7) |
Aug
(1) |
Sep
(14) |
Oct
(17) |
Nov
(25) |
Dec
(26) |
| 2007 |
Jan
(8) |
Feb
(2) |
Mar
(7) |
Apr
(26) |
May
|
Jun
(12) |
Jul
(30) |
Aug
(14) |
Sep
(9) |
Oct
(4) |
Nov
(7) |
Dec
(6) |
| 2008 |
Jan
(10) |
Feb
(10) |
Mar
(6) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(18) |
Aug
(15) |
Sep
(16) |
Oct
(5) |
Nov
(3) |
Dec
(10) |
| 2009 |
Jan
(11) |
Feb
(2) |
Mar
|
Apr
(15) |
May
(31) |
Jun
(18) |
Jul
(11) |
Aug
(26) |
Sep
(52) |
Oct
(17) |
Nov
(4) |
Dec
|
| 2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <de...@us...> - 2003-04-18 11:26:23
|
Update of /cvsroot/csp/THIRDPARTYLIBS/demeter
In directory sc8-pr-cvs1:/tmp/cvs-serv1809
Modified Files:
Terrain.cpp DemeterVisualC6.vcproj CHANGES.current
Log Message:
no message
Index: Terrain.cpp
===================================================================
RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/Terrain.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Terrain.cpp 18 Apr 2003 11:10:00 -0000 1.5
--- Terrain.cpp 18 Apr 2003 11:26:17 -0000 1.6
***************
*** 19,23 ****
*/
! #ifdef _WIN32
#pragma warning( disable : 4786 )
#endif
--- 19,23 ----
*/
! # if defined(_MSC_VER) && (_MSC_VER <= 1300)
#pragma warning( disable : 4786 )
#endif
***************
*** 58,63 ****
//#endif
- #define _PROTECT_ACCESS_
-
#include "Terrain.h"
#include "BitArray.h"
--- 58,61 ----
***************
*** 1627,1632 ****
HGLRC currentContext = wglGetCurrentContext();
bool found = false;
! for (i = 0; i < m_SharedContexts.size() && !found; i++)
! found = (m_SharedContexts[i] == currentContext);
if (!found)
{
--- 1625,1630 ----
HGLRC currentContext = wglGetCurrentContext();
bool found = false;
! for (unsigned k = 0; k < m_SharedContexts.size() && !found; k++)
! found = (m_SharedContexts[k] == currentContext);
if (!found)
{
***************
*** 1997,2001 ****
m_pTextureSet->Write(file,this);
! for (int i = 0; i < m_TextureCells.size(); i++)
m_TextureCells[i]->Write(file,this);
fclose(file);
--- 1995,1999 ----
m_pTextureSet->Write(file,this);
! for (unsigned i = 0; i < m_TextureCells.size(); i++)
m_TextureCells[i]->Write(file,this);
fclose(file);
***************
*** 2049,2053 ****
void Terrain::PreloadTextures()
{
! for (int i = 0; i < m_TextureCells.size(); i++)
{
m_TextureCells[i]->BindTexture();
--- 2047,2051 ----
void Terrain::PreloadTextures()
{
! for (unsigned i = 0; i < m_TextureCells.size(); i++)
{
m_TextureCells[i]->BindTexture();
***************
*** 3758,3768 ****
Uint8 useCompression;
fread(&useCompression,sizeof(Uint8),1,file);
! m_UseCompression = (bool)useCompression;
Uint8 bClamp;
fread(&bClamp,sizeof(Uint8),1,file);
! m_bClamp = (bool)bClamp;
Uint8 bAlpha;
fread(&bAlpha,sizeof(Uint8),1,file);
! m_bAlpha = (bool)bAlpha;
if (m_szFilename == NULL)
{
--- 3756,3766 ----
Uint8 useCompression;
fread(&useCompression,sizeof(Uint8),1,file);
! m_UseCompression = useCompression != 0;
Uint8 bClamp;
fread(&bClamp,sizeof(Uint8),1,file);
! m_bClamp = bClamp != 0;
Uint8 bAlpha;
fread(&bAlpha,sizeof(Uint8),1,file);
! m_bAlpha = bAlpha != 0;
if (m_szFilename == NULL)
{
Index: DemeterVisualC6.vcproj
===================================================================
RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/DemeterVisualC6.vcproj,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DemeterVisualC6.vcproj 6 Apr 2003 10:39:18 -0000 1.1
--- DemeterVisualC6.vcproj 18 Apr 2003 11:26:17 -0000 1.2
***************
*** 23,27 ****
Optimization="0"
AdditionalIncludeDirectories="..\Include,..\Include\SDL"
! PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_USRDLL;DEMETERVISUALC6_EXPORTS;TERRAIN_EXPORTS;_PROTECT_ACCESS_;_STLP_USE_OWN_NAMESPACE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
--- 23,27 ----
Optimization="0"
AdditionalIncludeDirectories="..\Include,..\Include\SDL"
! PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_USRDLL;DEMETERVISUALC6_EXPORTS;TERRAIN_EXPORTS"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
***************
*** 83,87 ****
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\include"
! PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_USRDLL;DEMETERVISUALC6_EXPORTS;TERRAIN_EXPORTS;_STLP_USE_OWN_NAMESPACE"
StringPooling="TRUE"
RuntimeLibrary="0"
--- 83,87 ----
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\include"
! PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_USRDLL;DEMETERVISUALC6_EXPORTS;TERRAIN_EXPORTS"
StringPooling="TRUE"
RuntimeLibrary="0"
Index: CHANGES.current
===================================================================
RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/CHANGES.current,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** CHANGES.current 18 Apr 2003 11:10:00 -0000 1.4
--- CHANGES.current 18 Apr 2003 11:26:17 -0000 1.5
***************
*** 2,5 ****
--- 2,9 ----
===========================
+ 2003-04-18: delta
+ Checked Onsight changes. got ride of some vc++ warnings.
+ Updated .NET project.
+
2003-04-18: onsight
Changed Terrain and TerrainLattice to inherit from
|
|
From: <mk...@us...> - 2003-04-18 11:10:11
|
Update of /cvsroot/csp/THIRDPARTYLIBS/demeter
In directory sc8-pr-cvs1:/tmp/cvs-serv28584
Modified Files:
CHANGES CHANGES.current Terrain.cpp Terrain.h aclocal.m4
configure
Log Message:
see CHANGES.current
Index: CHANGES
===================================================================
RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/CHANGES,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CHANGES 15 Mar 2003 02:27:15 -0000 1.1
--- CHANGES 18 Apr 2003 11:10:00 -0000 1.2
***************
*** 2,5 ****
--- 2,18 ----
to CVS.
+ Version 0.3.1 (2003-04-18)
+ ===========================
+
+ 2003-04-06: delta
+ Committed .net project
+
+ 2003-03-14: onsight
+ First log entry: this is the format.
+
+ 2003-03-15: onsight
+ Changed configure.in to require autoconf 2.57
+
+
Version 0.3.0 (2003-03-14)
===========================
Index: CHANGES.current
===================================================================
RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/CHANGES.current,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CHANGES.current 6 Apr 2003 10:39:18 -0000 1.3
--- CHANGES.current 18 Apr 2003 11:10:00 -0000 1.4
***************
*** 1,12 ****
! Version 0.3.1 (in progress)
===========================
! 2003-04-06: delta
! Committed .net project
!
! 2003-03-14: onsight
! First log entry: this is the format.
! 2003-03-15: onsight
! Changed configure.in to require autoconf 2.57
--- 1,19 ----
! Version 0.3.2 (in progress)
===========================
! 2003-04-18: onsight
! Changed Terrain and TerrainLattice to inherit from
! osg::Referenced instead of just implementing compatible
! reference counting methods.
! Added DETAIL_TEXTURE_SIZE #define so that larger detail
! textures can be used. The original value was 256, but
! 512 works fine and so should larger sizes (although I
! haven't tested these). Ideally the size would be
! determined at runtime from the actual texture image, but
! this was the simplest approach for now. Note that
! Demeter will crash if the texture size exceeds the value
! of DETAIL_TEXTURE_SIZE. Textures that are smaller than
! DETAIL_TEXTURE_SIZE do not seem to cause a problem. The
! default setting is now 512.
Index: Terrain.cpp
===================================================================
RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/Terrain.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Terrain.cpp 6 Apr 2003 10:39:18 -0000 1.4
--- Terrain.cpp 18 Apr 2003 11:10:00 -0000 1.5
***************
*** 31,34 ****
--- 31,36 ----
#include "assert.h"
+ #define DETAIL_TEXTURE_SIZE 512
+
#ifdef _WIN32
#include "io.h"
***************
*** 641,645 ****
Terrain::Terrain(int widthVertices,int heightVertices,float vertexSpacing,int maxNumTriangles,bool bUseBorders)
{
- m_refCount = 0;
m_pCommonTexture = NULL;
m_pTriangleStrips = NULL;
--- 643,646 ----
***************
*** 671,675 ****
Terrain::Terrain(const float* pElevations,int elevWidth,int elevHeight,const Uint8* pTextureImage,int textureWidth,int textureHeight,const Uint8* pDetailTextureImage,int detailWidth,int detailHeight,float vertexSpacing,float elevationScale,int maxNumTriangles,bool bUseBorders,float offsetX,float offsetY,int numTexturesX,int numTexturesY)
{
- m_refCount = 0;
m_pCommonTexture = NULL;
m_pTriangleStrips = NULL;
--- 672,675 ----
***************
*** 696,700 ****
Terrain::Terrain(const char* szElevationsFilename,const char* szTextureFilename,const char* szDetailTextureFilename,float vertexSpacing,float elevationScale,int maxNumTriangles,bool bUseBorders,float offsetX,float offsetY,int numTexturesX,int numTexturesY)
{
- m_refCount = 0;
m_pCommonTexture = NULL;
m_pTriangleStrips = NULL;
--- 696,699 ----
***************
*** 1022,1025 ****
--- 1021,1026 ----
vertexX = indexX * m_VertexSpacing;
vertexY = indexY * m_VertexSpacing;
+ #define NOSLOWNORMAL
+ #ifdef SLOWNORMAL
/*
// This average over 8 nearby normals is extremely slow compared
***************
*** 1035,1038 ****
--- 1036,1040 ----
// operates on vertices near the edges of the terrain tiles.
// -MR
+ */
Vector avgNormal;
avgNormal.x = avgNormal.y = avgNormal.z = 0.0f;
***************
*** 1055,1059 ****
m_pNormals[i].y = avgNormal.y / 8.0f;
m_pNormals[i].z = avgNormal.z / 8.0f;
! */
float nx, ny, nz;
GetNormal(vertexX+0.2,vertexY+0.8,nx,ny,nz);
--- 1057,1061 ----
m_pNormals[i].y = avgNormal.y / 8.0f;
m_pNormals[i].z = avgNormal.z / 8.0f;
! #else
float nx, ny, nz;
GetNormal(vertexX+0.2,vertexY+0.8,nx,ny,nz);
***************
*** 1061,1064 ****
--- 1063,1067 ----
m_pNormals[i].y = ny;
m_pNormals[i].z = nz;
+ #endif
}
}
***************
*** 3128,3131 ****
--- 3131,3135 ----
TerrainLattice::~TerrainLattice()
{
+ cout << "~TerrainLattice()\n";
if (Settings::GetInstance()->IsVerbose())
{
***************
*** 3803,3811 ****
if (pTexture)
{
! Uint8* pBuffer = new Uint8[256*256*4];
! memset(pBuffer,255,256*256*4);
! for (int i = 3; i < 256*256*4; i += 4)
pBuffer[i] = 0;
! Texture* pMask = new Texture(pBuffer,256,256,256,0,true,false,true);
delete[] pBuffer;
DetailTexture* pDetail = new DetailTexture;
--- 3807,3816 ----
if (pTexture)
{
! int bytes = DETAIL_TEXTURE_SIZE*DETAIL_TEXTURE_SIZE*4;
! Uint8* pBuffer = new Uint8[bytes];
! memset(pBuffer,255,bytes);
! for (int i = 3; i < bytes; i += 4)
pBuffer[i] = 0;
! Texture* pMask = new Texture(pBuffer,DETAIL_TEXTURE_SIZE,DETAIL_TEXTURE_SIZE,DETAIL_TEXTURE_SIZE,0,true,false,true);
delete[] pBuffer;
DetailTexture* pDetail = new DetailTexture;
Index: Terrain.h
===================================================================
RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/Terrain.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Terrain.h 10 Apr 2003 01:32:17 -0000 1.5
--- Terrain.h 18 Apr 2003 11:10:01 -0000 1.6
***************
*** 70,73 ****
--- 70,75 ----
#include <vector>
+ #include <osg/Referenced>
+
//#include "mmgr.h"
***************
*** 274,278 ****
/// This class represents a single, contiguous chunk of terrain and is the primary public interface to Demeter. Most applications will create a single instance of this class to represent the terrain in the application, but multiple instances can be used to stitch together a very large world comprised of multiple terrains using the TerrainLattice class.
! class TERRAIN_API Terrain
{
public:
--- 276,280 ----
/// This class represents a single, contiguous chunk of terrain and is the primary public interface to Demeter. Most applications will create a single instance of this class to represent the terrain in the application, but multiple instances can be used to stitch together a very large world comprised of multiple terrains using the TerrainLattice class.
! class TERRAIN_API Terrain: public osg::Referenced
{
public:
***************
*** 371,382 ****
void SetTextureCell(int index,TextureCell* pCell);
enum DIRECTION {DIR_NORTH = 0,DIR_NORTHEAST = 1,DIR_EAST = 2,DIR_SOUTHEAST = 3,DIR_SOUTH = 4,DIR_SOUTHWEST = 5,DIR_WEST = 6,DIR_NORTHWEST = 7,DIR_CENTER = 8,DIR_INVALID = 9};
- /// Increment the reference count by one, indicating that this object has another pointer which is referencing it.
int GetTerrainPolygonsRendered();
- inline void ref() const { ++m_refCount; }
- /// Decrement the reference count by one, indicating that a pointer to this object is referencing it. If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
- inline void unref() const { --m_refCount; if (m_refCount<=0) delete this; }
private:
void Init(const Uint8* pTextureImage,int textureWidth,int textureHeight,const Uint8* pDetailTextureImage,int detailWidth,int detailHeight,bool bUseBorders,float offsetX = 0.0f,float offsetY = 0.0f,int numTexturesX = 0,int numTexturesY = 0);
--- 373,380 ----
***************
*** 422,426 ****
float* m_pTextureDetail;
Vector* m_pNormals;
- mutable int m_refCount;
#ifdef _WIN32
static vector<HGLRC> m_SharedContexts;
--- 420,423 ----
***************
*** 636,640 ****
};
! class TERRAIN_API TerrainLattice
{
public:
--- 633,637 ----
};
! class TERRAIN_API TerrainLattice: public osg::Referenced
{
public:
***************
*** 662,670 ****
- /// Increment the reference count by one, indicating that this object has another pointer which is referencing it.
- inline void ref() const { ++m_refCount; }
- /// Decrement the reference count by one, indicating that a pointer to this object is referencing it. If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
- inline void unref() const { /*assert(m_refCount > 0);*/ if (m_refCount > 0) {--m_refCount; if (m_refCount==0 && this) delete this;} }
-
private:
vector<TerrainLoadListener*> m_TerrainLoadListeners;
--- 659,662 ----
***************
*** 693,697 ****
int m_FactoryTilesHeight;
float m_fThreshold;
- mutable int m_refCount;
};
--- 685,688 ----
Index: aclocal.m4
===================================================================
RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/aclocal.m4,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** aclocal.m4 9 Dec 2002 01:33:51 -0000 1.2
--- aclocal.m4 18 Apr 2003 11:10:01 -0000 1.3
***************
*** 1,13 ****
! dnl aclocal.m4 generated automatically by aclocal 1.4
! dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
! dnl This file is free software; the Free Software Foundation
! dnl gives unlimited permission to copy and/or distribute it,
! dnl with or without modifications, as long as this notice is preserved.
! dnl This program is distributed in the hope that it will be useful,
! dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
! dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
! dnl PARTICULAR PURPOSE.
--- 1,14 ----
! # generated automatically by aclocal 1.7.2 -*- Autoconf -*-
! # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
! # Free Software Foundation, Inc.
! # This file is free software; the Free Software Foundation
! # gives unlimited permission to copy and/or distribute it,
! # with or without modifications, as long as this notice is preserved.
! # This program is distributed in the hope that it will be useful,
! # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
! # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
! # PARTICULAR PURPOSE.
Index: configure
===================================================================
RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/configure,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** configure 9 Dec 2002 01:33:51 -0000 1.2
--- configure 18 Apr 2003 11:10:02 -0000 1.3
***************
*** 1,5 ****
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
! # Generated by GNU Autoconf 2.54 for CSP-demeter 0.1.
#
# Report bugs to <http://csp.sourceforge.net>.
--- 1,5 ----
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
! # Generated by GNU Autoconf 2.57 for CSP-demeter 0.1.
#
[...1496 lines suppressed...]
{ echo "$as_me:$LINENO: $ac_file is unchanged" >&5
echo "$as_me: $ac_file is unchanged" >&6;}
***************
*** 4553,4558 ****
if test "$no_create" != yes; then
ac_cs_success=:
exec 5>/dev/null
! $SHELL $CONFIG_STATUS || ac_cs_success=false
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
--- 4801,4809 ----
if test "$no_create" != yes; then
ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
exec 5>/dev/null
! $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
|
|
From: <mk...@us...> - 2003-04-16 21:05:08
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Tools/XML
In directory sc8-pr-cvs1:/tmp/cvs-serv30637/XML
Added Files:
falcon_acdata.py
Log Message:
xml and data processing tools
--- NEW FILE: falcon_acdata.py ---
import sys
class Data: pass
class Table:
def __init__(self, xbreaks, ybreaks, table):
self.x = xbreaks
self.y = ybreaks
self.table = table
class hnum:
def __init__(self, id, scale=1.0):
self.id = id
self.scale = scale
def process(self, data, line):
setattr(data, self.id, float(line)*self.scale);
return 1
class hsub:
def __init__(self, id, opts):
self.id = id
self.opts = opts
def process(self, data, line):
d = Data()
line = line.split()
for idx in range(len(line)):
self.opts[idx].process(d, line[idx])
if not hasattr(data, self.id):
setattr(data, self.id, d);
return 1
class hnumlist:
def __init__(self, id, scale=1.0):
self.id = id
self.state = 0
self.scale = scale
def process(self, data, line):
if self.state == 0:
self.state = 1
self.count = int(line)
self.list = []
return 0
self.list += map(float, line.split())
if len(self.list) < self.count: return 0
self.list = map(lambda x, s=self.scale: x*s, self.list)
setattr(data, self.id, self.list)
return 1
class htable:
def __init__(self, id, xbreaks, ybreaks, scale=1.0):
self.id = id
self.current = []
self.table = []
self.xbreaks = xbreaks
self.ybreaks = ybreaks
self.scale = scale
def process(self, data, line):
xbreaks = getattr(data, self.xbreaks)
ybreaks = getattr(data, self.ybreaks)
self.current += map(float, line.split())
if len(self.current) > len(ybreaks): raise "fubar table"
if len(self.current) == len(ybreaks):
self.current = map(lambda x, s=self.scale: x*s, self.current)
self.table.append(self.current)
if len(self.table) == len(xbreaks):
table = Table(xbreaks, ybreaks, self.table)
setattr(data, self.id, table)
return 1
self.current = []
return 0
class ACData:
handlers = [
hnum("empty_weight"),
hnum("reference_area"),
hnum("internal_fuel"),
hnum("aoa_max"),
hnum("aoa_min"),
hnum("beta_max"),
hnum("beta_min"),
hnum("max_g"),
hnum("max_roll"),
hnum("min_vcas"),
hnum("max_vcas"),
hnum("corner_vcas"),
hnum("theta_max"),
hnum("num_gear"),
hsub("gear1", (hnum("x"), hnum("y"), hnum("z"), hnum("rng"))),
hsub("gear2", (hnum("x"), hnum("y"), hnum("z"), hnum("rng"))),
hsub("gear3", (hnum("x"), hnum("y"), hnum("z"), hnum("rng"))),
hnum("cg_loc"),
hnum("length"),
hnum("span"),
hnum("fuselage_radius"),
hnum("tail_height"),
hnumlist("aero_mach_breaks"),
hnumlist("aero_alpha_breaks"),
hnum("c_l_multiplier"),
htable("c_l", "aero_mach_breaks", "aero_alpha_breaks"),
hnum("c_d_multiplier"),
htable("c_d", "aero_mach_breaks", "aero_alpha_breaks"),
hnum("c_y_multiplier"),
htable("c_y", "aero_mach_breaks", "aero_alpha_breaks"),
hnum("thrust_multiplier"),
hnum("fuel_flow_multiplier"),
hnumlist("thrust_mach_breaks"),
hnumlist("thrust_altitude_breaks", 0.3048),
htable("idle_thrust", "thrust_altitude_breaks", "thrust_mach_breaks", 0.4545),
htable("mil_thrust", "thrust_altitude_breaks", "thrust_mach_breaks", 0.4545),
htable("ab_thrust", "thrust_altitude_breaks", "thrust_mach_breaks", 0.4545),
]
def __init__(self):
self.data = Data()
def parse(self, f):
idx = 0
line_no = 0
for line in f.xreadlines():
line_no = line_no + 1
comment = line.find('#')
if comment >= 0:
line = line[:comment]
line = line.strip()
if line == "": continue
try:
done = self.handlers[idx].process(self.data, line)
except:
print "Error parsing input, line %d" % line_no
raise
if done:
idx = idx + 1
if idx >= len(self.handlers): break
class Tabpr:
tabs = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t"
def __init__(self, indent):
indent = self.tabs[:indent]
self._indent = indent
def __call__(self, *args):
print "%s%s" % (self._indent, " ".join(map(str,args)))
def indent(self, n=1):
if n < 0: self._indent = self._indent[:n]
if n > 0: self._indent = self._indent + self.tabs[:n]
def table_xml(self, id, table, xspacing=1, yspacing=1, indent=0):
tabpr = self.Tabpr(indent)
tabpr("<Table name='%s'>" % id)
tabpr.indent()
tabpr("<XBreaks spacing='%s'>" % str(xspacing))
tabpr.indent()
tabpr(*table.x)
tabpr.indent(-1)
tabpr("</XBreaks>")
tabpr("<YBreaks spacing='%s'>" % str(yspacing))
tabpr.indent()
tabpr(*table.y)
tabpr.indent(-1)
tabpr("</YBreaks>")
tabpr("<Values>")
tabpr.indent()
for curve in table.table:
tabpr(*curve)
tabpr.indent(-1)
tabpr("</Value>")
tabpr.indent(-1)
tabpr("</Table>")
def engine_xml(self):
self.table_xml("idle_thrust", self.data.idle_thrust, 1000.0, 0.1, 1)
self.table_xml("mil_thrust", self.data.mil_thrust, 1000.0, 0.1, 1)
self.table_xml("ab_thrust", self.data.ab_thrust, 1000.0, 0.1, 1)
f = sys.stdin
ac = ACData()
ac.parse(f)
ac.engine_xml()
|
|
From: <mk...@us...> - 2003-04-16 21:03:57
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Tools/XML In directory sc8-pr-cvs1:/tmp/cvs-serv30130/XML Log Message: Directory /cvsroot/csp/APPLICATIONS/CSPSim/Tools/XML added to the repository |
|
From: <mk...@us...> - 2003-04-12 22:34:37
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv3057/Include Added Files: Exception.h Log Message: see CHANGES.current --- NEW FILE: Exception.h --- // Combat Simulator Project - FlightSim Demo // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file Exception.h * **/ #ifndef __CSP_EXCEPTION_H__ #define __CSP_EXCEPTION_H__ #include <SimData/Exception.h> #include "DemeterException.h" namespace csp { /** * Base class for all CSP exceptions */ class Exception: public simdata::ExceptionBase { public: Exception::Exception(std::string type="Exception", std::string msg=""): simdata::ExceptionBase(type, msg) {} }; #define CSP_EXCEPTION(a) \ class a: public Exception { \ public: \ a(std::string msg=""): \ Exception(#a, msg) { } \ }; // Some common CSP exception classes CSP_EXCEPTION(DataError); CSP_EXCEPTION(DataArchiveError); // Fatal error messages void FatalException(Exception &e, std::string const &location); void DemeterFatalException(DemeterException &e, std::string const &location); void SimDataFatalException(simdata::Exception &e, std::string const &location); void OtherFatalException(std::string const &location); } // namespace csp #endif // __CSP_EXCEPTION_H__ |
|
From: <mk...@us...> - 2003-04-12 22:34:37
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv3057/Source Modified Files: CSPSim.cpp Makefile.in Sky.cpp Added Files: Exception.cpp Log Message: see CHANGES.current --- NEW FILE: Exception.cpp --- // Combat Simulator Project - FlightSim Demo // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file Exception.cpp * **/ #include "Exception.h" #include "LogStream.h" #include <cstdio> #include <iostream> #include "DemeterException.h" #include <SimData/Exception.h> namespace csp { void FatalException(Exception &e, std::string const &location) { DataError *pDataError = dynamic_cast<DataError*> (&e); CSP_LOG(CSP_APP, CSP_ERROR, "CSPSim: caught exception in " << location << ": " << e.getMessage()); std::cerr << "\n"; e.details(); std::cerr << "\n"; if (pDataError) { std::cerr << "Please check that the data paths in CSPSim.ini are set to reasonable\n" << "values (CSPSim.ini is usually found in CSPSim/Data). If you appear\n" << "to be missing a necessary data file, please check the CSP download\n" << "page for the latest data releases or ask for assistance on the CSP\n" << "forums:\n" << " http://csp.sourceforge.net/forum\n"; } else { std::cerr << "CSPSim: caught an exception. Please report this along with\n" << "as much information as possible about what was happening at \n" << "the time of the error to the CSP forum at\n" << " http://csp.sourceforge.net/forum\n"; } std::cerr << "\n"; ::exit(1); } void DemeterFatalException(DemeterException &e, std::string const &location) { CSP_LOG(CSP_APP, CSP_ERROR, "CSPSim: caught Demeter exception in " << location << ": " << e.GetErrorMessage()); std::cerr << "\n"; std::cerr << "CSPSim: caught an Demeter exception. Please report this along\n" << "with as much information as possible about what was happening at \n" << "the time of the error to the CSP forum at\n" << " http://csp.sourceforge.net/forum\n"; std::cerr << "\n"; ::exit(1); } void SimDataFatalException(simdata::Exception &e, std::string const &location) { CSP_LOG(CSP_APP, CSP_ERROR, "CSPSim: caught SimData exception in " << location << ": " << e.getMessage()); std::cerr << "\n"; e.details(); std::cerr << "\n"; std::cerr << "CSPSim: caught an SimData exception. Please report this along\n" << "with as much information as possible about what was happening at \n" << "the time of the error to the CSP forum at\n" << " http://csp.sourceforge.net/forum\n" << "If you built CSPSim from CVS, you may wish to check that your\n" << "installed version of SimData is also the latest available from\n" << "CVS.\n"; std::cerr << "\n"; ::exit(1); } void OtherFatalException(std::string const &location) { CSP_LOG(CSP_APP, CSP_ERROR, "CSPSim: caught unknown exception in " << location << "."); std::cerr << "\n"; std::cerr << "CSPSim: caught an (unknown) exception. Please report this along\n" << "with as much information as possible about what was happening at \n" << "the time of the error to the CSP forum at\n" << " http://csp.sourceforge.net/forum\n"; std::cerr << "\n"; ::exit(1); } } // namespace csp Index: CSPSim.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/CSPSim.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** CSPSim.cpp 12 Apr 2003 00:55:04 -0000 1.20 --- CSPSim.cpp 12 Apr 2003 22:34:34 -0000 1.21 *************** *** 40,43 **** --- 40,44 ---- #include "CSPSim.h" #include "EventMapIndex.h" + #include "Exception.h" #include "GameScreen.h" #include "HID.h" *************** *** 283,297 **** logoScreen.OnExit(); } ! catch(DemeterException * pEx) { ! CSP_LOG(CSP_APP, CSP_ERROR, "CSPSim: caught Demeter exception during initialazation: " << pEx->GetErrorMessage()); ! ::exit(1); } ! catch(simdata::Exception * pEx) { ! CSP_LOG(CSP_APP, CSP_ERROR, "CSPSim: caught SimData exception during initialization: " << pEx->getMessage()); ! ::exit(1); } catch (...) { ! CSP_LOG(CSP_APP, CSP_ERROR, "CSPSim: caught unknown exception during initialazation."); ! ::exit(1); } } --- 284,298 ---- logoScreen.OnExit(); } ! catch(csp::Exception & pEx) { ! csp::FatalException(pEx, "initialization"); } ! catch(DemeterException & pEx) { ! csp::DemeterFatalException(pEx, "initialization"); ! } ! catch(simdata::Exception & pEx) { ! csp::SimDataFatalException(pEx, "initialization"); } catch (...) { ! csp::OtherFatalException("initialization"); } } Index: Makefile.in =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Makefile.in,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Makefile.in 12 Apr 2003 01:25:31 -0000 1.11 --- Makefile.in 12 Apr 2003 22:34:34 -0000 1.12 *************** *** 33,36 **** --- 33,37 ---- EventMapIndex.cpp \ EventMapping.cpp \ + Exception.cpp \ F16Model.cpp \ GameScreen.cpp \ Index: Sky.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Sky.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Sky.cpp 11 Apr 2003 18:59:20 -0000 1.9 --- Sky.cpp 12 Apr 2003 22:34:34 -0000 1.10 *************** *** 33,36 **** --- 33,37 ---- #include "Config.h" #include "Colorspace.h" + #include "Exception.h" #include <cmath> *************** *** 542,546 **** x = y = 1.0; m_Image = osgDB::readImageFile("moon.png"); ! assert(m_Image.valid()); // set up the texture. --- 543,547 ---- x = y = 1.0; m_Image = osgDB::readImageFile("moon.png"); ! if (!m_Image.valid()) throw csp::DataError("unable to open \"moon.png\""); // set up the texture. |
|
From: <mk...@us...> - 2003-04-12 22:34:36
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1:/tmp/cvs-serv3057 Modified Files: CHANGES.current Log Message: see CHANGES.current Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** CHANGES.current 12 Apr 2003 10:16:27 -0000 1.19 --- CHANGES.current 12 Apr 2003 22:34:34 -0000 1.20 *************** *** 2,5 **** --- 2,15 ---- =========================== + 2003-04-12: onsight + Added Exception.h and Exception.cpp to provide exception + classes and error messages. (Requires latest SimData CVS) + + Try/catch blocks in CSPSim::Init now display semi-informative + messages (more work to be done). Only one throw() so far in + Sky.cpp for missing moon.png (fairly common at the moment!) + + *********** VC USERS: please add Exception.cpp to the VC project files + 2003-04-11: delta update .net projects. |
|
From: <mk...@us...> - 2003-04-12 22:32:54
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv2472/Source
Modified Files:
Exception.cpp
Log Message:
see CHANGES.current
Index: Exception.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Exception.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Exception.cpp 28 Jan 2003 23:26:07 -0000 1.2
--- Exception.cpp 12 Apr 2003 22:32:51 -0000 1.3
***************
*** 26,30 ****
! Exception::Exception(std::string type, std::string msg) {
//: std::runtime_error(type+": "+msg) {
_type = type;
--- 26,30 ----
! ExceptionBase::ExceptionBase(std::string const &type, std::string const &msg) {
//: std::runtime_error(type+": "+msg) {
_type = type;
***************
*** 33,37 ****
}
! Exception::Exception(Exception const &e) {
_type = e._type;
_msg = e._msg;
--- 33,37 ----
}
! ExceptionBase::ExceptionBase(ExceptionBase const &e) {
_type = e._type;
_msg = e._msg;
***************
*** 40,64 ****
}
! std::string Exception::getMessage() {
return _msg;
}
! std::string Exception::getType() {
return _type;
}
! void Exception::appendMessage(std::string const &msg) {
_msg += "\n" + msg;
}
! void Exception::clear() {
dump = false;
}
! void Exception::details() {
std::cerr << _type << ": " << _msg << std::endl;
}
! Exception::~Exception() {
if (dump) details();
}
--- 40,64 ----
}
! std::string ExceptionBase::getMessage() {
return _msg;
}
! std::string ExceptionBase::getType() {
return _type;
}
! void ExceptionBase::appendMessage(std::string const &msg) {
_msg += "\n" + msg;
}
! void ExceptionBase::clear() {
dump = false;
}
! void ExceptionBase::details() {
std::cerr << _type << ": " << _msg << std::endl;
}
! ExceptionBase::~ExceptionBase() {
if (dump) details();
}
|
|
From: <mk...@us...> - 2003-04-12 22:32:54
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv2472/Include/SimData
Modified Files:
Exception.h
Log Message:
see CHANGES.current
Index: Exception.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Exception.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Exception.h 12 Apr 2003 08:56:37 -0000 1.7
--- Exception.h 12 Apr 2003 22:32:51 -0000 1.8
***************
*** 38,46 ****
/**
! * Base class for all SimData expections.
*
* @author Mark Rose <mr...@st...>
*/
! class SIMDATA_EXPORT Exception { //: public std::runtime_error {
std::string _msg;
std::string _type;
--- 38,46 ----
/**
! * General expection base class with error reporting.
*
* @author Mark Rose <mr...@st...>
*/
! class SIMDATA_EXPORT ExceptionBase { //: public std::runtime_error {
std::string _msg;
std::string _type;
***************
*** 53,62 ****
* @param msg a string providing additional information about the error.
*/
! Exception(std::string type="Exception", std::string msg="");
/**
* Copy constructor.
*/
! Exception(Exception const &e);
/**
--- 53,62 ----
* @param msg a string providing additional information about the error.
*/
! ExceptionBase(std::string const &type="Exception", std::string const &msg="");
/**
* Copy constructor.
*/
! ExceptionBase(ExceptionBase const &e);
/**
***************
*** 66,70 ****
* details to stderr on destruction.
*/
! virtual ~Exception();
/**
--- 66,70 ----
* details to stderr on destruction.
*/
! virtual ~ExceptionBase();
/**
***************
*** 93,96 ****
--- 93,105 ----
*/
void details();
+ };
+
+ /**
+ * Base class for all SimData specific exceptions.
+ */
+ class Exception: public ExceptionBase {
+ public:
+ Exception(std::string const &type="Exception", std::string const &msg=""):
+ ExceptionBase(type, msg) { }
};
|
|
From: <mk...@us...> - 2003-04-12 22:32:54
|
Update of /cvsroot/csp/APPLICATIONS/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv2472
Modified Files:
CHANGES.current
Log Message:
see CHANGES.current
Index: CHANGES.current
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** CHANGES.current 12 Apr 2003 08:56:54 -0000 1.22
--- CHANGES.current 12 Apr 2003 22:32:51 -0000 1.23
***************
*** 8,11 ****
--- 8,15 ----
another project.
+ Moved Exception to ExceptionBase for use in other projects
+ and added an Exception subclass to serve as the base class
+ for all SimData exceptions.
+
2003-04-11: onsight
Updated setup.py to install FileUtility.h.
|
|
From: <de...@us...> - 2003-04-12 10:20:07
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/VisualStudio/CSPSimDLL In directory sc8-pr-cvs1:/tmp/cvs-serv2969 Modified Files: CSPSimDLL.vcproj Log Message: no message Index: CSPSimDLL.vcproj =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CSPSimDLL.vcproj 9 Apr 2003 19:59:35 -0000 1.5 --- CSPSimDLL.vcproj 12 Apr 2003 10:20:04 -0000 1.6 *************** *** 83,87 **** Name="VCCLCompilerTool" InlineFunctionExpansion="1" ! AdditionalIncludeDirectories="../../Include,C:/Python22/include,../../../../THIRDPARTYLIBS/include,../../../../THIRDPARTYLIBS/Demeter" PreprocessorDefinitions="CSP_NDEBUG;WIN32;NDEBUG;_WINDOWS;_USRDLL;CSPSIMDLL_EXPORTS" StringPooling="TRUE" --- 83,87 ---- Name="VCCLCompilerTool" InlineFunctionExpansion="1" ! AdditionalIncludeDirectories="../../Include,C:/Python22/include,../../../../THIRDPARTYLIBS/include,../../../../THIRDPARTYLIBS/demeter" PreprocessorDefinitions="CSP_NDEBUG;WIN32;NDEBUG;_WINDOWS;_USRDLL;CSPSIMDLL_EXPORTS" StringPooling="TRUE" *************** *** 231,237 **** </File> <File - RelativePath="..\..\Source\Platform.cpp"> - </File> - <File RelativePath="..\..\Source\ScreenInfo.cpp"> </File> --- 231,234 ---- *************** *** 362,368 **** <File RelativePath="..\..\Include\ObjectRangeInfo.h"> - </File> - <File - RelativePath="..\..\Include\Platform.h"> </File> <File --- 359,362 ---- |
|
From: <de...@us...> - 2003-04-12 10:19:46
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/VisualStudio/CSPSimAppli In directory sc8-pr-cvs1:/tmp/cvs-serv2844 Modified Files: CSPSimAppli.vcproj Log Message: no message Index: CSPSimAppli.vcproj =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/VisualStudio/CSPSimAppli/CSPSimAppli.vcproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CSPSimAppli.vcproj 9 Apr 2003 19:59:49 -0000 1.3 --- CSPSimAppli.vcproj 12 Apr 2003 10:19:42 -0000 1.4 *************** *** 226,232 **** </File> <File - RelativePath="..\..\Source\Platform.cpp"> - </File> - <File RelativePath="..\..\Source\ScreenInfo.cpp"> </File> --- 226,229 ---- *************** *** 357,363 **** <File RelativePath="..\..\Include\ObjectRangeInfo.h"> - </File> - <File - RelativePath="..\..\Include\Platform.h"> </File> <File --- 354,357 ---- |
|
From: <de...@us...> - 2003-04-12 10:19:09
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv2684 Modified Files: AircraftObject.cpp Log Message: changed back such that cvs version uses doSimStep() Index: AircraftObject.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/AircraftObject.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** AircraftObject.cpp 12 Apr 2003 10:17:51 -0000 1.12 --- AircraftObject.cpp 12 Apr 2003 10:19:06 -0000 1.13 *************** *** 471,476 **** m_FlightModel->setGroundZ(m_GroundZ); m_FlightModel->setGroundN(m_GroundN); ! //m_FlightModel->doSimStep(dt); ! m_FlightModel->doSimStep2(dt); updateOrientation(); m_Direction = m_Orientation * simdata::Vector3::YAXIS; --- 471,476 ---- m_FlightModel->setGroundZ(m_GroundZ); m_FlightModel->setGroundN(m_GroundN); ! m_FlightModel->doSimStep(dt); ! //m_FlightModel->doSimStep2(dt); updateOrientation(); m_Direction = m_Orientation * simdata::Vector3::YAXIS; |
|
From: <de...@us...> - 2003-04-12 10:17:54
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv2386
Modified Files:
DynamicalSystem.cpp AircraftObject.cpp AeroDynamics.cpp
Log Message:
no message
Index: DynamicalSystem.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/DynamicalSystem.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DynamicalSystem.cpp 3 Apr 2003 10:40:42 -0000 1.2
--- DynamicalSystem.cpp 12 Apr 2003 10:17:51 -0000 1.3
***************
*** 56,60 ****
y = _numericalMethod->enhancedSolve(y0, t0, dt);
if (_numericalMethod->failed()) {
! std::cout << "quick solve is required\n";
y = _numericalMethod->quickSolve(y0, t0, dt);
}
--- 56,60 ----
y = _numericalMethod->enhancedSolve(y0, t0, dt);
if (_numericalMethod->failed()) {
! //std::cout << "quick solve is required\n";
y = _numericalMethod->quickSolve(y0, t0, dt);
}
Index: AircraftObject.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/AircraftObject.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** AircraftObject.cpp 3 Apr 2003 10:40:42 -0000 1.11
--- AircraftObject.cpp 12 Apr 2003 10:17:51 -0000 1.12
***************
*** 161,166 ****
CSP_LOG(CSP_APP, CSP_DEBUG, "AircraftObject::onUpdate ...");
// TODO: update AI controller
- doFCS(dt);
updateControls(dt);
DynamicObject::onUpdate(dt);
// TODO: update HUD?
--- 161,166 ----
CSP_LOG(CSP_APP, CSP_DEBUG, "AircraftObject::onUpdate ...");
// TODO: update AI controller
updateControls(dt);
+ doFCS(dt);
DynamicObject::onUpdate(dt);
// TODO: update HUD?
***************
*** 176,180 ****
unsigned int AircraftObject::onRender()
{
! // updateScene();
return 0;
}
--- 176,180 ----
unsigned int AircraftObject::onRender()
{
! // TODO: animation code here
return 0;
}
***************
*** 471,476 ****
m_FlightModel->setGroundZ(m_GroundZ);
m_FlightModel->setGroundN(m_GroundN);
! m_FlightModel->doSimStep(dt);
! //m_FlightModel->doSimStep2(dt);
updateOrientation();
m_Direction = m_Orientation * simdata::Vector3::YAXIS;
--- 471,476 ----
m_FlightModel->setGroundZ(m_GroundZ);
m_FlightModel->setGroundN(m_GroundN);
! //m_FlightModel->doSimStep(dt);
! m_FlightModel->doSimStep2(dt);
updateOrientation();
m_Direction = m_Orientation * simdata::Vector3::YAXIS;
Index: AeroDynamics.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/AeroDynamics.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** AeroDynamics.cpp 12 Apr 2003 00:55:03 -0000 1.15
--- AeroDynamics.cpp 12 Apr 2003 10:17:51 -0000 1.16
***************
*** 47,51 ****
SIMDATA_REGISTER_INTERFACE(AeroDynamics)
-
AeroDynamics::AeroDynamics():
DynamicalSystem(13),
--- 47,50 ----
***************
*** 629,633 ****
// Add in extra forces and reset
forceBody += m_ExtraForceBody;
- m_ExtraForceBody = simdata::Vector3(0.0, 0.0, 0.0);
// Evaluate g's
--- 628,631 ----
***************
*** 652,656 ****
moments += m_ExtraMomentBody;
- m_ExtraMomentBody = simdata::Vector3(0.0, 0.0, 0.0);
return moments;
--- 650,653 ----
***************
*** 853,858 ****
double const damping = 0.91;
! double const scaleFactor1 = 0.4;
! double const scaleFactor2 = 1.0;
std::vector<double> const &AeroDynamics::_f(double x, std::vector<double> &y) {
--- 850,854 ----
double const damping = 0.91;
! double const scaleFactor2 = 0.1;
std::vector<double> const &AeroDynamics::_f(double x, std::vector<double> &y) {
***************
*** 860,864 ****
static std::vector<double> dy(13);
! // bind(y,p,v,w,q);
m_PositionLocal = *m_Position + BodyToLocal(simdata::Vector3(y[0],y[1],y[2]));
m_VelocityBody = simdata::Vector3(y[3],y[4],y[5]);
--- 856,860 ----
static std::vector<double> dy(13);
! // bind(y,p,v,w,q);
m_PositionLocal = *m_Position + BodyToLocal(simdata::Vector3(y[0],y[1],y[2]));
m_VelocityBody = simdata::Vector3(y[3],y[4],y[5]);
***************
*** 870,874 ****
y[9] = qOrientation.w; y[10] = qOrientation.x; y[11] = qOrientation.y; y[12] = qOrientation.z;
- // XXX partial windspeed adaptation... broken for doSimStep2
m_AirflowBody = m_VelocityBody - LocalToBody(m_WindLocal);
m_AirSpeed = m_AirflowBody.Length();
--- 866,869 ----
***************
*** 879,883 ****
updateAngles(x);
! // linear acceleration body: calculate v' = F/m - w^v
if (m_NearGround) {
// approximate (generic) ground effect... TODO: paramaterize in xml.
--- 874,879 ----
updateAngles(x);
! m_ExtraForceBody = simdata::Vector3(0.0, 0.0, 0.0);
! m_ExtraMomentBody = simdata::Vector3(0.0, 0.0, 0.0);
if (m_NearGround) {
// approximate (generic) ground effect... TODO: paramaterize in xml.
***************
*** 886,903 ****
if (h > 1.0) h = 1.0;
m_GE = 0.49 + (1.0 - 0.5 * h) * h;
! //if (m_Gear) {
! // double height = m_PositionLocal.z - m_GroundZ;
! // simdata::Vector3 force, moment;
! // m_Gear->doComplexPhysics(qOrientation,
! // m_VelocityBody,
! // m_AngularVelocityBody,
! // height,
! // m_GroundN,
! // x,
! // force,
! // moment);
! // m_ExtraForceBody += scaleFactor1 * force;
! // m_ExtraMomentBody += scaleFactor1 * moment;
! //}//if (m_Gear)
if (m_Contacts) {
simdata::Vector3 bodyn = LocalToBody(m_GroundN);
--- 882,899 ----
if (h > 1.0) h = 1.0;
m_GE = 0.49 + (1.0 - 0.5 * h) * h;
! if (m_Gear) {
! double height = m_PositionLocal.z - m_GroundZ;
! simdata::Vector3 force, moment;
! m_Gear->doComplexPhysics(qOrientation,
! m_VelocityBody,
! m_AngularVelocityBody,
! height,
! m_GroundN,
! x,
! force,
! moment);
! m_ExtraForceBody += force;
! m_ExtraMomentBody += moment;
! }//if (m_Gear)
if (m_Contacts) {
simdata::Vector3 bodyn = LocalToBody(m_GroundN);
***************
*** 913,918 ****
simdata::Vector3 Vb = m_VelocityBody + (m_AngularVelocityBody^(*contact));
simdata::Vector3 V = BodyToLocal(Vb);
! static const float groundK = 1.0e+4;//1.0e+7;
! static const float groundBeta = 1.0e+3;//1.0e+6;
double impact = simdata::Dot(V, m_GroundN);
double scale = - (height*groundK + impact*fabs(impact)*groundBeta);
--- 909,914 ----
simdata::Vector3 Vb = m_VelocityBody + (m_AngularVelocityBody^(*contact));
simdata::Vector3 V = BodyToLocal(Vb);
! static const float groundK = 1.0e+7;
! static const float groundBeta = 1.0e+6;
double impact = simdata::Dot(V, m_GroundN);
double scale = - (height*groundK + impact*fabs(impact)*groundBeta);
***************
*** 920,929 ****
// dissipate some extra energy
if (impact < -10.0) {
! //m_VelocityBody *= 0.50;
! m_VelocityBody -= 0.50 * impact * m_GroundN;
std::cout << "SLAM!!!!\n";
} else {
! //m_VelocityBody *= 0.95;
! m_VelocityBody -= 0.95 * impact * m_GroundN;
std::cout << "SLAM!\n";
}
--- 916,923 ----
// dissipate some extra energy
if (impact < -10.0) {
! m_VelocityBody -= 0.25 * simdata::Dot(m_VelocityBody, bodyn) * bodyn;
std::cout << "SLAM!!!!\n";
} else {
! m_VelocityBody -= 0.05 * simdata::Dot(m_VelocityBody, bodyn) * bodyn;
std::cout << "SLAM!\n";
}
***************
*** 934,938 ****
}
}//if (fabs(scale)>groundK)
! simdata::Vector3 force = scale * bodyn;
V -= impact * m_GroundN;
--- 928,933 ----
}
}//if (fabs(scale)>groundK)
!
! simdata::Vector3 force = scaleFactor2 * scale * bodyn;
V -= impact * m_GroundN;
***************
*** 942,963 ****
// reduce to zero as speed drops
float v = V.Length();
! scale = scale / (1.0 + v);
// limit to 4G max
if (scale * v > m_Mass * 40.0) {
scale = m_Mass * 40.0 / v;
}
! force += -scale * V;
! m_ExtraForceBody += scaleFactor2 * force;
! m_ExtraMomentBody += scaleFactor2 * (*contact) ^ force;
} //if (height < 0.0)
} //for (contact
} //if (m_Contacts)
}
m_ForcesBody = CalculateForces(qBarS);
m_LinearAccelBody = m_MassInverse * m_ForcesBody - (m_AngularVelocityBody^m_VelocityBody);
- // angular acceleration body: calculate Iw' = M - w^Iw
m_MomentsBody = CalculateMoments(qBarS);
m_AngularAccelBody = m_InertiaInverse *
(m_MomentsBody - (m_AngularVelocityBody^(m_Inertia * m_AngularVelocityBody)));
--- 937,961 ----
// reduce to zero as speed drops
float v = V.Length();
! scale /= 1.0 + v;
// limit to 4G max
if (scale * v > m_Mass * 40.0) {
scale = m_Mass * 40.0 / v;
}
! force += -scaleFactor2 * scale * V;
! m_ExtraForceBody += force;
! m_ExtraMomentBody += (*contact) ^ force;
!
} //if (height < 0.0)
} //for (contact
} //if (m_Contacts)
}
+
m_ForcesBody = CalculateForces(qBarS);
+ // linear acceleration body: calculate v' = F/m - w^v
m_LinearAccelBody = m_MassInverse * m_ForcesBody - (m_AngularVelocityBody^m_VelocityBody);
m_MomentsBody = CalculateMoments(qBarS);
+ // angular acceleration body: calculate Iw' = M - w^Iw
m_AngularAccelBody = m_InertiaInverse *
(m_MomentsBody - (m_AngularVelocityBody^(m_Inertia * m_AngularVelocityBody)));
***************
*** 968,973 ****
--- 966,974 ----
// p' = v
dy[0] = y[3]; dy[1] = y[4]; dy[2] = y[5];
+ // v'
dy[3] = m_LinearAccelBody.x; dy[4] = m_LinearAccelBody.y; dy[5] = m_LinearAccelBody.z;
+ // w'
dy[6] = m_AngularAccelBody.x; dy[7] = m_AngularAccelBody.y; dy[8] = m_AngularAccelBody.z;
+ // q'
dy[9] = qprim.w; dy[10] = qprim.x; dy[11] = qprim.y; dy[12] = qprim.z;
***************
*** 1001,1006 ****
void AeroDynamics::doSimStep2(double dt) {
- static std::vector<double> y0, y;
-
if (dt == 0.0) dt = 0.01;
--- 1002,1005 ----
***************
*** 1042,1049 ****
m_AngularVelocityBody = LocalToBody(m_AngularVelocityLocal);
updateAngles(dt);
! y0 = ::bind(simdata::Vector3::ZERO, m_VelocityBody, m_AngularVelocityBody, qOrientation);
// solution
! y = flow(y0, 0, dt);
// update all variables
--- 1041,1048 ----
m_AngularVelocityBody = LocalToBody(m_AngularVelocityLocal);
updateAngles(dt);
! std::vector<double> y0 = ::bind(simdata::Vector3::ZERO, m_VelocityBody, m_AngularVelocityBody, qOrientation);
// solution
! std::vector<double> y = flow(y0, 0, dt);
// update all variables
|
|
From: <de...@us...> - 2003-04-12 10:17:08
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include
In directory sc8-pr-cvs1:/tmp/cvs-serv2238
Modified Files:
NumericalMethod.h DynamicalSystem.h
Log Message:
no message
Index: NumericalMethod.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/NumericalMethod.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** NumericalMethod.h 11 Apr 2003 23:43:06 -0000 1.2
--- NumericalMethod.h 12 Apr 2003 10:17:05 -0000 1.3
***************
*** 35,39 ****
unsigned short const m_dimension;
public:
! VectorField(unsigned short dimension):
m_dimension(dimension) {
}
--- 35,39 ----
unsigned short const m_dimension;
public:
! VectorField(unsigned short dimension ):
m_dimension(dimension) {
}
***************
*** 41,45 ****
return m_dimension;
}
! virtual std::vector<double> const& _f(double t, std::vector<double>& y) = 0;
};
--- 41,45 ----
return m_dimension;
}
! virtual std::vector<double> const& _f(double t, std::vector<double>& y) = 0;
};
Index: DynamicalSystem.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/DynamicalSystem.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DynamicalSystem.h 11 Apr 2003 23:43:06 -0000 1.3
--- DynamicalSystem.h 12 Apr 2003 10:17:05 -0000 1.4
***************
*** 38,42 ****
DynamicalSystem(VectorField* pf);
virtual ~DynamicalSystem();
- //void setVectorField(VectorField* pf);
void setNumericalMethod(NumericalMethod* pnumericalMethod);
std::vector<double> const& flow(std::vector<double>& y0, double t0, double dt) const;
--- 38,41 ----
|
|
From: <de...@us...> - 2003-04-12 10:16:36
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim
In directory sc8-pr-cvs1:/tmp/cvs-serv2099
Modified Files:
CHANGES.current
Log Message:
no message
Index: CHANGES.current
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** CHANGES.current 12 Apr 2003 01:25:31 -0000 1.18
--- CHANGES.current 12 Apr 2003 10:16:27 -0000 1.19
***************
*** 2,5 ****
--- 2,10 ----
===========================
+ 2003-04-11: delta
+ update .net projects.
+
+ Cleaned code.
+
2003-04-11: onsight
Modified autoconf scripts to get the actual python
|
|
From: <mk...@us...> - 2003-04-12 08:56:57
|
Update of /cvsroot/csp/APPLICATIONS/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv14179
Modified Files:
CHANGES.current
Log Message:
Index: CHANGES.current
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** CHANGES.current 12 Apr 2003 00:37:19 -0000 1.21
--- CHANGES.current 12 Apr 2003 08:56:54 -0000 1.22
***************
*** 2,7 ****
--- 2,15 ----
===========================
+ 2003-04-12: onsight
+ Changed all the #ifndef/#define blocks surrounding the
+ headers to use __SIMDATA_ as a prefix. This should ensure
+ the identifiers are unique when the headers are used in
+ another project.
+
2003-04-11: onsight
Updated setup.py to install FileUtility.h.
+
+ Minor changes to log macro and fatal error function.
2003-04-11: delta
|
|
From: <mk...@us...> - 2003-04-12 01:25:34
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv2337/Source Modified Files: Makefile.in Log Message: see CHANGES.current Index: Makefile.in =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Makefile.in,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Makefile.in 12 Apr 2003 00:55:04 -0000 1.10 --- Makefile.in 12 Apr 2003 01:25:31 -0000 1.11 *************** *** 11,15 **** LIBS = $(DEMETER_LIBRARY) ! INCLUDE = -I$(TOPDIR)/Include $(DEMETER_INCLUDE) -I@PYTHON_PREFIX@/include/python2.2 CFLAGS = $(GDEBUGF) $(GCFLAGS) $(INCLUDE) @SDL_FLAGS@ --- 11,15 ---- LIBS = $(DEMETER_LIBRARY) ! INCLUDE = -I$(TOPDIR)/Include $(DEMETER_INCLUDE) -I@PYTHON_INCLUDE@ CFLAGS = $(GDEBUGF) $(GCFLAGS) $(INCLUDE) @SDL_FLAGS@ *************** *** 114,119 **** $(CXX) $(LDOPTS) -o$(BIN)/$@ $^ $(LIBS) ! CSPapp: $(OBJECTS) main.o ! $(CXX) -lswigpy -lpython2.2 -o$@ $^ $(LIBS) cCSP_wrap.cpp: cCSP.i --- 114,119 ---- $(CXX) $(LDOPTS) -o$(BIN)/$@ $^ $(LIBS) ! #CSPapp: $(OBJECTS) main.o ! # $(CXX) -lswigpy -lpython2.2 -o$@ $^ $(LIBS) cCSP_wrap.cpp: cCSP.i |
|
From: <mk...@us...> - 2003-04-12 01:25:34
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim
In directory sc8-pr-cvs1:/tmp/cvs-serv2337
Modified Files:
CHANGES.current acinclude.m4
Log Message:
see CHANGES.current
Index: CHANGES.current
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** CHANGES.current 12 Apr 2003 00:55:18 -0000 1.17
--- CHANGES.current 12 Apr 2003 01:25:31 -0000 1.18
***************
*** 2,5 ****
--- 2,11 ----
===========================
+ 2003-04-11: onsight
+ Modified autoconf scripts to get the actual python
+ include path using distutils, rather than just using
+ PYTHON_PREFIX/include/python2.2, which is version
+ dependent.
+
*********** VC USERS: please remove Platform.cpp from the VC project
files.
Index: acinclude.m4
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/acinclude.m4,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** acinclude.m4 26 Mar 2003 10:17:54 -0000 1.6
--- acinclude.m4 12 Apr 2003 01:25:31 -0000 1.7
***************
*** 140,144 ****
--- 140,147 ----
python=yes
PYTHON_PREFIX=`python -c 'import sys; print sys.prefix'`
+ dnl hopefully distutils is installed...
+ PYTHON_INCLUDE=`python -c 'from distutils.sysconfig import get_python_inc; print get_python_inc()'`
AC_SUBST(PYTHON_PREFIX)
+ AC_SUBST(PYTHON_INCLUDE)
else
AC_MSG_RESULT(no)
|
|
From: <mk...@us...> - 2003-04-12 00:55:21
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim
In directory sc8-pr-cvs1:/tmp/cvs-serv26633
Modified Files:
CHANGES.current
Log Message:
Index: CHANGES.current
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** CHANGES.current 11 Apr 2003 23:43:05 -0000 1.16
--- CHANGES.current 12 Apr 2003 00:55:18 -0000 1.17
***************
*** 2,12 ****
===========================
2003-04-11: onsight
Fixed two coordinate system bugs in the impact code during
hard crashes that could cause numerical overflows and lead
to segfaults. There's still somewhat odd behaviour at
! times, but only under conditions where the plane would
! break into pieces anyway (which of course isn't modelled
! yet).
Reordered member initializers in NumericalMethod ctors to
--- 2,13 ----
===========================
+ *********** VC USERS: please remove Platform.cpp from the VC project
+ files.
+
2003-04-11: onsight
Fixed two coordinate system bugs in the impact code during
hard crashes that could cause numerical overflows and lead
to segfaults. There's still somewhat odd behaviour at
! times, so this should be revisited at some point.
Reordered member initializers in NumericalMethod ctors to
***************
*** 23,26 ****
--- 24,40 ----
under linux (assuming your python path is the same
as mine ;-).
+
+ Removed Platform.cpp from the build. None of the files
+ should include Platform.h; from now on you should use
+ SimData/FileUtility.h to provide the ospath functions.
+ These are in the simdata namespace, so they look like:
+
+ simdata::ospath::join(...)
+
+ Stripped all the includes out of stdinc.h which were
+ not needed by any of the source files that included
+ it. I also removed the #include "stdinc.h" from these.
+ stdinc.h now just contains the lines to enable mmgr
+ which are commented out.
*********** ALL USERS: you will need to remake your aircraft.hid file.
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv26490
Modified Files:
AeroDynamics.cpp CSPSim.cpp Config.cpp ConsoleCommands.cpp
EventMapIndex.cpp GameScreen.cpp LogoScreen.cpp Makefile.in
MenuScreen.cpp ObjectModel.cpp ObjectRangeInfo.cpp
SimpleConfig.cpp TankObject.cpp TerrainObject.cpp
VirtualBattlefield.cpp base.cpp
Removed Files:
Platform.cpp
Log Message:
see CHANGES.current
Index: AeroDynamics.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/AeroDynamics.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** AeroDynamics.cpp 11 Apr 2003 23:43:06 -0000 1.14
--- AeroDynamics.cpp 12 Apr 2003 00:55:03 -0000 1.15
***************
*** 501,505 ****
// reduce to zero as speed drops
float v = V.Length();
! scale = scale / (1.0 + v);
// limit to 4G max
if (scale * v > m_Mass * 40.0) {
--- 501,505 ----
// reduce to zero as speed drops
float v = V.Length();
! scale = scale / (0.1 + v);
// limit to 4G max
if (scale * v > m_Mass * 40.0) {
Index: CSPSim.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/CSPSim.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** CSPSim.cpp 11 Apr 2003 23:43:06 -0000 1.19
--- CSPSim.cpp 12 Apr 2003 00:55:04 -0000 1.20
***************
*** 45,49 ****
#include "LogoScreen.h"
#include "LogStream.h"
- #include "Platform.h"
#include "SimObject.h"
#include "StaticObject.h"
--- 45,48 ----
***************
*** 55,58 ****
--- 54,58 ----
#include <SimData/DataArchive.h>
#include <SimData/Exception.h>
+ #include <SimData/FileUtility.h>
SDLWave m_audioWave;
***************
*** 189,193 ****
std::string data_path = g_Config.getPath("Paths", "DataPath", ".", true);
! std::string archive_file = ospath::join(data_path, "sim.dar");
// open the primary data archive
--- 189,193 ----
std::string data_path = g_Config.getPath("Paths", "DataPath", ".", true);
! std::string archive_file = simdata::ospath::join(data_path, "sim.dar");
// open the primary data archive
***************
*** 578,582 ****
std::string sound_path = g_Config.getPath("Paths", "SoundPath", ".", true);
! if ( SDL_LoadWAV(ospath::join(sound_path, "avionturbine5.wav").c_str(),
&m_audioWave.spec, &m_audioWave.sound, &m_audioWave.soundlen) == NULL ) {
CSP_LOG(CSP_APP, CSP_ERROR, "Couldn't load " << sound_path << "/avionturbine5.wav: " << SDL_GetError());
--- 578,582 ----
std::string sound_path = g_Config.getPath("Paths", "SoundPath", ".", true);
! if ( SDL_LoadWAV(simdata::ospath::join(sound_path, "avionturbine5.wav").c_str(),
&m_audioWave.spec, &m_audioWave.sound, &m_audioWave.soundlen) == NULL ) {
CSP_LOG(CSP_APP, CSP_ERROR, "Couldn't load " << sound_path << "/avionturbine5.wav: " << SDL_GetError());
Index: Config.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Config.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Config.cpp 21 Mar 2003 20:07:55 -0000 1.4
--- Config.cpp 12 Apr 2003 00:55:04 -0000 1.5
***************
*** 24,28 ****
#include "Config.h"
! #include "Platform.h"
/**
--- 24,28 ----
#include "Config.h"
! #include <SimData/FileUtility.h>
/**
***************
*** 33,37 ****
bool openConfig(std::string ini_path, bool report_error) {
! ini_path = ospath::filter(ini_path);
bool found_config = false;
try {
--- 33,37 ----
bool openConfig(std::string ini_path, bool report_error) {
! ini_path = simdata::ospath::filter(ini_path);
bool found_config = false;
try {
Index: ConsoleCommands.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/ConsoleCommands.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ConsoleCommands.cpp 21 Mar 2003 20:07:55 -0000 1.4
--- ConsoleCommands.cpp 12 Apr 2003 00:55:04 -0000 1.5
***************
*** 24,28 ****
- #include "stdinc.h"
#include "ConsoleCommands.h"
#include "Console.h"
--- 24,27 ----
Index: EventMapIndex.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/EventMapIndex.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** EventMapIndex.cpp 2 Feb 2003 20:53:28 -0000 1.3
--- EventMapIndex.cpp 12 Apr 2003 00:55:04 -0000 1.4
***************
*** 30,38 ****
#include "EventMapIndex.h"
#include "LogStream.h"
- #include "Platform.h"
#include <osgDB/FileUtils>
#include <osgDB/FileNameUtils>
#include <assert.h>
--- 30,39 ----
#include "EventMapIndex.h"
#include "LogStream.h"
#include <osgDB/FileUtils>
#include <osgDB/FileNameUtils>
+ #include <SimData/FileUtility.h>
+
#include <assert.h>
***************
*** 79,83 ****
dc = osgDB::getDirectoryContents(path);
for (file = dc.begin(); file != dc.end(); file++) {
! std::string fn = ospath::join(path, *file);
if (osgDB::getFileExtension(fn) != "hid") continue;
load(fn);
--- 80,84 ----
dc = osgDB::getDirectoryContents(path);
for (file = dc.begin(); file != dc.end(); file++) {
! std::string fn = simdata::ospath::join(path, *file);
if (osgDB::getFileExtension(fn) != "hid") continue;
load(fn);
Index: GameScreen.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/GameScreen.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** GameScreen.cpp 26 Mar 2003 10:57:16 -0000 1.11
--- GameScreen.cpp 12 Apr 2003 00:55:04 -0000 1.12
***************
*** 23,27 ****
**/
- #include "stdinc.h"
//#include <osg/DisplaySettings>
--- 23,26 ----
Index: LogoScreen.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/LogoScreen.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** LogoScreen.cpp 19 Feb 2003 23:00:35 -0000 1.6
--- LogoScreen.cpp 12 Apr 2003 00:55:04 -0000 1.7
***************
*** 39,45 ****
#include "Config.h"
#include "LogoScreen.h"
- #include "Platform.h"
#include "Config.h"
--- 39,45 ----
#include "Config.h"
#include "LogoScreen.h"
#include "Config.h"
+ #include <SimData/FileUtility.h>
***************
*** 57,61 ****
{
std::string image_path = g_Config.getPath("Paths", "ImagePath", ".", true);
! std::string path = ospath::join(image_path, "CSPLogo.bmp");
m_image = SDL_LoadBMP(path.c_str());
if (m_image == NULL)
--- 57,61 ----
{
std::string image_path = g_Config.getPath("Paths", "ImagePath", ".", true);
! std::string path = simdata::ospath::join(image_path, "CSPLogo.bmp");
m_image = SDL_LoadBMP(path.c_str());
if (m_image == NULL)
Index: Makefile.in
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Makefile.in,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Makefile.in 11 Apr 2003 00:15:19 -0000 1.9
--- Makefile.in 12 Apr 2003 00:55:04 -0000 1.10
***************
*** 46,50 ****
ObjectModel.cpp \
ObjectRangeInfo.cpp \
- Platform.cpp \
ScreenInfo.cpp \
ScreenInfoManager.cpp \
--- 46,49 ----
Index: MenuScreen.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/MenuScreen.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** MenuScreen.cpp 19 Feb 2003 23:00:35 -0000 1.4
--- MenuScreen.cpp 12 Apr 2003 00:55:04 -0000 1.5
***************
*** 24,29 ****
- #include "stdinc.h"
-
#include <osg/Node>
#include <osg/StateSet>
--- 24,27 ----
Index: ObjectModel.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/ObjectModel.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ObjectModel.cpp 11 Apr 2003 23:43:06 -0000 1.7
--- ObjectModel.cpp 12 Apr 2003 00:55:04 -0000 1.8
***************
*** 25,29 ****
#include "LogStream.h"
- #include "Platform.h"
#include "ObjectModel.h"
#include "Config.h"
--- 25,28 ----
***************
*** 38,41 ****
--- 37,42 ----
#include <osg/Geode>
+ #include <SimData/FileUtility.h>
+
SIMDATA_REGISTER_INTERFACE(ObjectModel)
***************
*** 186,190 ****
}
! std::string source = ospath::filter(ospath::join(g_ModelPath, m_ModelPath.getSource()));
CSP_LOG(CSP_APP, CSP_DEBUG, "ObjectModel::loadModel: " << source);
--- 187,191 ----
}
! std::string source = simdata::ospath::filter(simdata::ospath::join(g_ModelPath, m_ModelPath.getSource()));
CSP_LOG(CSP_APP, CSP_DEBUG, "ObjectModel::loadModel: " << source);
Index: ObjectRangeInfo.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/ObjectRangeInfo.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ObjectRangeInfo.cpp 2 Feb 2003 20:53:28 -0000 1.3
--- ObjectRangeInfo.cpp 12 Apr 2003 00:55:04 -0000 1.4
***************
*** 23,28 ****
**/
- #include "stdinc.h"
-
#include "ObjectRangeInfo.h"
--- 23,26 ----
Index: SimpleConfig.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/SimpleConfig.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** SimpleConfig.cpp 22 Mar 2003 02:24:58 -0000 1.5
--- SimpleConfig.cpp 12 Apr 2003 00:55:04 -0000 1.6
***************
*** 38,42 ****
#include "SimpleConfig.h"
- #include "Platform.h"
#include <algorithm>
--- 38,41 ----
***************
*** 50,53 ****
--- 49,54 ----
#include STL_SSTREAM
+ #include <SimData/FileUtility.h>
+
// characters surrounding section names ('[' and ']' for typical windows .ini)
***************
*** 352,358 ****
std::string SimpleConfig::getPath(const std::string §ion, const std::string &key, std::string default_, bool set) {
ConfigValue *v = _find(section, key);
! std::string native = ospath::filter(default_);
if (v) {
! return ospath::filter(v->getValue());
} else
if (set) {
--- 353,359 ----
std::string SimpleConfig::getPath(const std::string §ion, const std::string &key, std::string default_, bool set) {
ConfigValue *v = _find(section, key);
! std::string native = simdata::ospath::filter(default_);
if (v) {
! return simdata::ospath::filter(v->getValue());
} else
if (set) {
***************
*** 397,401 ****
void SimpleConfig::setPath(const std::string §ion, const std::string &key, const std::string &value) {
ConfigValue *v = _find(section, key);
! std::string native = ospath::filter(value);
if (v) {
v->setValue(native);
--- 398,402 ----
void SimpleConfig::setPath(const std::string §ion, const std::string &key, const std::string &value) {
ConfigValue *v = _find(section, key);
! std::string native = simdata::ospath::filter(value);
if (v) {
v->setValue(native);
Index: TankObject.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/TankObject.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TankObject.cpp 2 Feb 2003 20:53:28 -0000 1.3
--- TankObject.cpp 12 Apr 2003 00:55:05 -0000 1.4
***************
*** 23,28 ****
**/
- #include "stdinc.h"
-
#include "SimObject.h"
--- 23,26 ----
Index: TerrainObject.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/TerrainObject.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** TerrainObject.cpp 22 Mar 2003 11:52:41 -0000 1.11
--- TerrainObject.cpp 12 Apr 2003 00:55:05 -0000 1.12
***************
*** 4,12 ****
#include "Config.h"
#include "LogStream.h"
- #include "Platform.h"
#include "TerrainObject.h"
#include "VirtualBattlefield.h"
#include <SimData/InterfaceRegistry.h>
extern int g_ScreenWidth;
--- 4,12 ----
#include "Config.h"
#include "LogStream.h"
#include "TerrainObject.h"
#include "VirtualBattlefield.h"
#include <SimData/InterfaceRegistry.h>
+
extern int g_ScreenWidth;
Index: VirtualBattlefield.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/VirtualBattlefield.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** VirtualBattlefield.cpp 21 Mar 2003 20:07:57 -0000 1.11
--- VirtualBattlefield.cpp 12 Apr 2003 00:55:05 -0000 1.12
***************
*** 33,46 ****
#include <osg/ColorMatrix>
#include <osg/LightSource>
-
#include <osgDB/FileUtils>
-
#include <osgUtil/CullVisitor>
#include <osgUtil/DisplayListVisitor>
#include "Config.h"
#include "CSPSim.h"
#include "LogStream.h"
- #include "Platform.h"
#ifdef SHADOW
--- 33,45 ----
#include <osg/ColorMatrix>
#include <osg/LightSource>
#include <osgDB/FileUtils>
#include <osgUtil/CullVisitor>
#include <osgUtil/DisplayListVisitor>
+ #include <SimData/FileUtility.h>
+
#include "Config.h"
#include "CSPSim.h"
#include "LogStream.h"
#ifdef SHADOW
***************
*** 214,220 ****
std::string font_path = g_Config.getPath("Paths", "FontPath", ".", true);
std::string search_path;
! ospath::addpath(search_path, image_path);
! ospath::addpath(search_path, model_path);
! ospath::addpath(search_path, font_path);
osgDB::setDataFilePathList(search_path);
--- 213,219 ----
std::string font_path = g_Config.getPath("Paths", "FontPath", ".", true);
std::string search_path;
! simdata::ospath::addpath(search_path, image_path);
! simdata::ospath::addpath(search_path, model_path);
! simdata::ospath::addpath(search_path, font_path);
osgDB::setDataFilePathList(search_path);
Index: base.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/base.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** base.cpp 19 Feb 2003 11:41:58 -0000 1.4
--- base.cpp 12 Apr 2003 00:55:05 -0000 1.5
***************
*** 23,27 ****
**/
- #include "stdinc.h"
#include <cmath>
--- 23,26 ----
--- Platform.cpp DELETED ---
|
|
From: <mk...@us...> - 2003-04-12 00:54:20
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv26356 Modified Files: stdinc.h Removed Files: Platform.h Log Message: see CHANGES.current Index: stdinc.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/stdinc.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** stdinc.h 19 Feb 2003 11:41:57 -0000 1.3 --- stdinc.h 12 Apr 2003 00:54:17 -0000 1.4 *************** *** 2,31 **** #define __STDINC_H__ - #include <assert.h> - #include <cmath> - - #include <cstdio> - #include <cstdlib> - #include <iostream> - #include <iomanip> - #include <fstream> - #include <sstream> - - #include <vector> - #include <string> - #include <list> - #include <queue> - #include <deque> - #include <algorithm> - #include <new> - #include <set> - #include <map> - #include <functional> - - #include <fcntl.h> - - #include "Platform.h" - #include "LogStream.h" - //#include "mmgr.h" //#define OSG_USE_MEMORY_MANAGER --- 2,5 ---- --- Platform.h DELETED --- |
|
From: <mk...@us...> - 2003-04-12 00:37:26
|
Update of /cvsroot/csp/APPLICATIONS/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv22161
Modified Files:
CHANGES.current setup.py
Log Message:
Index: CHANGES.current
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** CHANGES.current 11 Apr 2003 20:00:58 -0000 1.20
--- CHANGES.current 12 Apr 2003 00:37:19 -0000 1.21
***************
*** 2,7 ****
--- 2,11 ----
===========================
+ 2003-04-11: onsight
+ Updated setup.py to install FileUtility.h.
+
2003-04-11: delta
Finally got the changes from Onsight compile on .net ;-)
+ ^- aah, it wasn't that bad ;-) --OS
2003-03-29: onsight
Index: setup.py
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/setup.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** setup.py 11 Apr 2003 18:06:33 -0000 1.14
--- setup.py 12 Apr 2003 00:37:19 -0000 1.15
***************
*** 209,212 ****
--- 209,213 ----
"Exception",
"External",
+ "FileUtility",
"GeoPos",
"HashUtility",
***************
*** 238,241 ****
--- 239,243 ----
"Export.h",
"External.h",
+ "FileUtility.h",
"GeoPos.h",
"GlibCsp.h",
|
|
From: <mk...@us...> - 2003-04-11 23:43:10
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv5133/Source
Modified Files:
AeroDynamics.cpp CSPSim.cpp ObjectModel.cpp StaticObject.cpp
Log Message:
see CHANGES.current
Index: AeroDynamics.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/AeroDynamics.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** AeroDynamics.cpp 3 Apr 2003 10:40:42 -0000 1.13
--- AeroDynamics.cpp 11 Apr 2003 23:43:06 -0000 1.14
***************
*** 469,482 ****
static const float groundBeta = 1.0e+6;
double impact = simdata::Dot(V, m_GroundN);
double scale = - (height*groundK + impact*fabs(impact)*groundBeta);
if (fabs(scale)>groundK) {
// dissipate some extra energy
if (impact < -10.0) {
//m_VelocityBody *= 0.50;
! m_VelocityBody -= 0.50 * impact * m_GroundN;
std::cout << "SLAM!!!!\n";
} else {
//m_VelocityBody *= 0.95;
! m_VelocityBody -= 0.95 * impact * m_GroundN;
std::cout << "SLAM!\n";
}
--- 469,486 ----
static const float groundBeta = 1.0e+6;
double impact = simdata::Dot(V, m_GroundN);
+ // spring plus damping terms
double scale = - (height*groundK + impact*fabs(impact)*groundBeta);
+ // semiarbitrary force limit
if (fabs(scale)>groundK) {
// dissipate some extra energy
+ double body_impact = simdata::Dot(m_VelocityBody, bodyn);
if (impact < -10.0) {
//m_VelocityBody *= 0.50;
!
! m_VelocityBody -= 0.25 * body_impact * bodyn;
std::cout << "SLAM!!!!\n";
} else {
//m_VelocityBody *= 0.95;
! m_VelocityBody -= 0.05 * body_impact * bodyn;
std::cout << "SLAM!\n";
}
***************
*** 489,493 ****
--- 493,499 ----
simdata::Vector3 force = scale * bodyn;
+ // sliding velocity
V -= impact * m_GroundN;
+ // in body coordinates
V = LocalToBody(V);
if (height < -1.0) height = -1.0;
Index: CSPSim.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/CSPSim.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** CSPSim.cpp 11 Apr 2003 18:59:20 -0000 1.18
--- CSPSim.cpp 11 Apr 2003 23:43:06 -0000 1.19
***************
*** 47,50 ****
--- 47,51 ----
#include "Platform.h"
#include "SimObject.h"
+ #include "StaticObject.h"
#include "VirtualBattlefield.h"
#include "ConsoleCommands.h"
***************
*** 53,56 ****
--- 54,58 ----
#include <SimData/Exception.h>
#include <SimData/DataArchive.h>
+ #include <SimData/Exception.h>
SDLWave m_audioWave;
***************
*** 180,284 ****
}
void CSPSim::init()
{
- CSP_LOG(CSP_APP, CSP_INFO, "Starting CSPSim...");
-
- std::string data_path = g_Config.getPath("Paths", "DataPath", ".", true);
- std::string archive_file = ospath::join(data_path, "sim.dar");
-
- // open the primary data archive
try {
! m_DataArchive = new simdata::DataArchive(archive_file.c_str(), 1);
! assert(m_DataArchive);
! }
! catch (simdata::Exception e) {
! CSP_LOG(CSP_APP, CSP_ERROR, "Error opening data archive " << archive_file);
! CSP_LOG(CSP_APP, CSP_ERROR, e.getType() << ": " << e.getMessage());
! ::exit(0);
! }
!
! // initialize SDL
! initSDL();
!
! SDL_WM_SetCaption("CSPSim", "");
! // put up Logo screen then do rest of initialization
! LogoScreen logoScreen(m_ScreenWidth, m_ScreenHeight);
! logoScreen.OnInit();
! glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
! logoScreen.onRender();
! SDL_GL_SwapBuffers();
! // load all interface maps and create a virtual hid for the active object
! m_InterfaceMaps = new EventMapIndex();
! m_InterfaceMaps->loadAllMaps();
! m_Interface = new VirtualHID();
! // FIXME: these functions should be separated!
! // create the battlefield + scenegraph
! m_Battlefield = new VirtualBattlefield();
! m_Battlefield->create();
! m_Battlefield->buildScene();
! // eventually this will be set in an entirely different way...
! m_ActiveTerrain = m_DataArchive->getObject("sim:terrain.balkan");
! m_ActiveTerrain->activate(m_Battlefield);
!
! // get view parameters from configuration file. ultimately there should
! // be an in-game ui for this and probably a separate config file.
! bool wireframe = g_Config.getBool("View", "Wireframe", false, true);
! m_Battlefield->setWireframeMode(wireframe);
! int view_distance = g_Config.getInt("View", "ViewDistance", 35000, true);
! m_Battlefield->setViewDistance(view_distance);
! bool fog = g_Config.getBool("View", "Fog", true, true);
! m_Battlefield->setFogMode(fog);
! int fog_start = g_Config.getInt("View", "FogStart", 20000, true);
! m_Battlefield->setFogStart(fog_start);
! int fog_end = g_Config.getInt("View", "FogEnd", 35000, true);
! m_Battlefield->setFogEnd(fog_end);
! // create a couple test objects
! simdata::Pointer<AircraftObject> ao = m_DataArchive->getObject("sim:vehicles.aircraft.m2k");
! assert(ao.valid());
! //ao->setGlobalPosition(483000, 499000, 2000);
! ao->setGlobalPosition(483000, 499000, 91.2);
! ao->setOrientation(0, 5.0, 0);
! ao->setVelocity(0, 120.0, 0);
! ao->setVelocity(0, 2.0, 0);
! ao->addToScene(m_Battlefield);
! m_Battlefield->addObject(ao);
!
! /*
! simdata::Pointer<DynamicObject> to = m_DataArchive->getObject("sim:vehicles.aircraft.m2k");
! assert(to.valid());
! to->setGlobalPosition(483000, 501000, 0);
! to->addToScene(m_Battlefield);
! m_Battlefield->addObject(to);
! */
! // create screens
! m_GameScreen = new GameScreen;
! // setup screens
! m_GameScreen->SetBattlefield(m_Battlefield);
! m_GameScreen->OnInit();
! // start in the aircraft
! setActiveObject(ao);
#if 0
! // set the Main Menu then start the main loop
! m_MainMenuScreen = new MenuScreen;
! m_MainMenuScreen->OnInit();
! changeScreen(m_MainMenuScreen);
#endif
! changeScreen(m_GameScreen);
!
! logoScreen.OnExit();
}
--- 182,298 ----
}
+
void CSPSim::init()
{
try {
! CSP_LOG(CSP_APP, CSP_INFO, "Starting CSPSim...");
! std::string data_path = g_Config.getPath("Paths", "DataPath", ".", true);
! std::string archive_file = ospath::join(data_path, "sim.dar");
!
! // open the primary data archive
! try {
! m_DataArchive = new simdata::DataArchive(archive_file.c_str(), 1);
! assert(m_DataArchive);
! }
! catch (simdata::Exception e) {
! CSP_LOG(CSP_APP, CSP_ERROR, "Error opening data archive " << archive_file);
! CSP_LOG(CSP_APP, CSP_ERROR, e.getType() << ": " << e.getMessage());
! ::exit(0);
! }
!
! // initialize SDL
! initSDL();
! SDL_WM_SetCaption("CSPSim", "");
! // put up Logo screen then do rest of initialization
! LogoScreen logoScreen(m_ScreenWidth, m_ScreenHeight);
! logoScreen.OnInit();
! glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
! logoScreen.onRender();
! SDL_GL_SwapBuffers();
! // load all interface maps and create a virtual hid for the active object
! m_InterfaceMaps = new EventMapIndex();
! m_InterfaceMaps->loadAllMaps();
! m_Interface = new VirtualHID();
! // FIXME: these functions should be separated!
! // create the battlefield + scenegraph
! m_Battlefield = new VirtualBattlefield();
! m_Battlefield->create();
! m_Battlefield->buildScene();
! // eventually this will be set in an entirely different way...
! m_ActiveTerrain = m_DataArchive->getObject("sim:terrain.balkan");
! m_ActiveTerrain->activate(m_Battlefield);
! // get view parameters from configuration file. ultimately there should
! // be an in-game ui for this and probably a separate config file.
! bool wireframe = g_Config.getBool("View", "Wireframe", false, true);
! m_Battlefield->setWireframeMode(wireframe);
! int view_distance = g_Config.getInt("View", "ViewDistance", 35000, true);
! m_Battlefield->setViewDistance(view_distance);
! bool fog = g_Config.getBool("View", "Fog", true, true);
! m_Battlefield->setFogMode(fog);
! int fog_start = g_Config.getInt("View", "FogStart", 20000, true);
! m_Battlefield->setFogStart(fog_start);
! int fog_end = g_Config.getInt("View", "FogEnd", 35000, true);
! m_Battlefield->setFogEnd(fog_end);
! // create a couple test objects
! simdata::Pointer<AircraftObject> ao = m_DataArchive->getObject("sim:vehicles.aircraft.m2k");
! assert(ao.valid());
! //ao->setGlobalPosition(483000, 499000, 2000);
! ao->setGlobalPosition(483000, 499000, 91.2);
! ao->setOrientation(0, 5.0, 0);
! ao->setVelocity(0, 120.0, 0);
! ao->setVelocity(0, 2.0, 0);
! ao->addToScene(m_Battlefield);
! m_Battlefield->addObject(ao);
#if 0
! static simdata::Pointer<StaticObject> so = m_DataArchive->getObject("sim:objects.runway");
! assert(so.valid());
! so->setGlobalPosition(483000, 499000, 100.0);
! so->addToScene(m_Battlefield);
#endif
+ // create screens
+ m_GameScreen = new GameScreen;
! // setup screens
! m_GameScreen->SetBattlefield(m_Battlefield);
! m_GameScreen->OnInit();
!
! // start in the aircraft
! setActiveObject(ao);
!
! #if 0
! // set the Main Menu then start the main loop
! m_MainMenuScreen = new MenuScreen;
! m_MainMenuScreen->OnInit();
! changeScreen(m_MainMenuScreen);
! #endif
!
! changeScreen(m_GameScreen);
! logoScreen.OnExit();
! }
! catch(DemeterException * pEx) {
! CSP_LOG(CSP_APP, CSP_ERROR, "CSPSim: caught Demeter exception during initialazation: " << pEx->GetErrorMessage());
! ::exit(1);
! }
! catch(simdata::Exception * pEx) {
! CSP_LOG(CSP_APP, CSP_ERROR, "CSPSim: caught SimData exception during initialization: " << pEx->getMessage());
! ::exit(1);
! }
! catch (...) {
! CSP_LOG(CSP_APP, CSP_ERROR, "CSPSim: caught unknown exception during initialazation.");
! ::exit(1);
! }
}
***************
*** 408,417 ****
CSP_LOG(CSP_APP, CSP_ERROR, "Caught Demeter Exception: " << pEx->GetErrorMessage());
cleanup();
! ::exit(0);
}
catch(...) {
CSP_LOG(CSP_APP, CSP_ERROR, "MAIN: Unexpected exception, GLErrorNUM: " << glGetError());
cleanup();
! ::exit(0);
}
--- 422,431 ----
CSP_LOG(CSP_APP, CSP_ERROR, "Caught Demeter Exception: " << pEx->GetErrorMessage());
cleanup();
! ::exit(1);
}
catch(...) {
CSP_LOG(CSP_APP, CSP_ERROR, "MAIN: Unexpected exception, GLErrorNUM: " << glGetError());
cleanup();
! ::exit(1);
}
Index: ObjectModel.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/ObjectModel.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ObjectModel.cpp 24 Mar 2003 10:37:02 -0000 1.6
--- ObjectModel.cpp 11 Apr 2003 23:43:06 -0000 1.7
***************
*** 33,37 ****
--- 33,39 ----
#include <osgDB/ReadFile>
#include <osgUtil/SmoothingVisitor>
+ #include <osg/NodeVisitor>
#include <osg/Geometry>
+ #include <osg/Texture>
#include <osg/Geode>
***************
*** 40,43 ****
--- 42,92 ----
+ /**
+ * Visit nodes, applying anisotropic filtering to textures.
+ */
+ class TrilinearFilterVisitor: public osg::NodeVisitor
+ {
+ float m_MaxAnisotropy;
+ public:
+ TrilinearFilterVisitor(float MaxAnisotropy=16.0):
+ m_MaxAnisotropy(MaxAnisotropy),
+ osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {
+ }
+
+ virtual void apply(osg::Node& node) {
+ osg::StateSet* ss = node.getStateSet();
+ filter(ss);
+ traverse(node);
+ }
+
+ virtual void apply(osg::Geode& geode) {
+ osg::StateSet* ss = geode.getStateSet();
+ filter(ss);
+ for(unsigned int i=0;i<geode.getNumDrawables();++i) {
+ osg::Drawable* drawable = geode.getDrawable(i);
+ if (drawable) {
+ ss = drawable->getStateSet();
+ filter(ss);
+ }
+ }
+ }
+
+ void filter(osg::StateSet *set) {
+ if (!set) return;
+ osg::StateSet::TextureAttributeList& attr = set->getTextureAttributeList();
+ osg::StateSet::TextureAttributeList::iterator i;
+ for (i = attr.begin(); i != attr.end(); i++) {
+ osg::StateSet::AttributeList::iterator tex = i->find(osg::StateAttribute::TEXTURE);
+ if (tex != i->end()) {
+ osg::Texture* texture = dynamic_cast<osg::Texture*>(tex->second.first.get());
+ if (texture) {
+ texture->setMaxAnisotropy(m_MaxAnisotropy);
+ }
+ }
+ }
+ }
+ };
+
+
std::string g_ModelPath = "";
***************
*** 50,53 ****
--- 99,103 ----
m_Scale = 1.0;
m_Smooth = true;
+ m_Filter = true;
}
***************
*** 64,67 ****
--- 114,118 ----
p.pack(m_Scale);
p.pack(m_Smooth);
+ p.pack(m_Filter);
p.pack(m_Contacts);
}
***************
*** 76,79 ****
--- 127,131 ----
p.unpack(m_Scale);
p.unpack(m_Smooth);
+ p.unpack(m_Filter);
p.unpack(m_Contacts);
}
***************
*** 128,131 ****
--- 180,184 ----
}
+
void ObjectModel::loadModel() {
if (g_ModelPath == "") {
***************
*** 185,188 ****
--- 238,247 ----
osgUtil::SmoothingVisitor sv;
m_Transform->accept(sv);
+ }
+
+ if (m_Filter) {
+ // FIXME: level should come from global graphics settings
+ TrilinearFilterVisitor tfv(16.0);
+ m_Transform->accept(tfv);
}
Index: StaticObject.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/StaticObject.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** StaticObject.cpp 26 Jan 2003 23:33:38 -0000 1.2
--- StaticObject.cpp 11 Apr 2003 23:43:06 -0000 1.3
***************
*** 26,29 ****
--- 26,33 ----
#include "StaticObject.h"
+ #include <SimData/InterfaceRegistry.h>
+
+ //SIMDATA_REGISTER_INTERFACE(StaticObject)
+
StaticObject::StaticObject(): SimObject()
|
|
From: <mk...@us...> - 2003-04-11 23:43:09
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include
In directory sc8-pr-cvs1:/tmp/cvs-serv5133/Include
Modified Files:
DynamicalSystem.h NumericalMethod.h ObjectModel.h
StaticObject.h
Log Message:
see CHANGES.current
Index: DynamicalSystem.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/DynamicalSystem.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DynamicalSystem.h 3 Apr 2003 10:40:22 -0000 1.2
--- DynamicalSystem.h 11 Apr 2003 23:43:06 -0000 1.3
***************
*** 37,43 ****
DynamicalSystem(unsigned short dimension);
DynamicalSystem(VectorField* pf);
! ~DynamicalSystem();
//void setVectorField(VectorField* pf);
! void setNumericalMethod(NumericalMethod* pnumericalMethod);
std::vector<double> const& flow(std::vector<double>& y0, double t0, double dt) const;
};
--- 37,43 ----
DynamicalSystem(unsigned short dimension);
DynamicalSystem(VectorField* pf);
! virtual ~DynamicalSystem();
//void setVectorField(VectorField* pf);
! void setNumericalMethod(NumericalMethod* pnumericalMethod);
std::vector<double> const& flow(std::vector<double>& y0, double t0, double dt) const;
};
Index: NumericalMethod.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/NumericalMethod.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NumericalMethod.h 4 Apr 2003 15:49:33 -0000 1.1
--- NumericalMethod.h 11 Apr 2003 23:43:06 -0000 1.2
***************
*** 53,64 ****
public:
NumericalMethod(bool deleteVF = true):
vectorField(0),
! m_bfailed(false),
! m_bdeleteVF(deleteVF) {
}
NumericalMethod(VectorField* pf, bool deleteVF = true):
vectorField(pf),
! m_bfailed(false),
! m_bdeleteVF(deleteVF) {
if (vectorField)
m_dimension = vectorField->getDimension();
--- 53,64 ----
public:
NumericalMethod(bool deleteVF = true):
+ m_bdeleteVF(deleteVF),
vectorField(0),
! m_bfailed(false) {
}
NumericalMethod(VectorField* pf, bool deleteVF = true):
+ m_bdeleteVF(deleteVF),
vectorField(pf),
! m_bfailed(false) {
if (vectorField)
m_dimension = vectorField->getDimension();
Index: ObjectModel.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/ObjectModel.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ObjectModel.h 21 Mar 2003 20:08:35 -0000 1.3
--- ObjectModel.h 11 Apr 2003 23:43:06 -0000 1.4
***************
*** 48,52 ****
typedef std::vector<simdata::Vector3> ContactList;
! SIMDATA_OBJECT(ObjectModel, 1, 0);
BEGIN_SIMDATA_XML_INTERFACE(ObjectModel)
--- 48,52 ----
typedef std::vector<simdata::Vector3> ContactList;
! SIMDATA_OBJECT(ObjectModel, 2, 0);
BEGIN_SIMDATA_XML_INTERFACE(ObjectModel)
***************
*** 58,61 ****
--- 58,62 ----
SIMDATA_XML("scale", ObjectModel::m_Scale, false)
SIMDATA_XML("smooth", ObjectModel::m_Smooth, false)
+ SIMDATA_XML("filter", ObjectModel::m_Filter, false)
SIMDATA_XML("contacts", ObjectModel::m_Contacts, false)
END_SIMDATA_XML_INTERFACE
***************
*** 85,88 ****
--- 86,90 ----
double m_Scale;
bool m_Smooth;
+ bool m_Filter;
ContactList m_Contacts;
Index: StaticObject.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/StaticObject.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** StaticObject.h 26 Jan 2003 23:34:13 -0000 1.2
--- StaticObject.h 11 Apr 2003 23:43:06 -0000 1.3
***************
*** 41,47 ****
--- 41,58 ----
virtual ~StaticObject();
+
+ // EXTEND_SIMDATA_XML_INTERFACE(StaticObject, SimObject)
+ // SIMDATA_XML("direction", StaticObject::m_Direction, false)
+ // END_SIMDATA_XML_INTERFACE
+
+ SIMDATA_OBJECT(StaticObject, 0, 0)
+
protected:
virtual void pack(simdata::Packer& p) const;
virtual void unpack(simdata::UnPacker& p);
+ virtual void dump() {}
+ virtual void onUpdate(double) {}
+ virtual void initialize() {}
+ virtual unsigned int onRender() { return 0; }
};
|