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: <mk...@us...> - 2003-03-26 10:18:56
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data/XML/vehicles/aircraft In directory sc8-pr-cvs1:/tmp/cvs-serv4700/vehicles/aircraft Modified Files: m2k.xml Log Message: Real->Float Index: m2k.xml =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Data/XML/vehicles/aircraft/m2k.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** m2k.xml 21 Mar 2003 20:09:40 -0000 1.2 --- m2k.xml 26 Mar 2003 10:18:53 -0000 1.3 *************** *** 13,22 **** <Bool name="complex_physics">true</Bool> ! <Real name="aileron_min">-25.0</Real> ! <Real name="aileron_max">25.0</Real> ! <Real name="elevator_min">-25.0</Real> ! <Real name="elevator_max">25.0</Real> ! <Real name="rudder_min">-25.0</Real> ! <Real name="rudder_max">25.0</Real> <Int name="army">0</Int> --- 13,22 ---- <Bool name="complex_physics">true</Bool> ! <Float name="aileron_min">-25.0</Float> ! <Float name="aileron_max">25.0</Float> ! <Float name="elevator_min">-25.0</Float> ! <Float name="elevator_max">25.0</Float> ! <Float name="rudder_min">-25.0</Float> ! <Float name="rudder_max">25.0</Float> <Int name="army">0</Int> *************** *** 24,28 **** <!-- Mass/Inertial properties --> <!-- ! <Real name="mass">7500.0</Real> <Matrix name="inertia"> 135691.0 0.0 0.0 --- 24,28 ---- <!-- Mass/Inertial properties --> <!-- ! <Float name="mass">7500.0</Float> <Matrix name="inertia"> 135691.0 0.0 0.0 *************** *** 31,35 **** </Matrix> --> ! <Real name="mass">10000.0</Real> <Matrix name="inertia"> 100000.0 0.0 0.0 --- 31,35 ---- </Matrix> --> ! <Float name="mass">10000.0</Float> <Matrix name="inertia"> 100000.0 0.0 0.0 *************** *** 44,80 **** <Vector name="max_position">0.0 3.3 -2.0</Vector> <Vector name="motion">0 0 1.0</Vector> ! <Number name="damage_limit">80000.0:10000.0</Number> ! <Real name="compression_limit">0.5</Real> ! <Real name="K">200000.0</Real> ! <Real name="beta">10000.0</Real> ! <Real name="brake_limit">3000.0</Real> ! <Real name="static_friction">0.7</Real> ! <Real name="dynamic_friction">0.5</Real> ! <Real name="steering_limit">45.0</Real> ! <Real name="tire_K">200000.0</Real> </Object> <Object class="LandingGear"> <!-- left main --> <Vector name="max_position">-1.4 -0.7 -2.0</Vector> <Vector name="motion">0 0 1.0</Vector> ! <Number name="damage_limit">80000.0</Number> ! <Real name="compression_limit">0.5</Real> ! <Real name="K">200000.0</Real> ! <Real name="beta">10000.0</Real> ! <Real name="brake_limit">3000.0</Real> ! <Real name="static_friction">0.7</Real> ! <Real name="dynamic_friction">0.5</Real> ! <Real name="tire_K">200000.0</Real> </Object> <Object class="LandingGear"> <!-- right main --> <Vector name="max_position">1.4 -0.7 -2.0</Vector> <Vector name="motion">0 0 1.0</Vector> ! <Number name="damage_limit">80000.0:10000.0</Number> ! <Real name="compression_limit">0.5</Real> ! <Real name="K">200000.0</Real> ! <Real name="beta">10000.0</Real> ! <Real name="brake_limit">3000.0</Real> ! <Real name="static_friction">0.7</Real> ! <Real name="dynamic_friction">0.5</Real> ! <Real name="tire_K">200000.0</Real> </Object> </List> --- 44,80 ---- <Vector name="max_position">0.0 3.3 -2.0</Vector> <Vector name="motion">0 0 1.0</Vector> ! <Real name="damage_limit">80000.0:10000.0</Real> ! <Float name="compression_limit">0.5</Float> ! <Float name="K">200000.0</Float> ! <Float name="beta">10000.0</Float> ! <Float name="brake_limit">3000.0</Float> ! <Float name="static_friction">0.7</Float> ! <Float name="dynamic_friction">0.5</Float> ! <Float name="steering_limit">45.0</Float> ! <Float name="tire_K">200000.0</Float> </Object> <Object class="LandingGear"> <!-- left main --> <Vector name="max_position">-1.4 -0.7 -2.0</Vector> <Vector name="motion">0 0 1.0</Vector> ! <Real name="damage_limit">80000.0</Real> ! <Float name="compression_limit">0.5</Float> ! <Float name="K">200000.0</Float> ! <Float name="beta">10000.0</Float> ! <Float name="brake_limit">3000.0</Float> ! <Float name="static_friction">0.7</Float> ! <Float name="dynamic_friction">0.5</Float> ! <Float name="tire_K">200000.0</Float> </Object> <Object class="LandingGear"> <!-- right main --> <Vector name="max_position">1.4 -0.7 -2.0</Vector> <Vector name="motion">0 0 1.0</Vector> ! <Real name="damage_limit">80000.0:10000.0</Real> ! <Float name="compression_limit">0.5</Float> ! <Float name="K">200000.0</Float> ! <Float name="beta">10000.0</Float> ! <Float name="brake_limit">3000.0</Float> ! <Float name="static_friction">0.7</Float> ! <Float name="dynamic_friction">0.5</Float> ! <Float name="tire_K">200000.0</Float> </Object> </List> |
|
From: <mk...@us...> - 2003-03-26 10:18:56
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data/XML/terrain In directory sc8-pr-cvs1:/tmp/cvs-serv4700/terrain Modified Files: balkan.xml Log Message: Real->Float Index: balkan.xml =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Data/XML/terrain/balkan.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** balkan.xml 26 Jan 2003 23:15:54 -0000 1.1 --- balkan.xml 26 Mar 2003 10:18:53 -0000 1.2 *************** *** 16,22 **** <External name="texture_file"></External> <External name="elevation_file"></External> ! <Real name="vertex_spacing">250</Real> ! <Real name="vertex_height">0.38</Real> ! <Real name="detail_threshold">8</Real> </Object> --- 16,22 ---- <External name="texture_file"></External> <External name="elevation_file"></External> ! <Float name="vertex_spacing">250</Float> ! <Float name="vertex_height">0.38</Float> ! <Float name="detail_threshold">8</Float> </Object> |
|
From: <mk...@us...> - 2003-03-26 10:18:56
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data/XML/environment In directory sc8-pr-cvs1:/tmp/cvs-serv4700/environment Modified Files: stars.xml Log Message: Real->Float Index: stars.xml =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Data/XML/environment/stars.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** stars.xml 19 Feb 2003 11:41:55 -0000 1.1 --- stars.xml 26 Mar 2003 10:18:53 -0000 1.2 *************** *** 4,8 **** <String name="source">Yale Bright Star Catalog</String> ! <Real name="magnitude_cutoff">5.8</Real> 0.0232783288985 -0.0996146670576 0.391358773231 1.0 0.7188 0.44945 --- 4,8 ---- <String name="source">Yale Bright Star Catalog</String> ! <Float name="magnitude_cutoff">5.8</Float> 0.0232783288985 -0.0996146670576 0.391358773231 1.0 0.7188 0.44945 |
|
From: <mk...@us...> - 2003-03-26 10:18:56
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data/XML/vehicles/tanks In directory sc8-pr-cvs1:/tmp/cvs-serv4700/vehicles/tanks Modified Files: t62.xml Log Message: Real->Float Index: t62.xml =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Data/XML/vehicles/tanks/t62.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** t62.xml 26 Jan 2003 23:15:55 -0000 1.1 --- t62.xml 26 Mar 2003 10:18:54 -0000 1.2 *************** *** 4,8 **** <Int name="army">5</Int> <Path name="model">t62.model</Path> ! <Real name="mass">41500</Real> <Matrix name="inertia"> 172000.0 0.0 0.0 --- 4,8 ---- <Int name="army">5</Int> <Path name="model">t62.model</Path> ! <Float name="mass">41500</Float> <Matrix name="inertia"> 172000.0 0.0 0.0 |
|
From: <mk...@us...> - 2003-03-26 10:18:02
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1:/tmp/cvs-serv4380 Modified Files: configure.in acinclude.m4 Log Message: Index: configure.in =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/configure.in,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** configure.in 20 Mar 2003 18:39:21 -0000 1.10 --- configure.in 26 Mar 2003 10:17:54 -0000 1.11 *************** *** 73,76 **** --- 73,78 ---- CSP_PYTHON(2.2.0) + CSP_SIMDATA(0.3.1) + AC_OUTPUT([Makefile Source/Makefile], []) Index: acinclude.m4 =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/acinclude.m4,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** acinclude.m4 20 Mar 2003 18:39:21 -0000 1.5 --- acinclude.m4 26 Mar 2003 10:17:54 -0000 1.6 *************** *** 151,152 **** --- 151,169 ---- ]) + dnl check for simdata + AC_DEFUN(CSP_SIMDATA, [ + min_version=$1 + dnl AC_MSG_CHECKING(for simdata >= $min_version) + AC_MSG_CHECKING(for simdata) + python -c 'import SimData' 1>/dev/null 2>&1 + if test "$?" = "0" ; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + AC_MSG_ERROR([ + SimData does not appear to be installed. CVS snapshots of SimData + are avalable from http://sourceforge.net/projects/csp + ]) + fi + ]) + |
|
From: <mk...@us...> - 2003-03-26 10:13:58
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv2840/Source
Added Files:
Noise.cpp Real.cpp
Removed Files:
Spread.cpp
Log Message:
--- NEW FILE: Noise.cpp ---
/* SimDataCSP: Data Infrastructure for Simulations
* Copyright (C) 2002 Mark Rose <tm...@st...>
*
* This file is part of SimDataCSP.
*
* 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.
*/
#include <SimData/Noise.h>
#include <SimData/Random.h>
NAMESPACE_SIMDATA
Perlin1D::Perlin1D(double persistence, int octaves, Interpolation interpolation) {
m_persistence = persistence;
m_octaves = octaves;
m_interpolation = interpolation;
randomize();
}
void Perlin1D::setParameters(double persistence, int octaves) {
m_persistence = persistence;
m_octaves = octaves;
}
void Perlin1D::setInterpolation(Interpolation interpolation) {
m_interpolation = interpolation;
}
void Perlin1D::setOffset(int idx) {
m_offset = idx;
}
void Perlin1D::randomize() {
m_offset = int(g_Random.newRand()*1.0e+9);
}
double Perlin1D::_getInterpolatedNoise(double x) {
int integer_X = int(x);
double fractional_X = x - integer_X;
double v1 = _getSmoothedNoise(integer_X);
double v2 = _getSmoothedNoise(integer_X + 1);
if (m_interpolation == LINEAR) {
return _linearInterpolate(v1, v2, fractional_X);
} else
if (m_interpolation == COSINE) {
return _cosineInterpolate(v1, v2, fractional_X);
}
double v0 = _getSmoothedNoise(integer_X - 1);
double v3 = _getSmoothedNoise(integer_X + 2);
return _cubicInterpolate(v0, v1, v2, v3, fractional_X);
}
double Perlin1D::getValue(double x) {
double total = 0.0;
double amplitude = 1.0;
double frequency = 1.0;
for (int i = 0; i < m_octaves; i++) {
amplitude *= m_persistence;
total += _getInterpolatedNoise(x * frequency + m_offset) * amplitude;
frequency *= 2.0;
}
return total;
}
std::vector<float> Perlin1D::generate(int n, bool periodic, double timescale, double amplitude, double offset) {
std::vector<float> buffer(n);
if (n > 0) {
int i;
double s = timescale/n;
for (i=0; i<n; i++) {
double f = i*s;
buffer[i] = (float) (getValue(f)*amplitude + offset);
}
if (periodic) {
s = 1.0 / n;
for (i=0; i<n/2; i++) {
float f = 0.5 + i*s;
float a = buffer[i];
float b = buffer[n-i-1];
buffer[i] = f*a+(1-f)*b;
buffer[n-i-1] = f*b+(1-f)*a;
}
}
}
return buffer;
}
NAMESPACE_END // namespace simdata
--- NEW FILE: Real.cpp ---
/* SimDataCSP: Data Infrastructure for Simulations
* Copyright (C) 2002 Mark Rose <tm...@st...>
*
* This file is part of SimDataCSP.
*
* 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.
*/
#include <SimData/Real.h>
#include <SimData/Random.h>
#include <SimData/Pack.h>
NAMESPACE_SIMDATA
// class Real
void Real::pack(Packer &p) const {
p.pack(_mean);
p.pack(_sigma);
}
void Real::unpack(UnPacker &p) {
p.unpack(_mean);
p.unpack(_sigma);
regen();
}
void Real::parseXML(const char* cdata) {
std::string s(cdata);
float mean, sigma = 0.0;
bool ok = true;
std::string::size_type pos = s.find(':');
if (pos == std::string::npos) {
int n = sscanf(s.c_str(), "%f", &mean);
if (n != 1) ok = false;
} else {
int n = sscanf(s.c_str(), "%f:%f", &mean, &sigma);
if (n != 2) ok = false;
}
set(mean, sigma);
if (!ok) throw ParseException("SYNTAX ERROR: expect 'float' or 'float:float'");
}
Real::Real(float mean, float sigma) {
set(mean, sigma);
regen();
}
void Real::set(float mean, float sigma) {
_mean = mean;
_sigma = sigma;
regen();
}
void Real::regen() {
if (_sigma <= 0.0)
_value = _mean;
else
_value = box_muller(_mean, _sigma);
}
float Real::getMean() { return _mean; }
float Real::getSigma() { return _sigma; }
float Real::getValue() { return _value; }
std::string Real:: asString() const {
char fmt[128];
snprintf(fmt, 128, "%f", _value);
return std::string(fmt);
}
float Real::__neg__() { return -_value; }
float Real::__pos__() { return _value; }
float Real::__abs__() { return static_cast<float>(fabs(_value)); }
int Real::__nonzero__() { return _value != 0.0; }
float Real::__float__() { return _value; }
int Real::__int__() { return (int)_value; }
long Real::__long__() { return (long)_value; }
float Real::__add__(float v) { return v + _value; }
float Real::__radd__(float v) { return v + _value; }
float Real::__sub__(float v) { return _value - v; }
float Real::__rsub__(float v) { return v - _value; }
float Real::__mul__(float v) { return v * _value; }
float Real::__rmul__(float v) { return v * _value; }
float Real::__div__(float v) { assert(v != 0.0); return _value / v; }
float Real::__rdiv__(float v) { assert(_value != 0.0); return v / _value; }
float Real::__rpow__(float v) { return static_cast<float>(pow(v, _value)); }
float Real::__pow__(float v) { return static_cast<float>(pow(_value, v)); }
NAMESPACE_END // namespace simdata
--- Spread.cpp DELETED ---
|
|
From: <mk...@us...> - 2003-03-26 10:12:46
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv2444/Include/SimData Removed Files: Spread.h Spread.i Log Message: --- Spread.h DELETED --- --- Spread.i DELETED --- |
|
From: <mk...@us...> - 2003-03-26 10:11:34
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv2050/Include/SimData
Added Files:
Conversions.h Conversions.i
Log Message:
--- NEW FILE: Conversions.h ---
/* SimDataCSP: Data Infrastructure for Simulations
* Copyright (C) 2002 Mark Rose <tm...@st...>
*
* This file is part of SimDataCSP.
*
* 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 Conversions.h
*
* Common unit conversion templates.
*
*/
#ifndef __CONVERSIONS_H__
#define __CONVERSIONS_H__
// SWIG template instantiations
#ifdef SWIG
#define SIMDATA_CVT(a) %template(convert_##a) a<double>;
#else
#define SIMDATA_CVT(a)
#endif
#include <SimData/ns-simdata.h>
NAMESPACE_SIMDATA
namespace convert {
// This is currently just a small set of unit conversions. Feel free to add
// additional routines. Try not to include simple "prefix" conversions such
// as meters to centimeters. Use the dominant (i.e. most common) base unit
// in each system of units if possible.
//
// NOTE: be sure to add corresponding template instantiations for SWIG
/**
* knots to meters per second
*/
template <typename T>
T kts_mps(T x) { return x * 0.514444; }
SIMDATA_CVT(kts_mps)
/**
* meters per second to knots
*/
template <typename T>
T mps_kts(T x) { return x * 1.94385; }
SIMDATA_CVT(mps_kts)
/**
* feet to meters
*/
template <typename T>
T ft_m(T x) { return x * 0.3048; }
SIMDATA_CVT(ft_m)
/**
* meters to feet
*/
template <typename T>
T m_ft(T x) { return x * 3.2808398950; }
SIMDATA_CVT(m_ft)
/**
* kilograms to pounds
*/
template <typename T>
T kg_lb(T x) { return x * 2.2046; }
SIMDATA_CVT(kg_lb)
/**
* pounds to kilograms
*/
template <typename T>
T lb_kg(T x) { return x * 0.45360; }
SIMDATA_CVT(lb_kg)
/**
* nautical miles to meters
*/
template <typename T>
T nm_m(T x) { return x * 1852.0; }
SIMDATA_CVT(nm_m)
/**
* meters to nautical miles
*/
template <typename T>
T m_nm(T x) { return x * 0.0005399568; }
SIMDATA_CVT(m_nm)
/**
* pascals to millimeters of mercury
*/
template <typename T>
T pa_mmhg(T x) { return x * 0.00752; }
SIMDATA_CVT(pa_mmhg)
/**
* millimeters of mercury to pascals
*/
template <typename T>
T mmhg_pa(T x) { return x * 133.0; }
SIMDATA_CVT(mmhg_pa)
} // namespace convert
NAMESPACE_END
#endif // __CONVERSIONS_H__
--- NEW FILE: Conversions.i ---
%module Conversions
%{
#include "SimData/Conversions.h"
%}
%include "SimData/Conversions.h"
|
|
From: <mk...@us...> - 2003-03-26 10:11:02
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv1870 Modified Files: setup.py Log Message: Index: setup.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/setup.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** setup.py 26 Mar 2003 05:08:01 -0000 1.10 --- setup.py 26 Mar 2003 10:10:58 -0000 1.11 *************** *** 217,221 **** "Quaternion", "Random", ! "Spread", "TypeAdapter", "Vector3", --- 217,221 ---- "Quaternion", "Random", ! "Real", "TypeAdapter", "Vector3", *************** *** 253,257 **** "Random.h", "Real.h", - "Spread.h", "String.h", "TypeAdapter.h", --- 253,256 ---- *************** *** 280,288 **** "Math.i", "Matrix3.i", "Object.i", "Pack.i", "Path.i", "Random.i", ! "Spread.i", "String.i", "Types.i", --- 279,288 ---- "Math.i", "Matrix3.i", + "Noise.i", "Object.i", "Pack.i", "Path.i", "Random.i", ! "Real.i", "String.i", "Types.i", |
|
From: <mk...@us...> - 2003-03-26 10:11:02
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv1870/Include/SimData Added Files: Noise.h Noise.i Real.i Log Message: --- NEW FILE: Noise.h --- /* SimDataCSP: Data Infrastructure for Simulations * Copyright (C) 2002 Mark Rose <tm...@st...> * * This file is part of SimDataCSP. * * 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 Noise.h * * Noise distribution classes. */ #ifndef __NOISE_H__ #define __NOISE_H__ #include <cmath> #include <vector> #include <SimData/Export.h> #include <SimData/ns-simdata.h> NAMESPACE_SIMDATA /** * class Perlin1D * * Encapsulates a perlin noise generator in one-dimension. * * Many introductions to perlin noise and its uses are available online, * via Google. Here's one such site: * * http://freespace.virgin.net/hugo.elias/models/m_perlin.htm * * @author Mark Rose <mr...@st...> */ class SIMDATA_EXPORT Perlin1D { public: typedef enum { LINEAR, COSINE, CUBIC } Interpolation; /** * Construct a new perline noise generator. * * @param persistence scale factor between succesive octaves * @param octaves number of octaves to generate * @param interpolation the method of interpolation between noise values */ Perlin1D(double persistence=0.5, int octaves=1, Interpolation interpolation=LINEAR); /** * Set the noise parameters. * * @param persistence scale factor between succesive octaves * @param octaves number of octaves to generate */ void setParameters(double persistence, int octaves); /** * Set the interpolation method. * * @param interpolation the method of interpolation between noise values */ void setInterpolation(Interpolation interpolation); /** * Set the offset into the noise functions. * * The offset can be used to reproducibly generate a given noise * distribution, or to create independent finite noise distributions * from the same generator. */ void setOffset(int idx); /** * Randomize the offset. * * Subsequent noise will generally be uncorrelated to previously * generated noise. Be aware that the random offset is in the * range 10^9, so for large noise sets this property will break down. */ void randomize(); /** * A simple pseudo-random number regenator. * * @param x the random seed. * @returns a pseudo-random number in the range 0-1. */ double _simpleRandom(int x) const { x = (x << 13) ^ x; return (1.0 - ((x * (x * x * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0); } /** * Get a weighted sum of adjacent random numbers to smooth the distribution. * * @param x the central point for the weighted sum * @returns the weighted sum */ double _getSmoothedNoise(int x) { return 0.5 * (_simpleRandom(x) + 0.5 * (_simpleRandom(x - 1) + _simpleRandom(x + 1))); } /** * Linear interpolation. * * @param a the first value * @param b the second value * @param x the fraction from a to b (0-1) * @returns the interpolated value */ double _linearInterpolate(double a, double b, double x) { return a*(1.0-x) + b*x; } /** * Cosine interpolation. * * @param a the first value * @param b the second value * @param x the fraction from a to b (0-1) * @returns the interpolated value */ double _cosineInterpolate(double a, double b, double x) { x = (1.0 - cos(x * 3.14159265)) * 0.5; return a*(1.0-x) + b*x; } /** * Cubic interpolation. * * @param v0 value(i-1) * @param v1 value(i) * @param v2 value(i+1) * @param v3 value(i+2) * @param x the fraction from v1 to v2 (0-1) * @returns the interpolated value */ double _cubicInterpolate(double v0, double v1, double v2, double v3, double x) { double P = (v3 - v2) - (v0 - v1); double Q = (v0 - v1) - P; double R = v2 - v0; return (((P*x + Q) * x) + R) * x + v1; } /** * Returns the noise value interpolated between the smoothed noise at * successive points in the distribution. * * @param x the point in the distribution * @returns the smoothed, interpolated noise value */ double _getInterpolatedNoise(double x); /** * Get the noise vaule at a particular position. * * @param x the point in the distribution * @returns the noise value */ double getValue(double x); /** * Generate a list of noise values. * * This is a convenience method to pregenerate a discrete perlin noise field. * Both perioidic and aperiodic fields can be created (the former have the same * value at the start and at the end). The noise field can be scaled in X and * Y (e.g. time and amplitude), as well as offset so that the mean value is * non-zero. * * @param n the number of noise values * @param periodic if true, the lists ends are blended to make them continuous * @param scale the scaling factor from the list index to the noise function * @param amplitude the noise amplitude * @param offset the noise offset */ std::vector<float> generate(int n, bool periodic, double scale=1.0, double amplitude=1.0, double offset=0.0); private: double m_persistence; int m_octaves; int m_offset; int m_interpolation; }; NAMESPACE_END // namespace simdata #endif //__NOISE_H__ --- NEW FILE: Noise.i --- %module Noise %{ #include "SimData/Noise.h" %} %include "std_vector.i" // HACK! #ifndef VFLOAT #define VFLOAT namespace std { %template(vector_t) vector<float>; } #endif %include "SimData/Noise.h" --- NEW FILE: Real.i --- %module Real %{ #include "SimData/Real.h" %} %include "std_string.i" //%import "SimData/Pack.i" %include "SimData/ns-simdata.h" %rename(__repr__) SIMDATA(Real)::asString() const; %include "SimData/Real.h" |
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv13063/Include/SimData
Modified Files:
Date.h GeoPos.h List.i LogStream.h Real.h TypeAdapter.h
Types.h Types.i ns-simdata.h
Log Message:
see CHANGES.current
Index: Date.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Date.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Date.h 26 Mar 2003 05:08:02 -0000 1.6
--- Date.h 26 Mar 2003 06:38:03 -0000 1.7
***************
*** 60,63 ****
--- 60,64 ----
#include <SimData/Pack.h>
#include <SimData/Exception.h>
+ #include <SimData/BaseType.h>
Index: GeoPos.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/GeoPos.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** GeoPos.h 10 Feb 2003 05:11:41 -0000 1.1
--- GeoPos.h 26 Mar 2003 06:38:03 -0000 1.2
***************
*** 267,271 ****
* @param zone UTM zone
* @param designator UTM zone letter
! * @alt altitude above the reference ellipse (in meters)
*/
void setUTM(double northing, double easting, char zone, char designator, double alt = 0.0);
--- 267,271 ----
* @param zone UTM zone
* @param designator UTM zone letter
! * @param alt altitude above the reference ellipse (in meters)
*/
void setUTM(double northing, double easting, char zone, char designator, double alt = 0.0);
***************
*** 277,281 ****
* @param easting UTM easting
* @param zone UTM zone (e.g. "10T")
! * @alt altitude above the reference ellipse (in meters)
*/
void setUTM(double northing, double easting, const char *zone, double alt = 0.0);
--- 277,281 ----
* @param easting UTM easting
* @param zone UTM zone (e.g. "10T")
! * @param alt altitude above the reference ellipse (in meters)
*/
void setUTM(double northing, double easting, const char *zone, double alt = 0.0);
Index: List.i
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/List.i,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** List.i 28 Jan 2003 23:26:06 -0000 1.2
--- List.i 26 Mar 2003 06:38:03 -0000 1.3
***************
*** 2,6 ****
%{
#include "SimData/List.h"
! #include "SimData/Spread.h"
#include "SimData/Vector3.h"
#include "SimData/Path.h"
--- 2,6 ----
%{
#include "SimData/List.h"
! #include "SimData/Real.h"
#include "SimData/Vector3.h"
#include "SimData/Path.h"
***************
*** 30,34 ****
//#define __LIST_TEMPLATES__
new_list(Int, int);
! new_list(Spread, SIMDATA(Spread));
//new_list(Vector3, SIMDATA(Vector3));
new_list(Path, SIMDATA(Path));
--- 30,34 ----
//#define __LIST_TEMPLATES__
new_list(Int, int);
! new_list(Real, SIMDATA(Real));
//new_list(Vector3, SIMDATA(Vector3));
new_list(Path, SIMDATA(Path));
Index: LogStream.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/LogStream.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** LogStream.h 21 Mar 2003 18:23:38 -0000 1.2
--- LogStream.h 26 Mar 2003 06:38:03 -0000 1.3
***************
*** 21,29 ****
* @file LogStream.h
*
**/
- /** \file logstream.hxx
- * Stream based logging mechanism.
- */
// Written by Bernie Bright, 1998
--- 21,27 ----
* @file LogStream.h
*
+ * Stream based logging mechanism.
**/
// Written by Bernie Bright, 1998
***************
*** 120,124 ****
/**
* Set the logging priority.
! * @param c The priority cutoff for logging messages.
*/
static void set_log_priority(int p);
--- 118,122 ----
/**
* Set the logging priority.
! * @param p The priority cutoff for logging messages.
*/
static void set_log_priority(int p);
***************
*** 249,253 ****
/**
* Set the output stream
! * @param out output stream
*/
void set_output( std::string const &fn ) {
--- 247,251 ----
/**
* Set the output stream
! * @param fn output file path
*/
void set_output( std::string const &fn ) {
Index: Real.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Real.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Real.h 28 Jan 2003 23:26:06 -0000 1.2
--- Real.h 26 Mar 2003 06:38:03 -0000 1.3
***************
*** 19,34 ****
*/
- /**
- * @file Real.h
- */
#ifndef __REAL_H__
#define __REAL_H__
NAMESPACE_SIMDATA
! typedef double Real;
NAMESPACE_END // namespace simdata
! #endif //__INTEGER_H__
--- 19,89 ----
*/
#ifndef __REAL_H__
#define __REAL_H__
+ #include <string>
+ #include <math.h>
+ #include <SimData/BaseType.h>
+
+
NAMESPACE_SIMDATA
!
! /**
! * class Real
! */
! class SIMDATA_EXPORT Real: public BaseType {
! float _mean, _sigma;
! float _value;
! public:
! Real(float mean=0.0, float sigma=0.0);
! void set(float mean, float sigma);
! void regen();
! float getMean();
! float getSigma();
! float getValue();
!
! virtual std::string asString() const;
!
! float __neg__();
! float __pos__();
! float __abs__();
! int __nonzero__();
! float __float__();
! int __int__();
! long __long__();
! float __add__(float v);
! float __radd__(float v);
! float __sub__(float v);
! float __rsub__(float v);
! float __mul__(float v);
! float __rmul__(float v);
! float __div__(float v);
! float __rdiv__(float v);
! float __rpow__(float v);
! float __pow__(float v);
!
! #ifndef SWIG
! inline operator float() { return _value; }
! #endif
!
! virtual void pack(Packer &p) const;
! virtual void unpack(UnPacker &p);
! virtual void parseXML(const char* cdata);
!
! // insert Python shadow class code to emulate "operator float()"
! #ifdef SWIG______NONO
! %insert("shadow") %{
! def __coerce__(self, other):
! if isinstance(other, Real):
! return (self.getValue(), other.getValue())
! return (self.getValue(), other)
! %}
! #endif // SWIG
!
! };
NAMESPACE_END // namespace simdata
! #endif //__REAL_H__
Index: TypeAdapter.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/TypeAdapter.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** TypeAdapter.h 21 Mar 2003 22:57:13 -0000 1.8
--- TypeAdapter.h 26 Mar 2003 06:38:03 -0000 1.9
***************
*** 46,50 ****
class BaseType;
! class Spread;
class Vector3;
class Matrix3;
--- 46,50 ----
class BaseType;
! class Real;
class Vector3;
class Matrix3;
***************
*** 154,158 ****
void set(Vector3 & x) const { setBase(x); }
void set(Matrix3 & x) const { setBase(x); }
! void set(Spread & x) const { setBase(x); }
void set(Curve & x) const { setBase(x); }
void set(Table & x) const { setBase(x); }
--- 154,158 ----
void set(Vector3 & x) const { setBase(x); }
void set(Matrix3 & x) const { setBase(x); }
! void set(Real & x) const { setBase(x); }
void set(Curve & x) const { setBase(x); }
void set(Table & x) const { setBase(x); }
***************
*** 218,222 ****
void set(PathPointerBase &x) const;
void set(External &x) const;
! void set(Spread &x) const;
void set(Enum &x) const;
void set(ListBase &x) const;
--- 218,222 ----
void set(PathPointerBase &x) const;
void set(External &x) const;
! void set(Real &x) const;
void set(Enum &x) const;
void set(ListBase &x) const;
Index: Types.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Types.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Types.h 10 Feb 2003 05:11:41 -0000 1.3
--- Types.h 26 Mar 2003 06:38:03 -0000 1.4
***************
*** 23,39 ****
#include <SimData/Date.h>
#include <SimData/GeoPos.h>
! #include <SimData/Vector3.h>
! #include <SimData/Matrix3.h>
! #include <SimData/Quaternion.h>
#include <SimData/List.h>
! #include <SimData/Spread.h>
#include <SimData/Path.h>
! #include <SimData/Integer.h>
#include <SimData/Real.h>
#include <SimData/String.h>
! #include <SimData/Interpolate.h>
! #include <SimData/External.h>
! #include <SimData/Enum.h>
#endif // __TYPES__
--- 23,40 ----
#include <SimData/Date.h>
+ #include <SimData/Enum.h>
+ #include <SimData/External.h>
#include <SimData/GeoPos.h>
! #include <SimData/Interpolate.h>
#include <SimData/List.h>
! #include <SimData/Matrix3.h>
#include <SimData/Path.h>
! #include <SimData/Quaternion.h>
#include <SimData/Real.h>
#include <SimData/String.h>
! #include <SimData/Vector3.h>
!
! //#include <SimData/Integer.h>
! //#include <SimData/Float.h>
#endif // __TYPES__
Index: Types.i
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Types.i,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Types.i 18 Mar 2003 10:04:03 -0000 1.4
--- Types.i 26 Mar 2003 06:38:03 -0000 1.5
***************
*** 21,25 ****
%include "SimData/GeoPos.i"
%include "SimData/External.i"
! %include "SimData/Spread.i"
%include "SimData/String.i"
%include "SimData/Enum.i"
--- 21,25 ----
%include "SimData/GeoPos.i"
%include "SimData/External.i"
! %include "SimData/Real.i"
%include "SimData/String.i"
%include "SimData/Enum.i"
Index: ns-simdata.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/ns-simdata.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ns-simdata.h 20 Mar 2003 00:24:47 -0000 1.3
--- ns-simdata.h 26 Mar 2003 06:38:03 -0000 1.4
***************
*** 21,25 ****
/**
! * @file ns-simdata
*/
--- 21,25 ----
/**
! * @file ns-simdata.h
*/
|
|
From: <mk...@us...> - 2003-03-26 06:38:06
|
Update of /cvsroot/csp/APPLICATIONS/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv13063
Modified Files:
CHANGES.current Makefile
Log Message:
see CHANGES.current
Index: CHANGES.current
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** CHANGES.current 26 Mar 2003 05:08:01 -0000 1.12
--- CHANGES.current 26 Mar 2003 06:38:02 -0000 1.13
***************
*** 3,7 ****
*** ANY MSVC USERS: PLEASE UPDATE THE PROJECT FILE TO INCLUDE ***
! *** NOISE.CPP ***
2003-03-25: onsight
--- 3,7 ----
*** ANY MSVC USERS: PLEASE UPDATE THE PROJECT FILE TO INCLUDE ***
! *** NOISE.CPP AND REAL.CPP, AND REMOVE SPREAD.CPP ***
2003-03-25: onsight
***************
*** 17,20 ****
--- 17,28 ----
More documentation of date classes, and a couple bug fixes in
Zulu.
+
+ Renamed Spread to Real.
+
+ Removed Integer and (the old) Real, which were just placeholders
+ for int and double that didn't appear to serve any purpose.
+
+ Added Doc directory with DOxygen config file and makefile. Make
+ doc now runs doxygen.
2003-03-22: delta
Index: Makefile
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Makefile,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Makefile 26 Mar 2003 05:08:01 -0000 1.9
--- Makefile 26 Mar 2003 06:38:02 -0000 1.10
***************
*** 18,21 ****
--- 18,24 ----
done
+ doc:
+ $(MAKE) -C Doc
+
default:
@python setup.py check_version
|
|
From: <mk...@us...> - 2003-03-26 06:38:06
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv13063/Source
Modified Files:
InterfaceRegistry.cpp Makefile TypeAdapter.cpp
Log Message:
see CHANGES.current
Index: InterfaceRegistry.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/InterfaceRegistry.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** InterfaceRegistry.cpp 18 Mar 2003 10:04:05 -0000 1.5
--- InterfaceRegistry.cpp 26 Mar 2003 06:38:03 -0000 1.6
***************
*** 239,243 ****
#include <vector>
! #include <SimData/Spread.h>
#include <SimData/Path.h>
--- 239,243 ----
#include <vector>
! #include <SimData/Real.h>
#include <SimData/Path.h>
***************
*** 266,271 ****
END_SIMDATA_XML_INTERFACE
int size;
! simdata::Spread x;
! std::vector<simdata::Spread> y;
std::vector<X> z;
X q;
--- 266,271 ----
END_SIMDATA_XML_INTERFACE
int size;
! simdata::Real x;
! std::vector<simdata::Real> y;
std::vector<X> z;
X q;
***************
*** 274,278 ****
cout << (float)x << endl;
cout << "y has " << y.size() << " items:" << endl;
! std::vector<simdata::Spread>::iterator i;
for (i=y.begin(); i != y.end(); i++) cout << " " << (float)(*i) << endl;
cout << "z has " << z.size() << " items:" << endl;
--- 274,278 ----
cout << (float)x << endl;
cout << "y has " << y.size() << " items:" << endl;
! std::vector<simdata::Real>::iterator i;
for (i=y.begin(); i != y.end(); i++) cout << " " << (float)(*i) << endl;
cout << "z has " << z.size() << " items:" << endl;
***************
*** 338,342 ****
float float_test;
std::string string_test;
! simdata::Spread spread_test;
simdata::SimDate date_test;
simdata::Vector3 vector_test;
--- 338,342 ----
float float_test;
std::string string_test;
! simdata::Real spread_test;
simdata::SimDate date_test;
simdata::Vector3 vector_test;
***************
*** 348,352 ****
simdata::Table table_test;
simdata::PathPointer<A> path_test;
! std::vector<simdata::Spread> list_test;
TEST(): simdata::Object(), enumeration("A B C D"), enum_test(enumeration) {}
virtual void pack(simdata::Packer &) const {
--- 348,352 ----
simdata::Table table_test;
simdata::PathPointer<A> path_test;
! std::vector<simdata::Real> list_test;
TEST(): simdata::Object(), enumeration("A B C D"), enum_test(enumeration) {}
virtual void pack(simdata::Packer &) const {
***************
*** 365,369 ****
cout << " table_test " << table_test.asString() << endl;
cout << " list_test ";
! std::vector<simdata::Spread>::const_iterator j;
for (j=list_test.begin(); j != list_test.end(); j++) cout << j->asString();
cout << endl;
--- 365,369 ----
cout << " table_test " << table_test.asString() << endl;
cout << " list_test ";
! std::vector<simdata::Real>::const_iterator j;
for (j=list_test.begin(); j != list_test.end(); j++) cout << j->asString();
cout << endl;
Index: Makefile
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Makefile,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Makefile 26 Mar 2003 05:08:03 -0000 1.7
--- Makefile 26 Mar 2003 06:38:03 -0000 1.8
***************
*** 30,34 ****
Quaternion \
Random \
! Spread \
TypeAdapter \
Vector3 \
--- 30,34 ----
Quaternion \
Random \
! Real \
TypeAdapter \
Vector3 \
Index: TypeAdapter.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/TypeAdapter.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TypeAdapter.cpp 18 Mar 2003 10:04:06 -0000 1.3
--- TypeAdapter.cpp 26 Mar 2003 06:38:03 -0000 1.4
***************
*** 60,64 ****
void TypeAdapter::set(PathPointerBase &x) const { setBase(x); }
void TypeAdapter::set(External &x) const { setBase(x); }
! void TypeAdapter::set(Spread &x) const { setBase(x); }
void TypeAdapter::set(Enum &x) const { if (isType(STRING)) x = s; else setBase(x); }
void TypeAdapter::set(ListBase &x) const { setBase(x); }
--- 60,64 ----
void TypeAdapter::set(PathPointerBase &x) const { setBase(x); }
void TypeAdapter::set(External &x) const { setBase(x); }
! void TypeAdapter::set(Real &x) const { setBase(x); }
void TypeAdapter::set(Enum &x) const { if (isType(STRING)) x = s; else setBase(x); }
void TypeAdapter::set(ListBase &x) const { setBase(x); }
|
|
From: <mk...@us...> - 2003-03-26 06:37:17
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Doc In directory sc8-pr-cvs1:/tmp/cvs-serv12892/Doc Log Message: Directory /cvsroot/csp/APPLICATIONS/SimData/Doc added to the repository |
|
From: <mk...@us...> - 2003-03-26 05:08:06
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv22807/Source
Modified Files:
Interpolate.cpp Makefile Random.cpp
Log Message:
see CHANGES.current
Index: Interpolate.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Interpolate.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Interpolate.cpp 18 Mar 2003 10:04:05 -0000 1.5
--- Interpolate.cpp 26 Mar 2003 05:08:03 -0000 1.6
***************
*** 26,29 ****
--- 26,32 ----
NAMESPACE_SIMDATA
+ typedef InterpolatedData::value_t value_t;
+ typedef InterpolatedData::vector_t vector_t;
+
#define min(a, b) (((a)<(b)) ? (a) : (b))
***************
*** 86,90 ****
}
! int InterpolatedData::find(vector_t b, value_t v) {
int lo = 0;
int hi = b.size()-1;
--- 89,93 ----
}
! int InterpolatedData::find(vector_t b, value_t v) const {
int lo = 0;
int hi = b.size()-1;
***************
*** 178,182 ****
}
! value_t Curve::getPrecise(value_t v) {
int i = find(_breaks, v);
double h = _breaks[i+1] - _breaks[i];
--- 181,185 ----
}
! value_t Curve::getPrecise(value_t v) const {
int i = find(_breaks, v);
double h = _breaks[i+1] - _breaks[i];
***************
*** 192,196 ****
}
! value_t Curve::getValue(value_t p) {
double i = (p - _min) / _range;
if (i < 0.0) i = 0.0;
--- 195,199 ----
}
! value_t Curve::getValue(value_t p) const {
double i = (p - _min) / _range;
if (i < 0.0) i = 0.0;
***************
*** 205,212 ****
}
! void Curve::dumpCurve(FILE* f) {
double x = _min;
double d = _range / _table.size();
! vector_it element = _table.begin();
while (element != _table.end()) {
fprintf(f, "%.4f %.4f\n", x, *element++);
--- 208,215 ----
}
! void Curve::dumpCurve(FILE* f) const {
double x = _min;
double d = _range / _table.size();
! vector_cit element = _table.begin();
while (element != _table.end()) {
fprintf(f, "%.4f %.4f\n", x, *element++);
***************
*** 260,264 ****
}
! int Table::isValid() {
return _valid;
}
--- 263,267 ----
}
! int Table::isValid() const {
return _valid;
}
***************
*** 371,375 ****
}
! value_t Table::getPrecise(value_t x, value_t y) {
assert(isValid());
int x_i = find(_x_breaks, x);
--- 374,378 ----
}
! value_t Table::getPrecise(value_t x, value_t y) const {
assert(isValid());
int x_i = find(_x_breaks, x);
***************
*** 411,415 ****
}
! value_t Table::getValue(value_t x, value_t y) {
assert(isValid());
double x_i = (x - _x_min) / _x_range;
--- 414,418 ----
}
! value_t Table::getValue(value_t x, value_t y) const {
assert(isValid());
double x_i = (x - _x_min) / _x_range;
***************
*** 462,469 ****
}
! void Table::toPGM(FILE *fp) {
fprintf(fp, "P2 %d %d 255\n", _x_in, _y_in);
int i, j;
! vector_it element = _table.begin();
double min=1e+10, max=-1e+10, v;
for (i=_x_in*_y_in; i>0; i--) {
--- 465,472 ----
}
! void Table::toPGM(FILE *fp) const {
fprintf(fp, "P2 %d %d 255\n", _x_in, _y_in);
int i, j;
! vector_cit element = _table.begin();
double min=1e+10, max=-1e+10, v;
for (i=_x_in*_y_in; i>0; i--) {
***************
*** 485,491 ****
}
! void Table::dumpTable(FILE *fp) {
int i, j;
! vector_it element = _table.begin();
for (j=0; j<_y_in; j++) {
for (i=0; i<_x_in; i++) {
--- 488,494 ----
}
! void Table::dumpTable(FILE *fp) const {
int i, j;
! vector_cit element = _table.begin();
for (j=0; j<_y_in; j++) {
for (i=0; i<_x_in; i++) {
***************
*** 496,502 ****
}
! void Table::dumpDRows(FILE *fp) {
int i, j;
! vector_it element = _drows.begin();
for (j=0; j<_y_n; j++) {
for (i=0; i<_x_n; i++) {
--- 499,505 ----
}
! void Table::dumpDRows(FILE *fp) const {
int i, j;
! vector_cit element = _drows.begin();
for (j=0; j<_y_n; j++) {
for (i=0; i<_x_n; i++) {
***************
*** 507,513 ****
}
! void Table::dumpDCols(FILE *fp) {
int i, j;
! vector_it element = _dcols.begin();
for (j=0; j<_y_n; j++) {
for (i=0; i<_x_n; i++) {
--- 510,516 ----
}
! void Table::dumpDCols(FILE *fp) const {
int i, j;
! vector_cit element = _dcols.begin();
for (j=0; j<_y_n; j++) {
for (i=0; i<_x_n; i++) {
Index: Makefile
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Makefile,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Makefile 21 Mar 2003 18:38:03 -0000 1.6
--- Makefile 26 Mar 2003 05:08:03 -0000 1.7
***************
*** 1,4 ****
TOPDIR = ..
! INCLUDE = -I$(TOPDIR)/Include
CFLAGS = $(GCFLAGS) $(INCLUDE) $(GDEBUGF)
--- 1,4 ----
TOPDIR = ..
! INCLUDE = -I$(TOPDIR)/Include -I$(PYTHON_INCLUDE)
CFLAGS = $(GCFLAGS) $(INCLUDE) $(GDEBUGF)
***************
*** 24,27 ****
--- 24,28 ----
Math \
Matrix3 \
+ Noise \
Object \
Pack \
***************
*** 93,96 ****
--- 94,98 ----
ar cru $@ $^
ranlib $@
+ cp $@ $(TOPDIR)/SimData
_cSimData.so: $(OBJECTS) cSimData_wrap.o
***************
*** 103,107 ****
cSimData_wrap.o: cSimData_wrap.cpp
! $(CXX) -I$(PYTHON_INCLUDE) -DSWIG_GLOBAL -c $(SWCXXF) $(@:.o=.cpp)
%.o: %.cpp
--- 105,109 ----
cSimData_wrap.o: cSimData_wrap.cpp
! $(CXX) -c $(SWCXXF) -I$(PYTHON_INCLUDE) $(@:.o=.cpp)
%.o: %.cpp
Index: Random.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Random.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Random.cpp 6 Feb 2003 21:22:57 -0000 1.3
--- Random.cpp 26 Mar 2003 05:08:03 -0000 1.4
***************
*** 46,51 ****
else {
do {
! x1 = 2.0 * g_Random.NewRand() - 1.0;
! x2 = 2.0 * g_Random.NewRand() - 1.0;
w = x1 * x1 + x2 * x2;
} while ( w >= 1.0 );
--- 46,51 ----
else {
do {
! x1 = 2.0 * g_Random.newRand() - 1.0;
! x2 = 2.0 * g_Random.newRand() - 1.0;
w = x1 * x1 + x2 * x2;
} while ( w >= 1.0 );
***************
*** 144,148 ****
/*
! * Generate random number with a normal distribution.
*
* Classic, fast method using polar coordinates. See
--- 144,148 ----
/*
! * Generate a random number with a normal distribution.
*
* Classic, fast method using polar coordinates. See
***************
*** 162,167 ****
else {
do {
! x1 = 2.0 * NewRand() - 1.0;
! x2 = 2.0 * NewRand() - 1.0;
w = x1 * x1 + x2 * x2;
} while ( w >= 1.0 );
--- 162,167 ----
else {
do {
! x1 = 2.0 * newRand() - 1.0;
! x2 = 2.0 * newRand() - 1.0;
w = x1 * x1 + x2 * x2;
} while ( w >= 1.0 );
|
|
From: <mk...@us...> - 2003-03-26 05:08:06
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv22807/Include/SimData
Modified Files:
Date.h Interpolate.h Interpolate.i Random.h cSimData.i
vector.i
Log Message:
see CHANGES.current
Index: Date.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Date.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Date.h 19 Feb 2003 21:24:58 -0000 1.5
--- Date.h 26 Mar 2003 05:08:02 -0000 1.6
***************
*** 421,428 ****
! /*
! * Times are represented as floats in seconds since midnight. This
* makes time based calculations relatively easy. When the second
! * count exceeds 86000, the day is incremented and the clock reset.
* Resetting the clock can cause problems with calculations involving
* changes in time, so care must be taken. The advantage of keeping
--- 421,433 ----
! /**
! * class Zulu
! *
! * This class represents the time of day in "zulu" time (i.e. UTC
! * or Greenwich Mean).
! *
! * Times are stored as doubles in seconds since midnight. This
* makes time based calculations relatively easy. When the second
! * count exceeds 86400, the day is incremented and the clock reset.
* Resetting the clock can cause problems with calculations involving
* changes in time, so care must be taken. The advantage of keeping
***************
*** 430,436 ****
* intervals. In computing time intervals that should be small,
* use the SimDate::interval function.
*/
-
class SIMDATA_EXPORT Zulu {
--- 435,447 ----
* intervals. In computing time intervals that should be small,
* use the SimDate::interval function.
+ *
+ * A timezone parameter and options for operating on "local" times
+ * are provided. Care must be taken when using these methods in
+ * conjunction with dates, since the date may differ depending on
+ * whether local or zulu time is used.
+ *
+ * @author Mark Rose <mr...@st...>
*/
class SIMDATA_EXPORT Zulu {
***************
*** 438,441 ****
--- 449,457 ----
typedef double time_t;
+ /**
+ * Default constructor.
+ *
+ * Time set to midnight, Greenwich mean.
+ */
Zulu() {
m_time = 0;
***************
*** 443,446 ****
--- 459,470 ----
}
+ /**
+ * Construct a Zulu from the hour, minute, and second.
+ *
+ * @param hour hour (0-23)
+ * @param minute minute (0-59)
+ * @param second second (0.0-60.0)
+ * @param tz timezone (defaults to Greenwich mean)
+ */
Zulu(int hour, int minute, time_t second, int tz=0) {
m_time = hour*3600.0 + minute*60.0 + second;
***************
*** 448,451 ****
--- 472,481 ----
}
+ /**
+ * Construct a Zulu from the seconds since midnight.
+ *
+ * @param second seconds since midnight (0.0-86400.0)
+ * @param tz timezone (default to Greenwich mean)
+ */
Zulu(time_t second, int tz=0) {
m_time = second;
***************
*** 453,456 ****
--- 483,489 ----
}
+ /**
+ * Copy constructor
+ */
Zulu(const Zulu &z) {
*this = z;
***************
*** 458,461 ****
--- 491,497 ----
#ifndef SWIG
+ /**
+ * Copy operator.
+ */
const Zulu &operator=(const Zulu &z) {
m_time = z.m_time;
***************
*** 465,486 ****
#endif // SWIG
void setTZ(int tz) {
m_tz = tz;
}
int getTZ() const {
return m_tz;
}
int reduce();
time_t getTime(bool local=false) const {
return m_time + (local ? (m_tz * 3600.0) : 0.0);
}
bool overflow() const {
! return m_time >= 86000.0f;
}
int getHour(bool local=false) const {
int adjust = local ? m_tz : 0;
--- 501,550 ----
#endif // SWIG
+ /**
+ * Set the timezone (only effects the local time)
+ *
+ * @param tz timezone (hour offset from Greenwich mean)
+ */
void setTZ(int tz) {
m_tz = tz;
}
+ /**
+ * Get the timezone.
+ */
int getTZ() const {
return m_tz;
}
+ /**
+ * Wrap time to 24 hour period.
+ *
+ * Reduces the seconds since midnight to the range 0-86400.
+ *
+ * @returns the number of days subtracted to bring the time into range.
+ */
int reduce();
+ /**
+ * Get the curret time in seconds since midnight.
+ *
+ * @param local adjust the result to reflect the timezone.
+ */
time_t getTime(bool local=false) const {
return m_time + (local ? (m_tz * 3600.0) : 0.0);
}
+ /**
+ * Test if the time accumulator exceeds 24 hours.
+ */
bool overflow() const {
! return m_time >= 86400.0f;
}
+ /**
+ * Get the hour.
+ *
+ * @param local adjust the result to reflect the timezone.
+ */
int getHour(bool local=false) const {
int adjust = local ? m_tz : 0;
***************
*** 488,511 ****
}
int getMinute() const {
return (((int)m_time) / 60) % 60;
}
int getSecond() const {
return ((int)m_time) % 60;
}
! void addTime(time_t dt) {
m_time += dt;
}
! void setTime(time_t t) {
m_time = t;
}
void convert(struct tm *tm, bool local=false) const;
std::string formatString(const char *format, bool local=false) const;
virtual std::string asString() const {
return formatString("%H:%M:%Sz");
--- 552,611 ----
}
+ /**
+ * Get the minute.
+ */
int getMinute() const {
return (((int)m_time) / 60) % 60;
}
+ /**
+ * Get the second.
+ */
int getSecond() const {
return ((int)m_time) % 60;
}
! /**
! * Advance the time.
! *
! * @param dt the number of seconds to add.
! * @return true if the time exceeds 24 hours (zulu)
! */
! bool addTime(time_t dt) {
m_time += dt;
+ return overflow();
}
! /**
! * Set the time.
! *
! * @param t the number of seconds since midnight.
! * @param local if true, t represents the local time (not zulu).
! */
! void setTime(time_t t, bool local=false) {
! if (local) t -= m_tz * 3600.0;
m_time = t;
}
+ /**
+ * Extract time from a C tm structure.
+ *
+ * @param tm a time structure returned by gmtime() and localtime()
+ * @param local if true, tm represents the local time (not zulu).
+ */
void convert(struct tm *tm, bool local=false) const;
+ /**
+ * Format the time as a string.
+ *
+ * @param format a format string: see the standard C function strftime() for details.
+ * @param local if true, format the local time (not zulu).
+ */
std::string formatString(const char *format, bool local=false) const;
+
+ /**
+ * Return the time as a string in the form "HH:MM::SSz"
+ */
virtual std::string asString() const {
return formatString("%H:%M:%Sz");
***************
*** 518,521 ****
--- 618,630 ----
+
+ /**
+ * class DateZulu
+ *
+ * This class combines time and date operations into a single object.
+ *
+ * @author Mark Rose <mr...@st...>
+ */
+
class SIMDATA_EXPORT DateZulu: public Date, public Zulu {
***************
*** 580,583 ****
--- 689,696 ----
+ /**
+ * SimTime is not actually a class, but just a floating point
+ * type that stores seconds since midnight.
+ */
typedef DateZulu::time_t SimTime;
Index: Interpolate.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Interpolate.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Interpolate.h 28 Jan 2003 23:26:06 -0000 1.2
--- Interpolate.h 26 Mar 2003 05:08:02 -0000 1.3
***************
*** 46,52 ****
--- 46,54 ----
+ /*
#define value_t float
#define vector_t std::vector<value_t>
#define vector_it std::vector<value_t>::iterator
+ */
***************
*** 76,82 ****
public:
! // typedef float value_t;
! // typedef vector<value_t> vector_t;
! // typedef vector<value_t>::iterator vector_it;
static const Enumeration Method;;
--- 78,85 ----
public:
! typedef float value_t;
! typedef std::vector<value_t> vector_t;
! typedef std::vector<value_t>::iterator vector_it;
! typedef std::vector<value_t>::const_iterator vector_cit;
static const Enumeration Method;;
***************
*** 90,94 ****
virtual value_t getPrecise(value_t, value_t) const;
vector_t compute_second_derivatives(const vector_t& breaks, const vector_t& data);
! int find(vector_t b, value_t v);
};
--- 93,97 ----
virtual value_t getPrecise(value_t, value_t) const;
vector_t compute_second_derivatives(const vector_t& breaks, const vector_t& data);
! int find(vector_t b, value_t v) const;
};
***************
*** 122,128 ****
void interpolate(value_t spacing);
virtual void _compute_second_derivatives();
! value_t getPrecise(value_t v);
! value_t getValue(value_t p);
! void dumpCurve(FILE* f);
virtual std::string asString() const;
};
--- 125,131 ----
void interpolate(value_t spacing);
virtual void _compute_second_derivatives();
! value_t getPrecise(value_t v) const;
! value_t getValue(value_t p) const;
! void dumpCurve(FILE* f) const;
virtual std::string asString() const;
};
***************
*** 154,158 ****
#endif // SWIG
void invalidate();
! int isValid();
virtual void pack(Packer &p) const;
virtual void unpack(UnPacker &p);
--- 157,161 ----
#endif // SWIG
void invalidate();
! int isValid() const;
virtual void pack(Packer &p) const;
virtual void unpack(UnPacker &p);
***************
*** 169,179 ****
void setData(const vector_t& data);
void interpolate();
! value_t getPrecise(value_t x, value_t y);
! value_t getValue(value_t x, value_t y);
virtual void _compute_second_derivatives();
! void toPGM(FILE *fp);
! void dumpTable(FILE *fp);
! void dumpDRows(FILE *fp);
! void dumpDCols(FILE *fp);
virtual std::string asString() const;
--- 172,182 ----
void setData(const vector_t& data);
void interpolate();
! value_t getPrecise(value_t x, value_t y) const;
! value_t getValue(value_t x, value_t y) const;
virtual void _compute_second_derivatives();
! void toPGM(FILE *fp) const;
! void dumpTable(FILE *fp) const;
! void dumpDRows(FILE *fp) const;
! void dumpDCols(FILE *fp) const;
virtual std::string asString() const;
Index: Interpolate.i
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Interpolate.i,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Interpolate.i 28 Jan 2003 23:26:06 -0000 1.2
--- Interpolate.i 26 Mar 2003 05:08:02 -0000 1.3
***************
*** 5,11 ****
--- 5,14 ----
%include "std_vector.i"
+ #ifndef VFLOAT
+ #define VFLOAT
namespace std {
%template(vector_t) vector<float>;
}
+ #endif
using namespace std;
typedef std::vector vector;
Index: Random.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Random.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Random.h 6 Feb 2003 21:22:39 -0000 1.4
--- Random.h 26 Mar 2003 05:08:02 -0000 1.5
***************
*** 30,34 ****
#define __RANDOM_H__
! #include <math.h>
#include <SimData/Export.h>
--- 30,34 ----
#define __RANDOM_H__
! #include <cmath>
#include <SimData/Export.h>
***************
*** 61,68 ****
_r = ran2(_seed);
}
! float GetRand() {
return _r;
}
! float NewRand() {
_r = ran2(_seed);
return _r;
--- 61,71 ----
_r = ran2(_seed);
}
! float getRand() const {
return _r;
}
! long getSeed() const {
! return _seed;
! }
! float newRand() {
_r = ran2(_seed);
return _r;
***************
*** 84,88 ****
float box_muller(float, float);
float newGauss();
! float getGauss() { return _g; }
};
--- 87,91 ----
float box_muller(float, float);
float newGauss();
! float getGauss() const { return _g; }
};
Index: cSimData.i
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/cSimData.i,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** cSimData.i 20 Mar 2003 17:53:41 -0000 1.4
--- cSimData.i 26 Mar 2003 05:08:02 -0000 1.5
***************
*** 52,55 ****
--- 52,57 ----
%include "SimData/Exception.i"
%include "SimData/HashUtility.i"
+ %include "SimData/Conversions.i"
+ %include "SimData/Noise.i"
%include "SimData/Types.i"
Index: vector.i
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/vector.i,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** vector.i 28 Jan 2003 23:26:06 -0000 1.2
--- vector.i 26 Mar 2003 05:08:03 -0000 1.3
***************
*** 8,15 ****
#define __VECTOR_TEMPLATES__
namespace std {
! # %template(vector_d) vector<double>;
%template(vector_s) vector<Spread>;
! # %template(vector_f) vector<float>;
! # %template(vector_i) vector<int>;
}
#endif // __VECTOR_TEMPLATES__
--- 8,15 ----
#define __VECTOR_TEMPLATES__
namespace std {
! // %template(vector_d) vector<double>;
%template(vector_s) vector<Spread>;
! // %template(vector_f) vector<float>;
! // %template(vector_i) vector<int>;
}
#endif // __VECTOR_TEMPLATES__
|
|
From: <mk...@us...> - 2003-03-26 05:08:05
|
Update of /cvsroot/csp/APPLICATIONS/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv22807
Modified Files:
CHANGES.current Makefile setup.py
Log Message:
see CHANGES.current
Index: CHANGES.current
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** CHANGES.current 22 Mar 2003 15:20:44 -0000 1.11
--- CHANGES.current 26 Mar 2003 05:08:01 -0000 1.12
***************
*** 2,5 ****
--- 2,21 ----
===========================
+ *** ANY MSVC USERS: PLEASE UPDATE THE PROJECT FILE TO INCLUDE ***
+ *** NOISE.CPP ***
+
+ 2003-03-25: onsight
+ Changed #define types for InterpolatedData to class typedefs.
+
+ Made several methods const, and added a const iterator typedef.
+
+ Preliminary implementation of a one-dimensional perlin noise
+ class.
+
+ Added some basic unit connversion functions.
+
+ More documentation of date classes, and a couple bug fixes in
+ Zulu.
+
2003-03-22: delta
Minor changes to setup.py under make_install_win
Index: Makefile
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Makefile,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Makefile 22 Mar 2003 13:00:49 -0000 1.8
--- Makefile 26 Mar 2003 05:08:01 -0000 1.9
***************
*** 1,8 ****
SUBDIRS = Source
! export PYTHON_INCLUDE := -I$(shell python setup.py python_include_path)
export GDEBUGF = -g -Wall
! export GCFLAGS = -fPIC -O2 $(PYTHON_INCLUDE)# -march=athlon-tbird
export GLDOPTS = -shared -lswigpy -ldl
export GSWOPTS = -c -c++ -python -noexcept
--- 1,8 ----
SUBDIRS = Source
! export PYTHON_INCLUDE := $(shell python setup.py python_include_path)
export GDEBUGF = -g -Wall
! export GCFLAGS = -fPIC -O2# -march=athlon-tbird
export GLDOPTS = -shared -lswigpy -ldl
export GSWOPTS = -c -c++ -python -noexcept
Index: setup.py
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/setup.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** setup.py 22 Mar 2003 15:20:44 -0000 1.9
--- setup.py 26 Mar 2003 05:08:01 -0000 1.10
***************
*** 26,33 ****
--- 26,39 ----
+
+
import sys
min_python_version = "2.2.0"
+ # this is the default path used by make_install under linux to install the
+ # shared and static libraries. it can be changed with --prefix=XYZ
+ default_libpath = "/usr/local/lib"
+
if len(sys.argv) == 2:
command = sys.argv[1]
***************
*** 67,71 ****
copy_file(src_name, dst_name)
! def make_install(win):
lib = sysconfig.get_python_lib()
inc = sysconfig.get_python_inc()
--- 73,77 ----
copy_file(src_name, dst_name)
! def make_install(win, args):
lib = sysconfig.get_python_lib()
inc = sysconfig.get_python_inc()
***************
*** 73,76 ****
--- 79,86 ----
incpath = os.path.join(inc, "SimData")
localinc = os.path.normpath("Include/SimData")
+ libpath = default_libpath
+ for arg in args:
+ if arg.startswith("--prefix="):
+ libpath = arg[9:]
package_files = ['__init__.py', 'Debug.py', 'Parse.py', 'Compile.py']
if win:
***************
*** 88,91 ****
--- 98,109 ----
copy_dir(localinc, incpath, headers)
copy_dir(localinc, incpath, interfaces)
+ if not win:
+ print "Installing SimData libraries to", libpath
+ copy_dir("SimData", libpath, ['_cSimData.so', 'libSimData.a'])
+ print "Byte compiling the Python modules..."
+ import py_compile
+ for file in package_files:
+ if file.endswith(".py"):
+ py_compile.compile(os.path.join(modpath, file))
except Exception, e:
print e
***************
*** 194,197 ****
--- 212,216 ----
"Matrix3",
"Object",
+ "Noise",
"Pack",
"Path",
***************
*** 206,209 ****
--- 225,229 ----
headers = [
"BaseType.h",
+ "Conversions.h",
"DataArchive.h",
"Date.h",
***************
*** 224,227 ****
--- 244,248 ----
"Math.h",
"Matrix3.h",
+ "Noise.h",
"ns-simdata.h",
"Object.h",
***************
*** 244,271 ****
"cSimData.i",
"BaseType.i",
! "HashUtility.i",
! "Object.i",
! "Vector3.i",
"DataArchive.i",
- "InterfaceRegistry.i",
- "Pack.i",
- "cSimData.i",
"Date.i",
- "Interpolate.i",
- "Path.i",
- "filemap.i",
"Enum.i",
- "List.i",
- "Random.i",
- "vector.i",
"Exception.i",
- "Log.i",
- "Spread.i",
"External.i",
! "Math.i",
! "String.i",
"GeoPos.i",
"Matrix3.i",
"Types.i",
]
--- 265,292 ----
"cSimData.i",
"BaseType.i",
! "Conversions.i",
"DataArchive.i",
"Date.i",
"Enum.i",
"Exception.i",
"External.i",
! "filemap.i",
"GeoPos.i",
+ "HashUtility.i",
+ "InterfaceRegistry.i",
+ "Interpolate.i",
+ "List.i",
+ "Log.i",
+ "Math.i",
"Matrix3.i",
+ "Object.i",
+ "Pack.i",
+ "Path.i",
+ "Random.i",
+ "Spread.i",
+ "String.i",
"Types.i",
+ "vector.i",
+ "Vector3.i",
]
***************
*** 288,295 ****
! if len(sys.argv)==2:
command = sys.argv[1]
if command.startswith("make_install"):
! make_install(command.endswith("win"))
if command == "python_include_path":
print sysconfig.get_python_inc()
--- 309,316 ----
! if len(sys.argv)>=2:
command = sys.argv[1]
if command.startswith("make_install"):
! make_install(command.endswith("win"), sys.argv[2:])
if command == "python_include_path":
print sysconfig.get_python_inc()
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv26892
Modified Files:
ScreenInfoManager.cpp ObjectModel.cpp main.cpp GameScreen.cpp
CSPSim.cpp Console.cpp AircraftObject.cpp
Log Message:
added a toggle function for contact marks
added initialization of pause indicator
Index: ScreenInfoManager.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/ScreenInfoManager.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ScreenInfoManager.cpp 22 Mar 2003 02:24:58 -0000 1.3
--- ScreenInfoManager.cpp 24 Mar 2003 10:37:01 -0000 1.4
***************
*** 26,30 ****
#include <osg/MatrixTransform>
- #include "CSPSim.h"
#include "ScreenInfoManager.h"
--- 26,29 ----
***************
*** 34,38 ****
//float textWidth = bitmapFont->getWidth(pause->getEncodedText());
osg::ref_ptr<ScreenInfo> pause = new ScreenInfo(ScreenWidth - 5 * 8, ScreenHeight,"PAUSE", "PAUSE");
- pause->setStatus(CSPSim::theSim->isPaused());
osg::ref_ptr<GeneralStats> generalStats = new GeneralStats(0, ScreenHeight / 3);
--- 33,36 ----
Index: ObjectModel.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/ObjectModel.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ObjectModel.cpp 21 Mar 2003 20:07:55 -0000 1.5
--- ObjectModel.cpp 24 Mar 2003 10:37:02 -0000 1.6
***************
*** 181,185 ****
//stateSet->setGlobalDefaults();
//m_rpNode->setStateSet(stateSet);
!
if (m_Smooth) {
osgUtil::SmoothingVisitor sv;
--- 181,185 ----
//stateSet->setGlobalDefaults();
//m_rpNode->setStateSet(stateSet);
!
if (m_Smooth) {
osgUtil::SmoothingVisitor sv;
Index: main.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/main.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** main.cpp 22 Mar 2003 02:24:58 -0000 1.6
--- main.cpp 24 Mar 2003 10:37:02 -0000 1.7
***************
*** 9,16 ****
CSPSim app;
! app.Init();
! app.Run();
! app.Cleanup();
! app.Exit();
return 0;
--- 9,16 ----
CSPSim app;
! app.init();
! app.run();
! app.cleanup();
! app.quit();
return 0;
Index: GameScreen.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/GameScreen.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** GameScreen.cpp 21 Mar 2003 20:07:55 -0000 1.9
--- GameScreen.cpp 24 Mar 2003 10:37:03 -0000 1.10
***************
*** 188,191 ****
--- 188,192 ----
m_ScreenInfoManager = new ScreenInfoManager(ScreenWidth,ScreenHeight);
m_ScreenInfoManager->setName("ScreenInfoManager");
+ m_ScreenInfoManager->setStatus("PAUSE", CSPSim::theSim->isPaused());
m_Console = new PyConsole(ScreenWidth, ScreenHeight);
Index: CSPSim.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/CSPSim.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** CSPSim.cpp 22 Mar 2003 12:42:59 -0000 1.14
--- CSPSim.cpp 24 Mar 2003 10:37:04 -0000 1.15
***************
*** 171,175 ****
}
! VirtualBattlefield * const CSPSim::getBattlefield() const
{
return m_Battlefield;
--- 171,175 ----
}
! VirtualBattlefield* const CSPSim::getBattlefield() const
{
return m_Battlefield;
***************
*** 227,231 ****
m_ActiveTerrain = m_DataArchive->getObject("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.
--- 227,231 ----
m_ActiveTerrain = m_DataArchive->getObject("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.
***************
*** 392,399 ****
// Swap OpenGL buffers
Py_BEGIN_ALLOW_THREADS;
SDL_GL_SwapBuffers();
Py_END_ALLOW_THREADS;
!
// remove marked objects, this should be done at the end of the main loop.
m_Battlefield->removeObjectsMarkedForDelete();
--- 392,402 ----
// Swap OpenGL buffers
+ #ifndef __CSPSIM_EXE__
Py_BEGIN_ALLOW_THREADS;
SDL_GL_SwapBuffers();
Py_END_ALLOW_THREADS;
! #else
! SDL_GL_SwapBuffers();
! #endif
// remove marked objects, this should be done at the end of the main loop.
m_Battlefield->removeObjectsMarkedForDelete();
Index: Console.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Console.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Console.cpp 22 Mar 2003 02:24:58 -0000 1.2
--- Console.cpp 24 Mar 2003 10:37:04 -0000 1.3
***************
*** 57,60 ****
--- 57,61 ----
text_->setColor(osg::Vec4(1, 1, 1, 1));
text_->setAlignment(osgText::Text::LEFT_TOP);
+ token_->setAlignment(osgText::Text::LEFT_TOP);
}
***************
*** 215,219 ****
//cursor_x_ = text_->getFont()->getWidth(&text);
token_->setText(left);
! cursor_x_ -= text_->getFont()->getWidth(token_->getEncodedText());
dirtyDisplayList();
}
--- 216,220 ----
//cursor_x_ = text_->getFont()->getWidth(&text);
token_->setText(left);
! cursor_x_ = text_->getFont()->getWidth(token_->getEncodedText());
dirtyDisplayList();
}
Index: AircraftObject.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/AircraftObject.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** AircraftObject.cpp 21 Mar 2003 22:16:12 -0000 1.8
--- AircraftObject.cpp 24 Mar 2003 10:37:04 -0000 1.9
***************
*** 100,103 ****
--- 100,105 ----
BIND_ACTION("WHEEL_BRAKE_OFF", WheelBrakeOff);
BIND_AXIS("WHEEL_BRAKE", setWheelBrake);
+ BIND_ACTION("GEAR_UP", GearUp);
+ BIND_ACTION("GEAR_DOWN", GearDown);
CSP_LOG(CSP_APP, CSP_DEBUG, "... AircraftObject::AircraftObject()");
***************
*** 332,336 ****
--- 334,354 ----
m_BrakeInput = x;
}
+
+ void AircraftObject::setGearStatus(bool on) {
+ if (on)
+ m_Gear->Extend();
+ else
+ m_Gear->Retract();
+ m_Model->showContactMarkers(on);
+ }
+ void AircraftObject::GearUp() {
+ setGearStatus(false);
+ }
+
+ void AircraftObject::GearDown() {
+ setGearStatus(true);
+ }
+
void AircraftObject::setOrientation(double heading, double pitch, double roll)
{
|
|
From: <de...@us...> - 2003-03-24 10:26:49
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include
In directory sc8-pr-cvs1:/tmp/cvs-serv24224
Modified Files:
LandingGear.h CSPSim.h AircraftObject.h
Log Message:
added a toggle function for contact marks
Index: LandingGear.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/LandingGear.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** LandingGear.h 22 Mar 2003 02:25:18 -0000 1.2
--- LandingGear.h 24 Mar 2003 10:26:44 -0000 1.3
***************
*** 155,160 ****
// doSimplePhysics(float dt) {}
! void Retract() {}
! void Extend() {}
bool getWOW() const { return m_WOW; }
--- 155,173 ----
// doSimplePhysics(float dt) {}
! //FIXME: just for some testing purpose
! void setStatus(bool on) {
! size_t n = m_Gear.size();
! for (unsigned short i = 0; i < n; ++i)
! m_Gear[i]->setExtended(on);
! }
!
! void Retract() {
! setStatus(false);
! }
!
! void Extend() {
! setStatus(true);
! }
!
bool getWOW() const { return m_WOW; }
Index: CSPSim.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/CSPSim.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** CSPSim.h 21 Mar 2003 20:08:31 -0000 1.8
--- CSPSim.h 24 Mar 2003 10:26:45 -0000 1.9
***************
*** 83,87 ****
void setActiveObject(simdata::Pointer<DynamicObject> object);
simdata::Pointer<DynamicObject const> const getActiveObject() const;
! VirtualBattlefield * const getBattlefield() const;
void setShell(PyObject *shell) { m_Shell.bind(shell); }
--- 83,87 ----
void setActiveObject(simdata::Pointer<DynamicObject> object);
simdata::Pointer<DynamicObject const> const getActiveObject() const;
! VirtualBattlefield* const getBattlefield() const;
void setShell(PyObject *shell) { m_Shell.bind(shell); }
Index: AircraftObject.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/AircraftObject.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** AircraftObject.h 21 Mar 2003 22:16:23 -0000 1.5
--- AircraftObject.h 24 Mar 2003 10:26:45 -0000 1.6
***************
*** 73,76 ****
--- 73,78 ----
ACTION_INTERFACE(AircraftObject, WheelBrakeOn);
ACTION_INTERFACE(AircraftObject, WheelBrakeOff);
+ ACTION_INTERFACE(AircraftObject, GearUp);
+ ACTION_INTERFACE(AircraftObject, GearDown);
AircraftObject();
***************
*** 110,113 ****
--- 112,117 ----
virtual void unpack(simdata::UnPacker& p);
virtual void postCreate();
+
+ virtual void setGearStatus(bool on);
simdata::Pointer<AeroDynamics> m_FlightModel;
|
|
From: <de...@us...> - 2003-03-24 10:21:57
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Tools/HID In directory sc8-pr-cvs1:/tmp/cvs-serv22425 Modified Files: aircraft.map Log Message: added a toggle key for contact marks Index: aircraft.map =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Tools/HID/aircraft.map,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** aircraft.map 19 Feb 2003 11:41:58 -0000 1.3 --- aircraft.map 24 Mar 2003 10:21:50 -0000 1.4 *************** *** 1,8 **** include mouse.map include keys.map ! include x36.map device keyboard 0 key US_keyboard ! device joystick 0 x36 Saitek_X36 device mouse 0 mouse standard_mouse --- 1,8 ---- include mouse.map include keys.map ! include F16CS.map device keyboard 0 key US_keyboard ! device joystick 0 F16CS CH_F16CS device mouse 0 mouse standard_mouse *************** *** 12,19 **** mode base ! map x36:Stick_X axis AILERON ! map x36:Stick_Y axis ELEVATOR ! map x36:Rudder axis RUDDER ! map x36:Throttle axis THROTTLE map key:DOWN press INC_ELEVATOR --- 12,19 ---- mode base ! map F16CS:Stick_X axis AILERON ! map F16CS:Stick_Y axis ELEVATOR ! map F16CS:Rudder axis RUDDER ! map F16CS:Throttle axis THROTTLE map key:DOWN press INC_ELEVATOR *************** *** 30,33 **** map key:MINUS release STOP_DEC_THROTTLE map key:s press SMOKE_ON/B|SMOKE_OFF/B ! #map key:SHIFT-s press SMOKE_OFF --- 30,33 ---- map key:MINUS release STOP_DEC_THROTTLE map key:s press SMOKE_ON/B|SMOKE_OFF/B ! map key:g press GEAR_UP/B|GEAR_DOWN/B |
|
From: <mk...@us...> - 2003-03-23 19:06:42
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv30279 Modified Files: Atmosphere.h Log Message: Index: Atmosphere.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/Atmosphere.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Atmosphere.h 22 Mar 2003 12:38:56 -0000 1.2 --- Atmosphere.h 23 Mar 2003 19:06:36 -0000 1.3 *************** *** 40,44 **** double getDensity(double alt) const; simdata::Vector3 getWind(simdata::Vector3 const &) const; ! double getTurbulence(simdata::Vector3 const &, double dist) const; void setPosition(double lat, double lon); void setPrevailingWind(simdata::Vector3 const &); --- 40,44 ---- double getDensity(double alt) const; simdata::Vector3 getWind(simdata::Vector3 const &) const; ! simdata::Vector3 getTurbulence(simdata::Vector3 const &, double dist) const; void setPosition(double lat, double lon); void setPrevailingWind(simdata::Vector3 const &); *************** *** 74,78 **** std::vector<float> m_WindAltY; std::vector<float> m_GustTime; ! std::vector<float> m_DensityTime; std::vector<float> m_TurbulenceAltA; std::vector<float> m_TurbulenceAltB; --- 74,80 ---- std::vector<float> m_WindAltY; std::vector<float> m_GustTime; ! std::vector<float> m_TurbulenceX; ! std::vector<float> m_TurbulenceY; ! std::vector<float> m_TurbulenceZ; std::vector<float> m_TurbulenceAltA; std::vector<float> m_TurbulenceAltB; |
|
From: <mk...@us...> - 2003-03-23 19:06:24
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1:/tmp/cvs-serv30165 Modified Files: CHANGES.current Log Message: Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CHANGES.current 22 Mar 2003 08:39:19 -0000 1.6 --- CHANGES.current 23 Mar 2003 19:06:21 -0000 1.7 *************** *** 1,4 **** --- 1,18 ---- Version 0.3.1 (in progress) =========================== + 2003-03-23: onsight + Changed turbulence from air density fluctuations to 3D wind + gusts. The fluctuations are still indexed by distance travelled. + Also, scaled the altitude variation of turbulence to peak in + the 3000-10000 m range. Also, the perlin noise function is now + shaped as X*ABS(X). + + Right justified the fps display in a 5 digit field so that 100.0 + doesn't make the display jitter. + + 2003-03-22: onsight + Added mute option to CSPSim.ini. + + Enabled winds, gusts, and turbulence. 2003-03-21: onsight |
|
From: <mk...@us...> - 2003-03-23 19:05:17
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv29607
Modified Files:
AeroDynamics.cpp Atmosphere.cpp CSPSim.py ScreenInfo.cpp
Log Message:
Index: AeroDynamics.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/AeroDynamics.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** AeroDynamics.cpp 22 Mar 2003 12:38:27 -0000 1.9
--- AeroDynamics.cpp 23 Mar 2003 19:05:02 -0000 1.10
***************
*** 374,381 ****
if (atmosphere != NULL) {
double density = atmosphere->getDensity(m_PositionLocal.z);
- density += atmosphere->getTurbulence(m_PositionLocal, m_Distance);
qBarFactor *= density;
m_Gravity = atmosphere->getGravity(m_PositionLocal.z);
Wind = atmosphere->getWind(m_PositionLocal);
} else {
qBarFactor *= 1.25;
--- 374,381 ----
if (atmosphere != NULL) {
double density = atmosphere->getDensity(m_PositionLocal.z);
qBarFactor *= density;
m_Gravity = atmosphere->getGravity(m_PositionLocal.z);
Wind = atmosphere->getWind(m_PositionLocal);
+ Wind += atmosphere->getTurbulence(m_PositionLocal, m_Distance);
} else {
qBarFactor *= 1.25;
Index: Atmosphere.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Atmosphere.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Atmosphere.cpp 22 Mar 2003 12:38:27 -0000 1.2
--- Atmosphere.cpp 23 Mar 2003 19:05:04 -0000 1.3
***************
*** 142,145 ****
--- 142,146 ----
void Atmosphere::generateWinds() {
Perlin1D noise;
+ int i;
// pressure variation (10 days)
***************
*** 151,161 ****
noise.set(0.9, 6);
noise.randomize();
! m_DensityTime = noise.generate(1000, true, 10.0, 0.02, 0.0);
// turbulence altitude buffers (15000 m)
noise.set(0.9, 6);
noise.randomize();
! m_TurbulenceAltA = noise.generate(1000, false, 10.0, 2.0, -1.0);
! m_TurbulenceAltB = noise.generate(1000, false, 10.0, 2.0, -1.0);
// wind direction variation (30000 m)
--- 152,182 ----
noise.set(0.9, 6);
noise.randomize();
! m_TurbulenceX = noise.generate(1000, true, 10.0, 1.0, 0.0);
! noise.randomize();
! m_TurbulenceY = noise.generate(1000, true, 10.0, 1.0, 0.0);
! noise.randomize();
! m_TurbulenceZ = noise.generate(1000, true, 10.0, 1.0, 0.0);
! for (i = 0; i < 1000; i++) {
! float a;
! a= m_TurbulenceX[i];
! m_TurbulenceX[i] *= 10.0 * a * fabs(a);
! a = m_TurbulenceY[i];
! m_TurbulenceY[i] *= 10.0 * a * fabs(a);
! a = m_TurbulenceZ[i];
! m_TurbulenceZ[i] *= 10.0 * a * fabs(a);
! }
// turbulence altitude buffers (15000 m)
noise.set(0.9, 6);
noise.randomize();
! m_TurbulenceAltA = noise.generate(1000, false, 10.0, 3.0, -1.5);
! noise.randomize();
! m_TurbulenceAltB = noise.generate(1000, false, 10.0, 3.0, -1.5);
! for (i = 0; i < 1000; i++) {
! float f = i * 0.015; // f in km
! f = (12.5 * f + 7.6) / (f*f + 45.0);
! m_TurbulenceAltA[i] *= f;
! m_TurbulenceAltB[i] *= f;
! }
// wind direction variation (30000 m)
***************
*** 192,205 ****
f = h - idx;
}
wind.x += m_WindAltX[idx]*(1.0-f) + m_WindAltX[idx+1]*f;
wind.y += m_WindAltY[idx]*(1.0-f) + m_WindAltY[idx+1]*f;
! return wind * m_WindScale * m_GustModulation;
}
! double Atmosphere::getTurbulence(simdata::Vector3 const &p, double dist) const {
! if (dist < 0.0) dist = - dist;
! int idx = int(dist * 0.1) % 1000;
! float d = m_DensityTime[idx];
! idx = int(p.z * 1000.0 / 15000.0);
if (idx < 0) idx = 0;
else if (idx > 999) idx = 999;
--- 213,225 ----
f = h - idx;
}
+ double alt_scale = 1.0 + h*h*0.0025;
+ if (alt_scale > 2.0) alt_scale = 2.0;
wind.x += m_WindAltX[idx]*(1.0-f) + m_WindAltX[idx+1]*f;
wind.y += m_WindAltY[idx]*(1.0-f) + m_WindAltY[idx+1]*f;
! return wind * m_WindScale * m_GustModulation * alt_scale;
}
! simdata::Vector3 Atmosphere::getTurbulence(simdata::Vector3 const &p, double dist) const {
! int idx = int(p.z * 1000.0 / 15000.0);
if (idx < 0) idx = 0;
else if (idx > 999) idx = 999;
***************
*** 209,221 ****
if (b < 0.0) b = 0.0;
a = a * (1.0 - m_TurbulenceBlend) + b * m_TurbulenceBlend;
/*
static int i = 0;
if ((i++ % 40) == 0) {
! std::cout << a << ":" << d << "\n";
}
*/
! // first try didn't show much effect. * 30 does something, but hard to notice.
! // * 100 is too much. need to tune...
! return a * d * 30.0;
}
--- 229,245 ----
if (b < 0.0) b = 0.0;
a = a * (1.0 - m_TurbulenceBlend) + b * m_TurbulenceBlend;
+
/*
static int i = 0;
if ((i++ % 40) == 0) {
! std::cout << a << "\n";
}
*/
!
! if (a <= 0.0) return simdata::Vector3::ZERO;
!
! if (dist < 0.0) dist = - dist;
! idx = int(dist * 0.1) % 1000;
! return simdata::Vector3(a*m_TurbulenceX[idx],a*m_TurbulenceY[idx],a*m_TurbulenceZ[idx]);
}
***************
*** 330,333 ****
--- 354,362 ----
m_TurbulenceBlendUp = false;
m_TurbulenceAltA = noise.generate(1000, false, 10.0, 2.0, -1.0);
+ for (int i = 0; i < 1000; i++) {
+ float f = i * 0.015; // f in km
+ f = (12.5 * f + 7.6) / (f*f + 45.0);
+ m_TurbulenceAltA[i] *= f;
+ }
}
} else {
***************
*** 340,343 ****
--- 369,377 ----
m_TurbulenceBlendUp = true;
m_TurbulenceAltB = noise.generate(1000, false, 10.0, 2.0, -1.0);
+ for (int i = 0; i < 1000; i++) {
+ float f = i * 0.015; // f in km
+ f = (12.5 * f + 7.6) / (f*f + 45.0);
+ m_TurbulenceAltB[i] *= f;
+ }
}
}
Index: CSPSim.py
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/CSPSim.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CSPSim.py 22 Mar 2003 08:32:32 -0000 1.1
--- CSPSim.py 23 Mar 2003 19:05:04 -0000 1.2
***************
*** 3,6 ****
--- 3,9 ----
import sys, os.path
+ #import Shell
+ #from SimData.Compile import Compiler, CompilerUsageError
+
# enable lazy loading of shared library modules if available
if hasattr(sys, "setdlopenflags"):
***************
*** 71,74 ****
--- 74,80 ----
action = None
config = "../Data/CSPSim.ini"
+ if os.path.exists("CSPSim.ini") or not os.path.exists(config):
+ config = "CSPSim.ini"
+
Index: ScreenInfo.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/ScreenInfo.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ScreenInfo.cpp 22 Mar 2003 12:47:20 -0000 1.6
--- ScreenInfo.cpp 23 Mar 2003 19:05:04 -0000 1.7
***************
*** 76,81 ****
m_maxFps = max(m_maxFps,fps);
std::ostringstream osstr;
! osstr << setprecision(1) << fixed << fps << " FPS min: " << m_minFps << " max: " << m_maxFps;
! m_Text->setText(osstr.str());
simdata::SimDate artificial_time = CSPSim::theSim->getCurrentTime();
--- 76,81 ----
m_maxFps = max(m_maxFps,fps);
std::ostringstream osstr;
! osstr << setprecision(1) << setw(5) << fixed << fps << " FPS min: " << m_minFps << " max: " << m_maxFps;
! m_Text->setText(osstr.str());
simdata::SimDate artificial_time = CSPSim::theSim->getCurrentTime();
***************
*** 110,138 ****
std::ostringstream osstr;
osstr << "Terrain Polygons: " << CSPSim::theSim->getBattlefield()->getTerrainPolygonsRendered();
! m_Text->setText(osstr.str());
simdata::Pointer<DynamicObject const> const activeObject = CSPSim::theSim->getActiveObject();
if (!activeObject.isNull()) {
-
simdata::Vector3 pos = activeObject->getLocalPosition();
osstr.str("");
! osstr << "LocalPosition: (" << setprecision(precision) << fixed
! << setw(6 + precision) << setfill('0') << pos.x << ", ";
osstr << setw(6 + precision) << setfill('0') << pos.y << ", ";
osstr << setw(6 + precision) << setfill('0') << pos.z << ")";
! m_LocalPosition->setText(osstr.str());
pos = activeObject->getGlobalPosition();
osstr.str("");
! osstr << "GlobalPosition: (" << setprecision(precision) << fixed
! << setw(7 + precision) << setfill('0') << pos.x << ", ";
osstr << setw(7 + precision) << setfill('0') << pos.y << ", ";
osstr << setw(7 + precision) << setfill('0') << pos.z << ")";
! m_GlobalPosition->setText(osstr.str());
simdata::Vector3 vel = activeObject->getVelocity();
! osstr.str("");
! osstr << "Velocity: (" << setprecision(2) << fixed << vel.x << ", " << vel.y << ", " << vel.z << ")";
! m_Velocity->setText(osstr.str());
}
}
--- 110,137 ----
std::ostringstream osstr;
osstr << "Terrain Polygons: " << CSPSim::theSim->getBattlefield()->getTerrainPolygonsRendered();
! m_Text->setText(osstr.str());
simdata::Pointer<DynamicObject const> const activeObject = CSPSim::theSim->getActiveObject();
if (!activeObject.isNull()) {
simdata::Vector3 pos = activeObject->getLocalPosition();
osstr.str("");
! osstr << "LocalPosition: (" << setprecision(precision) << fixed
! << setw(6 + precision) << setfill('0') << pos.x << ", ";
osstr << setw(6 + precision) << setfill('0') << pos.y << ", ";
osstr << setw(6 + precision) << setfill('0') << pos.z << ")";
! m_LocalPosition->setText(osstr.str());
pos = activeObject->getGlobalPosition();
osstr.str("");
! osstr << "GlobalPosition: (" << setprecision(precision) << fixed
! << setw(7 + precision) << setfill('0') << pos.x << ", ";
osstr << setw(7 + precision) << setfill('0') << pos.y << ", ";
osstr << setw(7 + precision) << setfill('0') << pos.z << ")";
! m_GlobalPosition->setText(osstr.str());
simdata::Vector3 vel = activeObject->getVelocity();
! osstr.str("");
! osstr << "Velocity: (" << setprecision(2) << fixed << vel.x << ", " << vel.y << ", " << vel.z << ")";
! m_Velocity->setText(osstr.str());
}
}
|
|
From: <mk...@us...> - 2003-03-22 18:46:28
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include
In directory sc8-pr-cvs1:/tmp/cvs-serv11177
Modified Files:
Shell.h
Log Message:
Index: Shell.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/Shell.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Shell.h 21 Mar 2003 20:08:35 -0000 1.1
--- Shell.h 22 Mar 2003 18:46:24 -0000 1.2
***************
*** 62,71 ****
std::string run(std::string const &command) {
PyObject *result;
! result = PyObject_CallMethod(m_Shell, "run", "s", command.c_str());
! if (result != NULL) {
! return PyString_AsString(result);
}
- // should never reach this point since the python method traps
- // exceptions and returns the error and traceback as a string
return "";
}
--- 62,73 ----
std::string run(std::string const &command) {
PyObject *result;
! if (m_Shell) {
! result = PyObject_CallMethod(m_Shell, "run", "s", command.c_str());
! if (result != NULL) {
! return PyString_AsString(result);
! }
! // should never reach this point since the python method traps
! // exceptions and returns the error and traceback as a string
}
return "";
}
|
|
From: <mk...@us...> - 2003-03-22 18:02:01
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data/Input In directory sc8-pr-cvs1:/tmp/cvs-serv28842/Data/Input Modified Files: GameScreen.hid Log Message: Index: GameScreen.hid =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Data/Input/GameScreen.hid,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GameScreen.hid 21 Feb 2003 08:00:28 -0000 1.2 --- GameScreen.hid 22 Mar 2003 18:01:57 -0000 1.3 *************** *** 42,45 **** --- 42,47 ---- @00.00 -01 -0001 +00 -01 STATS +K 0 P 0000 0000 0000 0293 00 + @00.00 -01 -0001 +00 -01 CONSOLE + +K 0 P 0000 0000 0000 0278 00 @00.00 -01 -0001 +00 -01 CHANGE_VEHICLE +K 0 P 0000 0000 0000 0032 00 |