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-21 19:36:09
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv13282
Modified Files:
Colorspace.cpp
Log Message:
no message
Index: Colorspace.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Colorspace.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Colorspace.cpp 12 Mar 2003 21:39:29 -0000 1.6
--- Colorspace.cpp 21 Apr 2003 19:36:03 -0000 1.7
***************
*** 20,25 ****
#include "Colorspace.h"
!
! #define PI 3.14159265358979323846264338327950288419716939937510
float Xn, Yn, Zn;
--- 20,24 ----
#include "Colorspace.h"
! float const PI = 3.14159265358979323846264338327950288419716939937510f;
float Xn, Yn, Zn;
***************
*** 109,115 ****
*/
static float cubert(float x) {
! if (x > 0.0) return pow(x, (1.0/3.0));
if (x == 0.0) return 0.0;
! return -pow(fabs(x), (1.0/3.0));
}
--- 108,114 ----
*/
static float cubert(float x) {
! if (x > 0.0) return powf(x, (1.0f/3.0f));
if (x == 0.0) return 0.0;
! return -powf(fabsf(x), (1.0f/3.0f));
}
***************
*** 200,204 ****
H = rmodp(H, 360.0);
if (H < 60.0) {
! return n1 + (n2 - n1) * H / 60.0;
}
if (H < 180.0) {
--- 199,203 ----
H = rmodp(H, 360.0);
if (H < 60.0) {
! return n1 + (n2 - n1) * H / 60.0f;
}
if (H < 180.0) {
***************
*** 206,210 ****
}
if (H < 240.0) {
! return n1 + (n2 - n1) * (240.0 - H) / 60.0;
}
return n1;
--- 205,209 ----
}
if (H < 240.0) {
! return n1 + (n2 - n1) * (240.0f - H) / 60.0f;
}
return n1;
***************
*** 236,242 ****
R = G = B = L;
} else {
! R = hls_value(m1, m2, H + 120.0);
G = hls_value(m1, m2, H);
! B = hls_value(m1, m2, H - 120.0);
}
}
--- 235,241 ----
R = G = B = L;
} else {
! R = hls_value(m1, m2, H + 120.0f);
G = hls_value(m1, m2, H);
! B = hls_value(m1, m2, H - 120.0f);
}
}
***************
*** 261,265 ****
float d = (rgbmax - rgbmin);
float rc, gc, bc;
! L = (rgbmax + rgbmin) * 0.5;
if (d == 0.0) {
S = 0.0;
--- 260,264 ----
float d = (rgbmax - rgbmin);
float rc, gc, bc;
! L = (rgbmax + rgbmin) * 0.5f;
if (d == 0.0) {
S = 0.0;
***************
*** 269,275 ****
S = d / (rgbmax + rgbmin);
} else {
! S = d / (2.0 - rgbmax - rgbmin);
}
! float s = 1.0 / d;
rc = (rgbmax - R) * s;
gc = (rgbmax - G) * s;
--- 268,274 ----
S = d / (rgbmax + rgbmin);
} else {
! S = d / (2.0f - rgbmax - rgbmin);
}
! float s = 1.0f / d;
rc = (rgbmax - R) * s;
gc = (rgbmax - G) * s;
***************
*** 279,287 ****
} else
if (G == rgbmax) {
! H = 2.0 + rc - bc;
} else {
! H = 4.0 + gc - rc;
}
! H = H * 60.0;
}
}
--- 278,286 ----
} else
if (G == rgbmax) {
! H = 2.0f + rc - bc;
} else {
! H = 4.0f + gc - rc;
}
! H = H * 60.0f;
}
}
***************
*** 317,326 ****
R = G = B = V;
} else {
! float hue = rmodp(H, 360.0) / 60.0;
int i = (int) hue;
float f = hue - (float) i;
! float p = V * (1.0 - S);
! float q = V * (1.0 - S * f);
! float t = V * (1.0 - S + S * f);
switch (i) {
case 0:
--- 316,325 ----
R = G = B = V;
} else {
! float hue = rmodp(H, 360.0) / 60.0f;
int i = (int) hue;
float f = hue - (float) i;
! float p = V * (1.0f - S);
! float q = V * (1.0f - S * f);
! float t = V * (1.0f - S + S * f);
switch (i) {
case 0:
***************
*** 391,395 ****
} else {
float rc, gc, bc;
! float s = 1.0 / d;
rc = (rgbmax - R) * s;
gc = (rgbmax - G) * s;
--- 390,394 ----
} else {
float rc, gc, bc;
! float s = 1.0f / d;
rc = (rgbmax - R) * s;
gc = (rgbmax - G) * s;
***************
*** 399,407 ****
} else
if (G == rgbmax) {
! H = 2.0 + rc - bc;
} else {
! H = 4.0 + gc - rc;
}
! H = rmodp(H * 60.0, 360.0);
}
}
--- 398,406 ----
} else
if (G == rgbmax) {
! H = 2.0f + rc - bc;
} else {
! H = 4.0f + gc - rc;
}
! H = rmodp(H * 60.0f, 360.0);
}
}
***************
*** 431,439 ****
} else
if (G == rgbmax) {
! H = 2.0 + R - B;
} else {
! H = 4.0 + G - R;
}
! H = H / 6.0;
LIMIT_ZERO_TO_ONE(H);
return H;
--- 430,438 ----
} else
if (G == rgbmax) {
! H = 2.0f + R - B;
} else {
! H = 4.0f + G - R;
}
! H = H / 6.0f;
LIMIT_ZERO_TO_ONE(H);
return H;
***************
*** 464,474 ****
*/
float T_to_spd(float T, float lambda) {
! static float c = 2.9979246E+08;
! static float h = 6.626176E-34;
! static float k = 1.38066E-23;
! static float nmtom = 1.0E-09;
float expon = h * c / ( nmtom * lambda * k * T );
! float denom = pow(nmtom,4.0) * pow(lambda, 5.0) * (exp(expon) - 1.0);
! float power = 8.0 * PI * h * c / denom;
return power;
}
--- 463,473 ----
*/
float T_to_spd(float T, float lambda) {
! static float c = 2.9979246E+08f;
! static float h = 6.626176E-34f;
! static float k = 1.38066E-23f;
! static float nmtom = 1.0E-09f;
float expon = h * c / ( nmtom * lambda * k * T );
! float denom = powf(nmtom,4.0f) * powf(lambda, 5.0f) * (expf(expon) - 1.0f);
! float power = 8.0f * PI * h * c / denom;
return power;
}
***************
*** 511,551 ****
static const int n = 53;
static const float Tdat[] = {
! 1000.0, 1200.0, 1400.0, 1500.0, 1600.0,
! 1700.0, 1800.0, 1900.0, 2000.0, 2100.0,
! 2200.0, 2300.0, 2400.0, 2500.0, 2600.0,
! 2700.0, 2800.0, 2900.0, 3000.0, 3100.0,
! 3200.0, 3300.0, 3400.0, 3500.0, 3600.0,
! 3700.0, 3800.0, 3900.0, 4000.0, 4100.0,
! 4200.0, 4300.0, 4400.0, 4500.0, 4600.0,
! 4700.0, 4800.0, 4900.0, 5000.0, 5200.0,
! 5400.0, 5600.0, 5800.0, 6000.0, 6500.0,
! 7000.0, 7500.0, 8000.0, 8500.0, 9000.0,
! 10000.0, 15000.0, 30000.0
};
static const float xdat[] = {
! 0.6526, 0.6249, 0.5984, 0.5856, 0.5731,
! 0.5610, 0.5491, 0.5377, 0.5266, 0.5158,
! 0.5055, 0.4956, 0.4860, 0.4769, 0.4681,
! 0.4597, 0.4517, 0.4441, 0.4368, 0.4299,
! 0.4233, 0.4170, 0.4109, 0.4052, 0.3997,
! 0.3945, 0.3896, 0.3848, 0.3804, 0.3760,
! 0.3719, 0.3680, 0.3643, 0.3607, 0.3573,
! 0.3540, 0.3509, 0.3479, 0.3450, 0.3397,
! 0.3347, 0.3301, 0.3259, 0.3220, 0.3135,
! 0.3063, 0.3003, 0.2952, 0.2908, 0.2869,
! 0.2806, 0.2637, 0.2501
};
static const float ydat[] = {
! 0.3446, 0.3676, 0.3859, 0.3932, 0.3993,
! 0.4043, 0.4083, 0.4112, 0.4133, 0.4146,
! 0.4152, 0.4152, 0.4147, 0.4137, 0.4123,
! 0.4106, 0.4086, 0.4064, 0.4041, 0.4015,
! 0.3989, 0.3962, 0.3935, 0.3907, 0.3879,
! 0.3851, 0.3822, 0.3795, 0.3767, 0.3740,
! 0.3713, 0.3687, 0.3660, 0.3635, 0.3610,
! 0.3586, 0.3562, 0.3539, 0.3516, 0.3472,
! 0.3430, 0.3391, 0.3353, 0.3318, 0.3236,
! 0.3165, 0.3103, 0.3048, 0.2999, 0.2956,
! 0.2883, 0.2673, 0.2489
};
if (T < Tdat[0]) {
--- 510,550 ----
static const int n = 53;
static const float Tdat[] = {
! 1000.0f, 1200.0f, 1400.0f, 1500.0f, 1600.0f,
! 1700.0f, 1800.0f, 1900.0f, 2000.0f, 2100.0f,
! 2200.0f, 2300.0f, 2400.0f, 2500.0f, 2600.0f,
! 2700.0f, 2800.0f, 2900.0f, 3000.0f, 3100.0f,
! 3200.0f, 3300.0f, 3400.0f, 3500.0f, 3600.0f,
! 3700.0f, 3800.0f, 3900.0f, 4000.0f, 4100.0f,
! 4200.0f, 4300.0f, 4400.0f, 4500.0f, 4600.0f,
! 4700.0f, 4800.0f, 4900.0f, 5000.0f, 5200.0f,
! 5400.0f, 5600.0f, 5800.0f, 6000.0f, 6500.0f,
! 7000.0f, 7500.0f, 8000.0f, 8500.0f, 9000.0f,
! 10000.0f, 15000.0f, 30000.0f
};
static const float xdat[] = {
! 0.6526f, 0.6249f, 0.5984f, 0.5856f, 0.5731f,
! 0.5610f, 0.5491f, 0.5377f, 0.5266f, 0.5158f,
! 0.5055f, 0.4956f, 0.4860f, 0.4769f, 0.4681f,
! 0.4597f, 0.4517f, 0.4441f, 0.4368f, 0.4299f,
! 0.4233f, 0.4170f, 0.4109f, 0.4052f, 0.3997f,
! 0.3945f, 0.3896f, 0.3848f, 0.3804f, 0.3760f,
! 0.3719f, 0.3680f, 0.3643f, 0.3607f, 0.3573f,
! 0.3540f, 0.3509f, 0.3479f, 0.3450f, 0.3397f,
! 0.3347f, 0.3301f, 0.3259f, 0.3220f, 0.3135f,
! 0.3063f, 0.3003f, 0.2952f, 0.2908f, 0.2869f,
! 0.2806f, 0.2637f, 0.2501f
};
static const float ydat[] = {
! 0.3446f, 0.3676f, 0.3859f, 0.3932f, 0.3993f,
! 0.4043f, 0.4083f, 0.4112f, 0.4133f, 0.4146f,
! 0.4152f, 0.4152f, 0.4147f, 0.4137f, 0.4123f,
! 0.4106f, 0.4086f, 0.4064f, 0.4041f, 0.4015f,
! 0.3989f, 0.3962f, 0.3935f, 0.3907f, 0.3879f,
! 0.3851f, 0.3822f, 0.3795f, 0.3767f, 0.3740f,
! 0.3713f, 0.3687f, 0.3660f, 0.3635f, 0.3610f,
! 0.3586f, 0.3562f, 0.3539f, 0.3516f, 0.3472f,
! 0.3430f, 0.3391f, 0.3353f, 0.3318f, 0.3236f,
! 0.3165f, 0.3103f, 0.3048f, 0.2999f, 0.2956f,
! 0.2883f, 0.2673f, 0.2489f
};
if (T < Tdat[0]) {
***************
*** 560,564 ****
y = interp(n, T, Tdat, ydat);
}
! z = 1.0 - x - y;
}
--- 559,563 ----
y = interp(n, T, Tdat, ydat);
}
! z = 1.0f - x - y;
}
***************
*** 571,577 ****
*/
void XYZ_to_RGB709(float X, float Y, float Z, float &R, float &G, float &B) {
! R = 3.240479*X-1.537150*Y-0.498535*Z;
! G = -0.969256*X+1.875992*Y+0.041556*Z;
! B = 0.055648*X-0.204043*Y+1.057311*Z;
}
--- 570,576 ----
*/
void XYZ_to_RGB709(float X, float Y, float Z, float &R, float &G, float &B) {
! R = 3.240479f*X-1.537150f*Y-0.498535f*Z;
! G = -0.969256f*X+1.875992f*Y+0.041556f*Z;
! B = 0.055648f*X-0.204043f*Y+1.057311f*Z;
}
***************
*** 584,590 ****
*/
void RGB709_to_XYZ(float R, float G, float B, float &X, float &Y, float &Z) {
! X = 0.412453*R+0.357580*G+0.180423*B;
! Y = 0.212671*R+0.715160*G+0.072169*B;
! Z = 0.019334*R+0.119193*G+0.950227*B;
}
--- 583,589 ----
*/
void RGB709_to_XYZ(float R, float G, float B, float &X, float &Y, float &Z) {
! X = 0.412453f*R+0.357580f*G+0.180423f*B;
! Y = 0.212671f*R+0.715160f*G+0.072169f*B;
! Z = 0.019334f*R+0.119193f*G+0.950227f*B;
}
***************
*** 593,597 ****
*/
float getY709(float R, float G, float B) {
! return 0.212671*R + 0.71516*G + 0.072169*B;
}
--- 592,596 ----
*/
float getY709(float R, float G, float B) {
! return 0.212671f*R + 0.71516f*G + 0.072169f*B;
}
***************
*** 615,619 ****
X = x * Y / y;
if (X < 0.0) X = 0.0;
! float z = 1.0 - x - y;
Z = z * Y / y;
if (Z < 0.0) Z = 0.0;
--- 614,618 ----
X = x * Y / y;
if (X < 0.0) X = 0.0;
! float z = 1.0f - x - y;
Z = z * Y / y;
if (Z < 0.0) Z = 0.0;
***************
*** 686,693 ****
} else
if (Y <= 0.008856 * Yn) {
! Lstar = 903.3 * Y / Yn;
} else
if (Y <= Yn) {
! Lstar = 116.0 * cubert(Y/Yn) - 16.0;
} else {
Lstar = 100.0;
--- 685,692 ----
} else
if (Y <= 0.008856 * Yn) {
! Lstar = 903.3f * Y / Yn;
} else
if (Y <= Yn) {
! Lstar = 116.0f * cubert(Y/Yn) - 16.0f;
} else {
Lstar = 100.0;
***************
*** 695,700 ****
float uprime, vprime, wprime;
XYZ_to_uvwp(X, Y, Z, uprime, vprime, wprime);
! ustar = 13.0 * Lstar * (uprime - unprime);
! vstar = 13.0 * Lstar * (vprime - vnprime);
}
}
--- 694,699 ----
float uprime, vprime, wprime;
XYZ_to_uvwp(X, Y, Z, uprime, vprime, wprime);
! ustar = 13.0f * Lstar * (uprime - unprime);
! vstar = 13.0f * Lstar * (vprime - vnprime);
}
}
***************
*** 717,729 ****
} else {
if (Lstar <= 903.3 * 0.008856) {
! Y = Lstar * Yn / 903.3;
} else
if (Lstar <= 100.0) {
! Y = Yn * pow((Lstar + 16.0) / 116.0, 3.0);
} else {
Y = Yn;
}
! float uprime = unprime + ustar / (13.0 * Lstar);
! float vprime = vnprime + vstar / (13.0 * Lstar);
uvpY_to_XYZ(uprime, vprime, Y, X, Y, Z);
}
--- 716,728 ----
} else {
if (Lstar <= 903.3 * 0.008856) {
! Y = Lstar * Yn / 903.3f;
} else
if (Lstar <= 100.0) {
! Y = Yn * powf((Lstar + 16.0f) / 116.0f, 3.0f);
} else {
Y = Yn;
}
! float uprime = unprime + ustar / (13.0f * Lstar);
! float vprime = vnprime + vstar / (13.0f * Lstar);
uvpY_to_XYZ(uprime, vprime, Y, X, Y, Z);
}
***************
*** 746,756 ****
*/
void XYZ_to_uvwp(float X, float Y, float Z, float &uprime, float &vprime, float &wprime) {
! float denom = X + 15.0 * Y + 3.0 * Z;
if (denom == 0.0) {
uprime = vprime = wprime = 0.0;
} else {
! uprime = 4.0 * X / denom;
! vprime = 9.0 * Y / denom;
! wprime = (-3.0 * X + 6.0 * Y + 3.0 * Z) / denom;
}
}
--- 745,755 ----
*/
void XYZ_to_uvwp(float X, float Y, float Z, float &uprime, float &vprime, float &wprime) {
! float denom = X + 15.0f * Y + 3.0f * Z;
if (denom == 0.0) {
uprime = vprime = wprime = 0.0;
} else {
! uprime = 4.0f * X / denom;
! vprime = 9.0f * Y / denom;
! wprime = (-3.0f * X + 6.0f * Y + 3.0f * Z) / denom;
}
}
***************
*** 765,770 ****
void uvpY_to_XYZ(float uprime, float vprime, float Y_, float &X, float &Y, float &Z) {
Y = Y_;
! X = 9.0 * Y * uprime / (4.0 * vprime);
! Z = - X / 3.0 - 5.0 * Y + 3.0 * Y / vprime;
}
--- 764,769 ----
void uvpY_to_XYZ(float uprime, float vprime, float Y_, float &X, float &Y, float &Z) {
Y = Y_;
! X = 9.0f * Y * uprime / (4.0f * vprime);
! Z = - X / 3.0f - 5.0f * Y + 3.0f * Y / vprime;
}
***************
*** 777,787 ****
*/
void uvp_to_xyz(float uprime, float vprime, float &x, float &y, float &z) {
! float denom = 6.0 * uprime - 16.0 * vprime + 12.0;
if (denom == 0.0) {
x = y = z = 0.0;
} else {
! x = 9.0 * uprime / denom;
! y = 4.0 * vprime / denom;
! z = (-3.0 * uprime - 20.0 * vprime + 12.0) / denom;
}
}
--- 776,786 ----
*/
void uvp_to_xyz(float uprime, float vprime, float &x, float &y, float &z) {
! float denom = 6.0f * uprime - 16.0f * vprime + 12.0f;
if (denom == 0.0) {
x = y = z = 0.0;
} else {
! x = 9.0f * uprime / denom;
! y = 4.0f * vprime / denom;
! z = (-3.0f * uprime - 20.0f * vprime + 12.0f) / denom;
}
}
***************
*** 795,805 ****
*/
void xy_to_uvwp(float x, float y, float &uprime, float &vprime, float &wprime) {
! float denom = -2.0 * x + 12.0 * y + 3.0;
if (denom == 0.0) {
uprime = vprime = wprime = 0.0;
} else {
! uprime = 4.0 * x / denom;
! vprime = 9.0 * y / denom;
! wprime = (-6.0 * x + 3.0 * y + 3.0) / denom;
}
}
--- 794,804 ----
*/
void xy_to_uvwp(float x, float y, float &uprime, float &vprime, float &wprime) {
! float denom = -2.0f * x + 12.0f * y + 3.0f;
if (denom == 0.0) {
uprime = vprime = wprime = 0.0;
} else {
! uprime = 4.0f * x / denom;
! vprime = 9.0f * y / denom;
! wprime = (-6.0f * x + 3.0f * y + 3.0f) / denom;
}
}
***************
*** 1031,1037 ****
return *this;
case CIELuv:
! H = atan2(c, b);
L = a;
! S = sqrt(b+c);
break;
case CIExyY:
--- 1030,1036 ----
return *this;
case CIELuv:
! H = atan2f(c, b);
L = a;
! S = sqrtf(b+c);
break;
case CIExyY:
***************
*** 1082,1086 ****
void Color::blend(Color const &color, float alpha) {
! composite(color, 1.0-alpha, alpha);
}
--- 1081,1085 ----
void Color::blend(Color const &color, float alpha) {
! composite(color, 1.0f-alpha, alpha);
}
|
|
From: <de...@us...> - 2003-04-21 19:35:50
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv12977
Modified Files:
AircraftObject.cpp
Log Message:
no message
Index: AircraftObject.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/AircraftObject.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** AircraftObject.cpp 18 Apr 2003 20:59:55 -0000 1.16
--- AircraftObject.cpp 21 Apr 2003 19:35:43 -0000 1.17
***************
*** 373,381 ****
{
simdata::Quaternion attitude;
! m_Pitch = DegreesToRadians(pitch);
! m_Roll = DegreesToRadians(roll);
! m_Heading = DegreesToRadians(heading);
! attitude = simdata::Quaternion::MakeQFromEulerAngles(m_Pitch,
! m_Roll,
m_Heading);
DynamicObject::setAttitude(attitude);
--- 373,382 ----
{
simdata::Quaternion attitude;
! m_Pitch = pitch;
! m_Roll = roll;
! m_Heading = heading;
!
! attitude = simdata::Quaternion::MakeQFromEulerAngles( m_Pitch,
! m_Roll,
m_Heading);
DynamicObject::setAttitude(attitude);
***************
*** 400,406 ****
simdata::Vector3 angles = simdata::Quaternion::MakeEulerAnglesFromQ(m_Attitude);
! m_Heading = angles.x;
! m_Pitch = angles.y;
! m_Roll = angles.z;
m_Speed = m_LinearVelocity.Length();
}
--- 401,408 ----
simdata::Vector3 angles = simdata::Quaternion::MakeEulerAnglesFromQ(m_Attitude);
!
! m_Pitch = angles.x;
! m_Roll = angles.y;
! m_Heading = angles.z;
m_Speed = m_LinearVelocity.Length();
}
***************
*** 492,497 ****
snprintf(buffer, 255, "Heading: %.3f, Pitch: %.3f, Roll: %.3f",
RadiansToDegrees(m_Heading),
! RadiansToDegrees(m_Pitch),
! RadiansToDegrees(m_Roll));
stats.push_back(buffer);
}
--- 494,499 ----
snprintf(buffer, 255, "Heading: %.3f, Pitch: %.3f, Roll: %.3f",
RadiansToDegrees(m_Heading),
! RadiansToDegrees(m_Pitch),
! RadiansToDegrees(m_Roll));
stats.push_back(buffer);
}
|
|
From: <de...@us...> - 2003-04-21 19:20:05
|
Update of /cvsroot/csp/APPLICATIONS/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv30033
Modified Files:
CHANGES.current
Log Message:
no message
Index: CHANGES.current
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** CHANGES.current 20 Apr 2003 22:41:40 -0000 1.25
--- CHANGES.current 21 Apr 2003 19:19:57 -0000 1.26
***************
*** 2,5 ****
--- 2,13 ----
===========================
+ 2003-04-21: delta
+ Removed RadiansToDegrees and DegreesToRadians calls in
+ Quaternion::MakeQFromEulerAngles and
+ Quaternion::MakeEulerAnglesFromQ; now you must specify your
+ angles in radians.
+
+ Cleaned the code in these functions.
+
2003-04-20: onsight
Fix for a nasty little bug in ObjectInterface.h that could
***************
*** 7,10 ****
--- 15,22 ----
SimData, install it, then rebuild CSPSim from scratch (just
to be sure).
+
+ 2003-04-19: delta
+ Use swig 1.3.19 on windows now so need to change custom build.
+
2003-04-18: onsight
|
|
From: <de...@us...> - 2003-04-21 19:19:49
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv29751
Modified Files:
Quaternion.cpp
Log Message:
no message
Index: Quaternion.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Quaternion.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Quaternion.cpp 18 Apr 2003 11:51:28 -0000 1.4
--- Quaternion.cpp 21 Apr 2003 19:19:44 -0000 1.5
***************
*** 435,461 ****
{
Quaternion q;
- double roll = DegreesToRadians(x);
- double pitch = DegreesToRadians(y);
- double yaw = DegreesToRadians(z);
! double cyaw, cpitch, croll, syaw, spitch, sroll;
! double cyawcpitch, syawspitch, cyawspitch, syawcpitch;
! cyaw = cos(0.5f * yaw);
! cpitch = cos(0.5f * pitch);
! croll = cos(0.5f * roll);
! syaw = sin(0.5f * yaw);
! spitch = sin(0.5f * pitch);
! sroll = sin(0.5f * roll);
! cyawcpitch = cyaw*cpitch;
! syawspitch = syaw*spitch;
! cyawspitch = cyaw*spitch;
! syawcpitch = syaw*cpitch;
! q.w = (double) (cyawcpitch * croll + syawspitch * sroll);
! q.x = (double) (cyawcpitch * sroll - syawspitch * croll);
! q.y = (double) (cyawspitch * croll + syawcpitch * sroll);
! q.z = (double) (syawcpitch * croll - cyawspitch * sroll);
return q;
--- 435,459 ----
{
Quaternion q;
! double roll = x;
! double pitch = y;
! double yaw = z;
! double cyaw = cos(0.5f * yaw);
! double cpitch = cos(0.5f * pitch);
! double croll = cos(0.5f * roll);
! double syaw = sin(0.5f * yaw);
! double spitch = sin(0.5f * pitch);
! double sroll = sin(0.5f * roll);
! double cyawcpitch = cyaw*cpitch;
! double syawspitch = syaw*spitch;
! double cyawspitch = cyaw*spitch;
! double syawcpitch = syaw*cpitch;
! q.w = cyawcpitch * croll + syawspitch * sroll;
! q.x = cyawcpitch * sroll - syawspitch * croll;
! q.y = cyawspitch * croll + syawcpitch * sroll;
! q.z = syawcpitch * croll - cyawspitch * sroll;
return q;
***************
*** 464,498 ****
Vector3 Quaternion::MakeEulerAnglesFromQ(Quaternion const& q)
{
- double r11, r21, r31, r32, r33, r12, r13;
- double q00, q11, q22, q33;
- double tmp;
Vector3 u;
! q00 = q.w * q.w;
! q11 = q.x * q.x;
! q22 = q.y * q.y;
! q33 = q.z * q.z;
! r11 = q00 + q11 - q22 - q33;
! r21 = 2 * (q.x*q.y + q.w*q.z);
! r31 = 2 * (q.x*q.z - q.w*q.y);
! r32 = 2 * (q.y*q.z + q.w*q.x);
! r33 = q00 - q11 - q22 + q33;
! tmp = fabs(r31);
if(tmp > 0.999999)
{
! r12 = 2 * (q.x*q.y - q.w*q.z);
! r13 = 2 * (q.x*q.z + q.w*q.y);
! u.x = RadiansToDegrees(0.0f); //roll
! u.y = RadiansToDegrees((double) (-(G_PI/2) * r31/tmp)); // pitch
! u.z = RadiansToDegrees((double) atan2(-r12, -r31*r13)); // yaw
! return u;
}
- u.x = RadiansToDegrees((double) atan2(r32, r33)); // roll
- u.y = RadiansToDegrees((double) asin(-r31)); // pitch
- u.z = RadiansToDegrees((double) atan2(r21, r11)); // yaw
return u;
--- 462,494 ----
Vector3 Quaternion::MakeEulerAnglesFromQ(Quaternion const& q)
{
Vector3 u;
! double q00 = q.w * q.w;
! double q11 = q.x * q.x;
! double q22 = q.y * q.y;
! double q33 = q.z * q.z;
! double r11 = q00 + q11 - q22 - q33;
! double r21 = 2 * (q.x*q.y + q.w*q.z);
! double r31 = 2 * (q.x*q.z - q.w*q.y);
! double r32 = 2 * (q.y*q.z + q.w*q.x);
! double r33 = q00 - q11 - q22 + q33;
! double tmp = fabs(r31);
if(tmp > 0.999999)
{
! double r12 = 2 * (q.x*q.y - q.w*q.z);
! double r13 = 2 * (q.x*q.z + q.w*q.y);
! u.x = 0.0f; //roll
! u.y = -(G_PI/2) * r31/tmp; // pitch
! u.z = atan2(-r12, -r31*r13); // yaw
! }
! else {
! u.x = atan2(r32, r33); // roll
! u.y = asin(-r31); // pitch
! u.z = atan2(r21, r11); // yaw
}
return u;
|
|
From: <mk...@us...> - 2003-04-20 22:41:45
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv24446/Include/SimData
Modified Files:
ObjectInterface.h
Log Message:
see CHANGES.current
Index: ObjectInterface.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/ObjectInterface.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** ObjectInterface.h 12 Apr 2003 08:56:37 -0000 1.12
--- ObjectInterface.h 20 Apr 2003 22:41:41 -0000 1.13
***************
*** 401,405 ****
virtual MemberAccessorBase *getAccessor(const char *name) {
! return table[name];
}
--- 401,407 ----
virtual MemberAccessorBase *getAccessor(const char *name) {
! MemberAccessorBase::map::const_iterator idx = table.find(name);
! if (idx == table.end()) return 0;
! return idx->second;
}
|
|
From: <mk...@us...> - 2003-04-20 22:41:44
|
Update of /cvsroot/csp/APPLICATIONS/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv24446
Modified Files:
CHANGES.current
Log Message:
see CHANGES.current
Index: CHANGES.current
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** CHANGES.current 18 Apr 2003 11:51:28 -0000 1.24
--- CHANGES.current 20 Apr 2003 22:41:40 -0000 1.25
***************
*** 2,5 ****
--- 2,11 ----
===========================
+ 2003-04-20: onsight
+ Fix for a nasty little bug in ObjectInterface.h that could
+ cause memory corruption during data compiling. Rebuild
+ SimData, install it, then rebuild CSPSim from scratch (just
+ to be sure).
+
2003-04-18: onsight
Wrote a specialized vector rotation method for quaternions
|
|
From: <mk...@us...> - 2003-04-18 20:59:58
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv491/Include Modified Files: AircraftObject.h ScreenInfo.h Log Message: see CHANGES.current Index: AircraftObject.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/AircraftObject.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AircraftObject.h 18 Apr 2003 20:29:13 -0000 1.9 --- AircraftObject.h 18 Apr 2003 20:59:55 -0000 1.10 *************** *** 122,128 **** // dynamic properties ! double m_roll; ! double m_pitch; ! double m_heading; // control inputs --- 122,128 ---- // dynamic properties ! double m_Roll; ! double m_Pitch; ! double m_Heading; // control inputs Index: ScreenInfo.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/ScreenInfo.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ScreenInfo.h 18 Apr 2003 20:29:13 -0000 1.3 --- ScreenInfo.h 18 Apr 2003 20:59:55 -0000 1.4 *************** *** 30,34 **** #include <osgText/Text> ! #include <simdata/Types.h> #include "DynamicObject.h" --- 30,34 ---- #include <osgText/Text> ! #include <SimData/Types.h> #include "DynamicObject.h" |
|
From: <mk...@us...> - 2003-04-18 20:59:58
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv491/Source
Modified Files:
AircraftObject.cpp NumericalMethod.cpp
Log Message:
see CHANGES.current
Index: AircraftObject.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/AircraftObject.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** AircraftObject.cpp 18 Apr 2003 20:29:41 -0000 1.15
--- AircraftObject.cpp 18 Apr 2003 20:59:55 -0000 1.16
***************
*** 42,48 ****
m_ObjectName = "AIRCRAFT";
! m_heading = 0.0;
! m_roll = 0.0;
! m_pitch = 0.0;
m_Aileron = 0.0;
--- 42,48 ----
m_ObjectName = "AIRCRAFT";
! m_Heading = 0.0;
! m_Roll = 0.0;
! m_Pitch = 0.0;
m_Aileron = 0.0;
***************
*** 373,379 ****
{
simdata::Quaternion attitude;
! attitude = simdata::Quaternion::MakeQFromEulerAngles(DegreesToRadians(pitch),
! DegreesToRadians(roll),
! DegreesToRadians(heading));
DynamicObject::setAttitude(attitude);
}
--- 373,382 ----
{
simdata::Quaternion attitude;
! m_Pitch = DegreesToRadians(pitch);
! m_Roll = DegreesToRadians(roll);
! m_Heading = DegreesToRadians(heading);
! attitude = simdata::Quaternion::MakeQFromEulerAngles(m_Pitch,
! m_Roll,
! m_Heading);
DynamicObject::setAttitude(attitude);
}
***************
*** 397,403 ****
simdata::Vector3 angles = simdata::Quaternion::MakeEulerAnglesFromQ(m_Attitude);
! m_heading = RadiansToDegrees(angles.x);
! m_pitch = RadiansToDegrees(angles.y);
! m_roll = RadiansToDegrees(angles.z);
m_Speed = m_LinearVelocity.Length();
}
--- 400,406 ----
simdata::Vector3 angles = simdata::Quaternion::MakeEulerAnglesFromQ(m_Attitude);
! m_Heading = angles.x;
! m_Pitch = angles.y;
! m_Roll = angles.z;
m_Speed = m_LinearVelocity.Length();
}
***************
*** 488,492 ****
stats.push_back(buffer);
snprintf(buffer, 255, "Heading: %.3f, Pitch: %.3f, Roll: %.3f",
! m_heading, m_pitch, m_roll);
stats.push_back(buffer);
}
--- 491,497 ----
stats.push_back(buffer);
snprintf(buffer, 255, "Heading: %.3f, Pitch: %.3f, Roll: %.3f",
! RadiansToDegrees(m_Heading),
! RadiansToDegrees(m_Pitch),
! RadiansToDegrees(m_Roll));
stats.push_back(buffer);
}
Index: NumericalMethod.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/NumericalMethod.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** NumericalMethod.cpp 18 Apr 2003 20:29:41 -0000 1.2
--- NumericalMethod.cpp 18 Apr 2003 20:59:55 -0000 1.3
***************
*** 353,355 ****
//std::cout << "RungeKuttaCK::enhancedSolve nok = " << nok << "; nbad = " << nbad << "\n" << std::endl;
return result;
! }
\ No newline at end of file
--- 353,356 ----
//std::cout << "RungeKuttaCK::enhancedSolve nok = " << nok << "; nbad = " << nbad << "\n" << std::endl;
return result;
! }
!
|
|
From: <mk...@us...> - 2003-04-18 20:59:58
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1:/tmp/cvs-serv491 Modified Files: CHANGES.current Log Message: see CHANGES.current Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** CHANGES.current 18 Apr 2003 20:30:13 -0000 1.22 --- CHANGES.current 18 Apr 2003 20:59:54 -0000 1.23 *************** *** 2,5 **** --- 2,10 ---- =========================== + 2003-04-19: onsight + Changed AircraftObject:: m_heading, m_pitch, m_roll to m_Heading, + m_Pitch, m_Roll. These are now in radians, and converted to + degrees only if necessary (for display). setAttitude(x, y, z) + still takes degrees. 2003-04-18: delta |
|
From: <mk...@us...> - 2003-04-18 20:36:22
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data/Input In directory sc8-pr-cvs1:/tmp/cvs-serv22861 Removed Files: gamescreen.hid Log Message: --- gamescreen.hid DELETED --- |
|
From: <de...@us...> - 2003-04-18 20:36:08
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/VisualStudio/CSPSimDLL In directory sc8-pr-cvs1:/tmp/cvs-serv22748 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.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CSPSimDLL.vcproj 12 Apr 2003 10:20:04 -0000 1.6 --- CSPSimDLL.vcproj 18 Apr 2003 20:36:00 -0000 1.7 *************** *** 195,198 **** --- 195,201 ---- </File> <File + RelativePath="..\..\Source\Exception.cpp"> + </File> + <File RelativePath="..\..\Source\F16Model.cpp"> </File> *************** *** 259,262 **** --- 262,268 ---- <File RelativePath="..\..\Source\VirtualBattlefield.cpp"> + </File> + <File + RelativePath="..\..\Source\VirtualScene.cpp"> </File> <File |
|
From: <de...@us...> - 2003-04-18 20:35:47
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/VisualStudio/CSPSimAppli In directory sc8-pr-cvs1:/tmp/cvs-serv22575 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.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CSPSimAppli.vcproj 12 Apr 2003 10:19:42 -0000 1.4 --- CSPSimAppli.vcproj 18 Apr 2003 20:35:43 -0000 1.5 *************** *** 190,193 **** --- 190,196 ---- </File> <File + RelativePath="..\..\Source\Exception.cpp"> + </File> + <File RelativePath="..\..\Source\F16Model.cpp"> </File> *************** *** 256,259 **** --- 259,265 ---- </File> <File + RelativePath="..\..\Source\VirtualScene.cpp"> + </File> + <File RelativePath="..\..\Source\base.cpp"> </File> *************** *** 321,324 **** --- 327,333 ---- <File RelativePath="..\..\Include\FLCS.h"> + </File> + <File + RelativePath="..\..\Include\GameScreen.h"> </File> <File |
|
From: <mk...@us...> - 2003-04-18 20:34:56
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data/Input In directory sc8-pr-cvs1:/tmp/cvs-serv22066 Removed Files: aircraft.hid Log Message: --- aircraft.hid DELETED --- |
|
From: <de...@us...> - 2003-04-18 20:30:17
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim
In directory sc8-pr-cvs1:/tmp/cvs-serv19724
Modified Files:
CHANGES.current
Log Message:
no message
Index: CHANGES.current
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** CHANGES.current 18 Apr 2003 12:07:33 -0000 1.21
--- CHANGES.current 18 Apr 2003 20:30:13 -0000 1.22
***************
*** 2,5 ****
--- 2,18 ----
===========================
+
+ 2003-04-18: delta
+ Added Runge-Kutta Cask-Karp numerical method.doSimStep2() is now
+ calling it.
+
+ Added a note on initialization of 'pause'.
+ Added a simdata::Pointer<DynamicalObject> parameter in ObjectStats methods.
+ Added a check to non nullitty of m_GameScreen in CSPSim::setActiveObject.
+ Fixed a getStats non const method in AircraftObject class.
+ Checked Onsight changes: a couple of forward class declarations causing
+ compilation problems in vc++ have been fixed thanks to Onsight.
+ Updated .NET project.
+
2003-04-18: onsight
Lots of changes to many parts of CSPSim. First and foremost, the
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include
In directory sc8-pr-cvs1:/tmp/cvs-serv19209
Modified Files:
SimObject.h ScreenInfoManager.h ScreenInfo.h NumericalMethod.h
CSPSim.h AircraftObject.h AeroDynamics.h
Log Message:
no message
Index: SimObject.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/SimObject.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** SimObject.h 18 Apr 2003 12:06:48 -0000 1.6
--- SimObject.h 18 Apr 2003 20:29:12 -0000 1.7
***************
*** 74,84 ****
void setFreezeFlag(bool flag) { setFlags(F_FREEZE, flag); }
! bool getFreezeFlag() const { return getFlags(F_FREEZE); }
void setDeleteFlag(bool flag) { setFlags(F_DELETE, flag); }
! bool getDeleteFlag() const { return getFlags(F_DELETE); }
void setGroundFlag(bool flag) { setFlags(F_GROUND, flag); }
! bool getGroundFlag() const { return getFlags(F_GROUND); }
virtual simdata::Vector3 getViewPoint() const;
--- 74,84 ----
void setFreezeFlag(bool flag) { setFlags(F_FREEZE, flag); }
! bool getFreezeFlag() const { return getFlags(F_FREEZE) != 0; }
void setDeleteFlag(bool flag) { setFlags(F_DELETE, flag); }
! bool getDeleteFlag() const { return getFlags(F_DELETE) != 0; }
void setGroundFlag(bool flag) { setFlags(F_GROUND, flag); }
! bool getGroundFlag() const { return getFlags(F_GROUND) != 0; }
virtual simdata::Vector3 getViewPoint() const;
Index: ScreenInfoManager.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/ScreenInfoManager.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ScreenInfoManager.h 12 Mar 2003 21:37:35 -0000 1.2
--- ScreenInfoManager.h 18 Apr 2003 20:29:12 -0000 1.3
***************
*** 37,41 ****
void setStatus(std::string const & name, bool bvisible);
bool ScreenInfoManager::getStatus(std::string const & name);
! void changeObjectStats(int ScreenWidth, int ScreenHeight);
private:
osg::MatrixTransform* m_modelview_abs;
--- 37,41 ----
void setStatus(std::string const & name, bool bvisible);
bool ScreenInfoManager::getStatus(std::string const & name);
! void changeObjectStats(int ScreenWidth, int ScreenHeight,simdata::Pointer<DynamicObject> const& activeObject);
private:
osg::MatrixTransform* m_modelview_abs;
Index: ScreenInfo.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/ScreenInfo.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ScreenInfo.h 12 Mar 2003 21:37:35 -0000 1.2
--- ScreenInfo.h 18 Apr 2003 20:29:13 -0000 1.3
***************
*** 30,33 ****
--- 30,37 ----
#include <osgText/Text>
+ #include <simdata/Types.h>
+
+ #include "DynamicObject.h"
+
class ScreenInfo:public osg::Geode
{
***************
*** 41,45 ****
virtual ~ScreenInfo() {}
virtual void update(){}
! void setStatus(bool const bvisible) {if (bvisible) setNodeMask(1); else setNodeMask(0);};
bool getStatus() const {return getNodeMask() != 0;};
};
--- 45,49 ----
virtual ~ScreenInfo() {}
virtual void update(){}
! void setStatus(bool const bvisible) {if (bvisible) setNodeMask(0x1); else setNodeMask(0x0);};
bool getStatus() const {return getNodeMask() != 0;};
};
***************
*** 74,78 ****
std::vector<osgText::Text*> m_ObjectStats;
public:
! ObjectStats(int posx,int posy);
virtual void update();
virtual ~ObjectStats(){}
--- 78,82 ----
std::vector<osgText::Text*> m_ObjectStats;
public:
! ObjectStats(int posx,int posy, simdata::Pointer<DynamicObject> const& activeObject);
virtual void update();
virtual ~ObjectStats(){}
Index: NumericalMethod.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/NumericalMethod.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** NumericalMethod.h 12 Apr 2003 10:17:05 -0000 1.3
--- NumericalMethod.h 18 Apr 2003 20:29:13 -0000 1.4
***************
*** 50,64 ****
unsigned short m_dimension;
VectorField* vectorField;
! bool m_bfailed;
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();
--- 50,64 ----
unsigned short m_dimension;
VectorField* vectorField;
! bool m_failed;
public:
NumericalMethod(bool deleteVF = true):
m_bdeleteVF(deleteVF),
vectorField(0),
! m_failed(false) {
}
NumericalMethod(VectorField* pf, bool deleteVF = true):
m_bdeleteVF(deleteVF),
vectorField(pf),
! m_failed(false) {
if (vectorField)
m_dimension = vectorField->getDimension();
***************
*** 81,85 ****
};
! class RungeKutta: public NumericalMethod
{
std::vector<double> const & rk4(std::vector<double> const & y,
--- 81,85 ----
};
! class RungeKutta2: public NumericalMethod
{
std::vector<double> const & rk4(std::vector<double> const & y,
***************
*** 87,94 ****
double x, double h) const;
std::vector<double> const & rkqc(std::vector<double> &y,
! std::vector<double> &dyx,
double &x, double htry, double eps,
std::vector<double> const &yscal,
! double &hdid, double &hnext) const;
std::vector<double> const &odeint(std::vector<double> const & ystart,
double x1, double x2,
--- 87,94 ----
double x, double h) const;
std::vector<double> const & rkqc(std::vector<double> &y,
! std::vector<double> &dydx,
double &x, double htry, double eps,
std::vector<double> const &yscal,
! double &hdid, double &hnext);
std::vector<double> const &odeint(std::vector<double> const & ystart,
double x1, double x2,
***************
*** 109,113 ****
std::vector<double> const& quickSolve(std::vector<double>& y0, double t0, double dt) const;
std::vector<double> const& enhancedSolve(std::vector<double>& y0, double t0, double dt);
! RungeKutta(
VectorField* vectorField = 0,
bool deleteVF = true,
--- 109,113 ----
std::vector<double> const& quickSolve(std::vector<double>& y0, double t0, double dt) const;
std::vector<double> const& enhancedSolve(std::vector<double>& y0, double t0, double dt);
! RungeKutta2(
VectorField* vectorField = 0,
bool deleteVF = true,
***************
*** 121,124 ****
--- 121,165 ----
{}
};
+
+ class RungeKuttaCK: public NumericalMethod
+ {
+ std::vector<double> const & rkck(std::vector<double> const & y,
+ std::vector<double> const & dyx,
+ double x, double h, std::vector<double>& yerr) const;
+ std::vector<double> const & rkqs(std::vector<double> &y,
+ std::vector<double> &dydx,
+ double &x, double htry, double eps,
+ std::vector<double> const &yscal,
+ double &hdid, double &hnext);
+ std::vector<double> const &odeint(std::vector<double> const & ystart,
+ double x1, double x2,
+ double eps, double h1, double hmin,
+ unsigned int &nok, unsigned int &nbad);
+
+ static double const PGROW ;
+ static double const PSHRNK;
+
+ static double const SAFETY;
+ static double const ERRCON;
+
+ static unsigned int const MAXSTP;
+ static double const TINY;
+ double m_precision, m_hmin, m_hestimate;
+ public:
+ std::vector<double> const& quickSolve(std::vector<double>& y0, double t0, double dt) const;
+ std::vector<double> const& enhancedSolve(std::vector<double>& y0, double t0, double dt);
+ RungeKuttaCK(
+ VectorField* vectorField = 0,
+ bool deleteVF = true,
+ double Precision = 1.e-3, //1.e-4
+ double Hmin = std::numeric_limits<float>::epsilon(),
+ double Hestimate = 1.e-2):
+ NumericalMethod(vectorField, deleteVF),
+ m_precision(Precision),
+ m_hmin(Hmin),
+ m_hestimate(Hestimate)
+ {}
+ };
+
#endif // __NUMERICALMETHOD_H__
Index: CSPSim.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/CSPSim.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** CSPSim.h 18 Apr 2003 12:06:47 -0000 1.11
--- CSPSim.h 18 Apr 2003 20:29:13 -0000 1.12
***************
*** 34,45 ****
#include <SimData/DataManager.h>
#include "DynamicObject.h"
#include "TerrainObject.h"
#include "Atmosphere.h"
#include "Shell.h"
#include <Python.h>
- class VirtualBattlefield;
class VirtualScene;
class VirtualHID;
--- 34,46 ----
#include <SimData/DataManager.h>
+
#include "DynamicObject.h"
#include "TerrainObject.h"
#include "Atmosphere.h"
#include "Shell.h"
+ #include "VirtualBattlefield.h"
#include <Python.h>
class VirtualScene;
class VirtualHID;
Index: AircraftObject.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/AircraftObject.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** AircraftObject.h 18 Apr 2003 12:06:47 -0000 1.8
--- AircraftObject.h 18 Apr 2003 20:29:13 -0000 1.9
***************
*** 94,107 ****
void doFCS(double dt);
- void getStats(std::vector<std::string> &stats);
-
void setAttitude(double pitch, double roll, double heading);
void setComplexPhysics(bool flag) { m_ComplexPhysics = flag; }
! double getAngleOfAttack() { return m_FlightModel->getAngleOfAttack(); }
! double getSideSlip() { return m_FlightModel->getSideSlip(); }
! virtual double getGForce() { return m_FlightModel->getGForce();};
! virtual double getSpeed() { return m_FlightModel->getSpeed();};
// void initializeHud();
--- 94,107 ----
void doFCS(double dt);
void setAttitude(double pitch, double roll, double heading);
void setComplexPhysics(bool flag) { m_ComplexPhysics = flag; }
! double getAngleOfAttack() const { return m_FlightModel->getAngleOfAttack(); }
! double getSideSlip() const { return m_FlightModel->getSideSlip(); }
! virtual double getGForce() const { return m_FlightModel->getGForce();}
! virtual double getSpeed() const { return m_FlightModel->getSpeed();}
!
! void getStats(std::vector<std::string> &stats) const;
// void initializeHud();
Index: AeroDynamics.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/AeroDynamics.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** AeroDynamics.h 3 Apr 2003 10:40:22 -0000 1.7
--- AeroDynamics.h 18 Apr 2003 20:29:13 -0000 1.8
***************
*** 136,141 ****
float m_DrMin;
! float m_GMin;
! float m_GMax;
/**
--- 136,142 ----
float m_DrMin;
! // the folowing parameters are both structural and controlled in nature
! float m_GMin; // min number of G that this aircraft model can support (in general < 0)
! float m_GMax; // max ... (in general > 3)
/**
|
|
From: <mk...@us...> - 2003-04-18 13:06:10
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv3503
Modified Files:
VirtualScene.cpp
Log Message:
Index: VirtualScene.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/VirtualScene.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** VirtualScene.cpp 18 Apr 2003 12:06:31 -0000 1.1
--- VirtualScene.cpp 18 Apr 2003 13:06:04 -0000 1.2
***************
*** 628,637 ****
- void VirtualScene::setBattlefield(simdata::Pointer<VirtualBattlefield> battlefield)
- {
- m_Battlefield = battlefield;
- }
-
-
void VirtualScene::setTerrain(simdata::Pointer<TerrainObject> terrain)
{
--- 628,631 ----
|
|
From: <mk...@us...> - 2003-04-18 13:05:58
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include
In directory sc8-pr-cvs1:/tmp/cvs-serv3414
Modified Files:
TerrainObject.h VirtualScene.h
Log Message:
Index: TerrainObject.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/TerrainObject.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TerrainObject.h 18 Apr 2003 12:06:49 -0000 1.6
--- TerrainObject.h 18 Apr 2003 13:05:53 -0000 1.7
***************
*** 40,43 ****
--- 40,47 ----
}
+ #include <osg/ref_ptr>
+ #include <osg/Node>
+
+
/**
* class TerrainObject
Index: VirtualScene.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/VirtualScene.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** VirtualScene.h 18 Apr 2003 12:45:02 -0000 1.2
--- VirtualScene.h 18 Apr 2003 13:05:53 -0000 1.3
***************
*** 44,48 ****
}
- #include "VirtualBattlefield.h"
#include "TerrainObject.h"
#include "SimObject.h"
--- 44,47 ----
***************
*** 86,92 ****
void setViewDistance(float value);
- void setBattlefield(simdata::Pointer<VirtualBattlefield>);
- simdata::Pointer<VirtualBattlefield> getBattlefield() const { return m_Battlefield; }
-
void setTerrain(simdata::Pointer<TerrainObject>);
simdata::Pointer<TerrainObject> getTerrain() const { return m_Terrain; }
--- 85,88 ----
***************
*** 106,110 ****
simdata::Pointer<TerrainObject> m_Terrain;
- simdata::Pointer<VirtualBattlefield> m_Battlefield;
osg::ref_ptr<osgUtil::SceneView> m_View;
--- 102,105 ----
|
|
From: <mk...@us...> - 2003-04-18 12:45:07
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv29007 Modified Files: VirtualBattlefield.h VirtualScene.h Log Message: Index: VirtualBattlefield.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/VirtualBattlefield.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** VirtualBattlefield.h 18 Apr 2003 12:06:49 -0000 1.7 --- VirtualBattlefield.h 18 Apr 2003 12:45:02 -0000 1.8 *************** *** 32,39 **** #include <SimData/Path.h> class BaseController; - class TerrainObject; - class VirtualScene; - class DynamicObject; --- 32,40 ---- #include <SimData/Path.h> + #include "TerrainObject.h" + #include "VirtualScene.h" + #include "DynamicObject.h" + class BaseController; Index: VirtualScene.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/VirtualScene.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** VirtualScene.h 18 Apr 2003 12:06:50 -0000 1.1 --- VirtualScene.h 18 Apr 2003 12:45:02 -0000 1.2 *************** *** 44,51 **** } ! class VirtualBattlefield; ! class TerrainObject; ! class Sky; ! class SimObject; --- 44,51 ---- } ! #include "VirtualBattlefield.h" ! #include "TerrainObject.h" ! #include "SimObject.h" ! #include "Sky.h" |
|
From: <mk...@us...> - 2003-04-18 12:07:16
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data/XML/vehicles/tanks In directory sc8-pr-cvs1:/tmp/cvs-serv16120/vehicles/tanks Modified Files: t62.xml Log Message: see CHANGES.current Index: t62.xml =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Data/XML/vehicles/tanks/t62.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** t62.xml 26 Mar 2003 10:18:54 -0000 1.2 --- t62.xml 18 Apr 2003 12:07:11 -0000 1.3 *************** *** 2,6 **** <Object class="TankObject"> - <Int name="army">5</Int> <Path name="model">t62.model</Path> <Float name="mass">41500</Float> --- 2,5 ---- |
|
From: <mk...@us...> - 2003-04-18 12:07:14
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data/XML/vehicles/aircraft/m2k In directory sc8-pr-cvs1:/tmp/cvs-serv16120/vehicles/aircraft/m2k Modified Files: model.xml Log Message: see CHANGES.current Index: model.xml =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Data/XML/vehicles/aircraft/m2k/model.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** model.xml 26 Mar 2003 10:57:29 -0000 1.6 --- model.xml 18 Apr 2003 12:07:11 -0000 1.7 *************** *** 9,16 **** <Matrix name="rotation">1 0 0 0 1 0 0 0 1</Matrix> <Float name="scale">1.0</Float> <List name="contacts"> ! <Vector>0.0 3.3 -2.0</Vector> ! <Vector>-1.4 -0.7 -2.0</Vector> ! <Vector>1.4 -0.7 -2.0</Vector> <Vector>0.0 8.55 -0.4</Vector> <Vector>0.0 5.0 0.9</Vector> --- 9,17 ---- <Matrix name="rotation">1 0 0 0 1 0 0 0 1</Matrix> <Float name="scale">1.0</Float> + <Vector name="view_point">0.0 4.5 0.65</Vector> <List name="contacts"> ! <Vector>0.0 4.75 -2.0</Vector> ! <Vector>-1.75 -0.7 -2.0</Vector> ! <Vector>1.75 -0.7 -2.0</Vector> <Vector>0.0 8.55 -0.4</Vector> <Vector>0.0 5.0 0.9</Vector> *************** *** 22,25 **** --- 23,28 ---- <Vector>0.0 7.1 -0.67</Vector> <Vector>0.0 0.0 -0.75</Vector> + <!-- view point --> + <Vector>0.0 4.5 0.65</Vector> </List> </Object> |
|
From: <mk...@us...> - 2003-04-18 12:07:14
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Data/XML/vehicles/aircraft In directory sc8-pr-cvs1:/tmp/cvs-serv16120/vehicles/aircraft Modified Files: m2k.xml Log Message: see CHANGES.current Index: m2k.xml =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Data/XML/vehicles/aircraft/m2k.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** m2k.xml 26 Mar 2003 10:18:53 -0000 1.3 --- m2k.xml 18 Apr 2003 12:07:10 -0000 1.4 *************** *** 20,25 **** <Float name="rudder_max">25.0</Float> - <Int name="army">0</Int> - <!-- Mass/Inertial properties --> <!-- --- 20,23 ---- |
|
From: <mk...@us...> - 2003-04-18 12:07:04
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Bin
In directory sc8-pr-cvs1:/tmp/cvs-serv16051
Modified Files:
CSPSim.py
Added Files:
TestObjects.py
Log Message:
see CHANGES.current
--- NEW FILE: TestObjects.py ---
import SimData
def create(app):
v = SimData.Vector3
vehicle = app.createVehicle
vehicle("sim:vehicles.aircraft.m2k", v(483010, 499010, 190.2), v(0, 100.0, 0), v(2.0, 2.0, 140.0))
vehicle("sim:vehicles.aircraft.m2k", v(483025, 499015, 190.2), v(0, 100.0, 0), v(5.0, 0.0, 240.0))
vehicle("sim:vehicles.aircraft.m2k", v(483040, 499020, 190.2), v(0, 100.0, 0), v(8.0, 1.0, 240.0))
vehicle("sim:vehicles.aircraft.m2k", v(483055, 499025, 190.2), v(0, 100.0, 0), v(12.0, 3.0, 240.0))
Index: CSPSim.py
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Bin/CSPSim.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CSPSim.py 11 Apr 2003 18:59:18 -0000 1.2
--- CSPSim.py 18 Apr 2003 12:07:00 -0000 1.3
***************
*** 1,5 ****
#!/usr/bin/python -O
! import sys, os.path
#import Shell
--- 1,5 ----
#!/usr/bin/python -O
! import sys, os, os.path
#import Shell
***************
*** 10,13 ****
--- 10,18 ----
sys.setdlopenflags(0x101)
+ # is the SDL joystick environment variable isn't set, try a standard value
+ if not os.environ.has_key("SDL_JOYSTICK_DEVICE"):
+ # try a reasonable default for linux
+ if os.path.exists("/dev/input/js0"):
+ os.environ["SDL_JOYSTICK_DEVICE"]="/dev/input/js0"
def printUsage():
***************
*** 36,39 ****
--- 41,53 ----
app = CSP.CSPSim()
app.init()
+
+ try:
+ import TestObjects
+ TestObjects.create(app)
+ except ImportError:
+ pass
+ except Exception, e:
+ print "Error in TestObjects.py:", e
+
app.setShell(Shell.Shell())
app.run()
|
|
From: <mk...@us...> - 2003-04-18 11:58:44
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv12953/Include/SimData
Added Files:
DataManager.i
Log Message:
see CHANGES.current
--- NEW FILE: DataManager.i ---
%module DataManager
%{
#include <SimData/Object.h>
#include <SimData/DataManager.h>
%}
%import "SimData/Exception.i"
//typedef unsigned long long hasht; /* unsigned 8-byte type */
//typedef int int32;
%include exception.i
%exception SIMDATA(DataManager) {
try {
$function
} catch (SIMDATA(IndexError) e) {
e.details();
SWIG_exception(SWIG_IndexError, "Path not found");
} catch (SIMDATA(ObjectMismatch) e) {
e.details();
SWIG_exception(SWIG_TypeError, "Object Mismatch");
} catch (SIMDATA(BadMagic) e) {
e.details();
SWIG_exception(SWIG_IOError, "Bad Magic");
} catch (SIMDATA(BadByteOrder) e) {
e.details();
SWIG_exception(SWIG_IOError, "Incorrect Byte Order");
}
}
%import "SimData/Object.i"
%import "SimData/DataArchive.i"
%include "SimData/DataManager.h"
%exception;
|
|
From: <mk...@us...> - 2003-04-18 11:51:33
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv10707/Source
Modified Files:
Quaternion.cpp
Log Message:
see CHANGES.current
Index: Quaternion.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Quaternion.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Quaternion.cpp 11 Apr 2003 18:06:39 -0000 1.3
--- Quaternion.cpp 18 Apr 2003 11:51:28 -0000 1.4
***************
*** 62,84 ****
//----------------------------------------------------------------------------
- Quaternion::Quaternion (double fW, double fX, double fY, double fZ)
- {
- w = fW;
- x = fX;
- y = fY;
- z = fZ;
- }
-
- //----------------------------------------------------------------------------
-
- Quaternion::Quaternion (const Quaternion& rkQ)
- {
- w = rkQ.w;
- x = rkQ.x;
- y = rkQ.y;
- z = rkQ.z;
- }
-
- //----------------------------------------------------------------------------
void Quaternion::FromRotationMatrix (const Matrix3& kRot)
--- 62,65 ----
***************
*** 227,240 ****
//----------------------------------------------------------------------------
- Quaternion& Quaternion::operator= (const Quaternion& rkQ)
- {
- w = rkQ.w;
- x = rkQ.x;
- y = rkQ.y;
- z = rkQ.z;
- return *this;
- }
-
- //----------------------------------------------------------------------------
//Quaternion Quaternion::operator+ (const Quaternion& rkQ) const
--- 208,211 ----
***************
*** 283,306 ****
//----------------------------------------------------------------------------
- Quaternion Quaternion::operator- () const
- {
- return Quaternion(-w,-x,-y,-z);
- }
-
- //----------------------------------------------------------------------------
-
- double Quaternion::Dot (const Quaternion& rkQ) const
- {
- return w*rkQ.w+x*rkQ.x+y*rkQ.y+z*rkQ.z;
- }
-
- //----------------------------------------------------------------------------
-
- double Quaternion::Norm () const
- {
- return w*w+x*x+y*y+z*z;
- }
-
- //----------------------------------------------------------------------------
Quaternion Quaternion::Inverse () const //checked (delta)
--- 254,257 ----
***************
*** 321,332 ****
//----------------------------------------------------------------------------
- Quaternion Quaternion::UnitInverse () const //checked (delta)
- {
- // assert: 'this' is unit length
- return Quaternion(w,-x,-y,-z);
- }
-
- //----------------------------------------------------------------------------
-
Quaternion Quaternion::Exp () const
{
--- 272,275 ----
***************
*** 583,618 ****
}
- double Quaternion::Magnitude(void) const
- {
- return sqrt(w*w + x*x + y*y + z*z);
- }
-
- Vector3 QVRotate(Quaternion const& q, Vector3 const& v)
- {
- Quaternion t;
- t = (q*v)*q.Bar();
- return t.GetVector();
- }
-
- Quaternion Quaternion::Bar() const
- {
- return Quaternion(w,-x,-y,-z);
- }
-
- Quaternion QRotate(Quaternion const& q1, Quaternion const& q2)
- {
- return q1*q2*(~q1);
- }
-
- Vector3 Quaternion::GetVector(void)
- {
- return Vector3(x, y, z);
- }
-
- double Quaternion::GetScalar(void)
- {
- return w;
- }
-
Quaternion& Quaternion::operator/=(double s) // Checked (delta)
--- 526,529 ----
***************
*** 690,693 ****
--- 601,628 ----
bool operator!=(const Quaternion &a, const Quaternion &b) {
return a.w != b.w || a.x != b.x || a.y != b.y || a.z != b.z;
+ }
+
+ Vector3 Quaternion::GetRotated(Vector3 const &v) const
+ {
+ //Quaternion t = (*this*v)*Bar();
+ //return t.GetVector();
+ double qw = w;
+ double qx = x;
+ double qy = y;
+ double qz = z;
+ double vx = v.x;
+ double vy = v.y;
+ double vz = v.z;
+
+ double uw =-(qx*vx + qy*vy + qz*vz);
+ double ux = qw*vx + qy*vz - qz*vy;
+ double uy = qw*vy + qz*vx - qx*vz;
+ double uz = qw*vz + qx*vy - qy*vx;
+
+ vx = -uw*qx+ux*qw-uy*qz+uz*qy;
+ vy = -uw*qy+uy*qw-uz*qx+ux*qz;
+ vz = -uw*qz+uz*qw-ux*qy+uy*qx;
+
+ return Vector3(vx, vy, vz);
}
|
|
From: <mk...@us...> - 2003-04-18 11:51:31
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv10707/Include/SimData
Modified Files:
Quaternion.h cSimData.i
Log Message:
see CHANGES.current
Index: Quaternion.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Quaternion.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Quaternion.h 12 Apr 2003 08:56:38 -0000 1.6
--- Quaternion.h 18 Apr 2003 11:51:28 -0000 1.7
***************
*** 49,57 ****
#include <SimData/ns-simdata.h>
#include <SimData/Export.h>
NAMESPACE_SIMDATA
- class Vector3;
class Matrix3;
--- 49,57 ----
#include <SimData/ns-simdata.h>
#include <SimData/Export.h>
+ #include <SimData/Vector3.h>
NAMESPACE_SIMDATA
class Matrix3;
***************
*** 60,64 ****
* class Quaternion
*
! * @author unknown
*/
class SIMDATA_EXPORT Quaternion: public BaseType
--- 60,67 ----
* class Quaternion
*
! * Quaternions are four dimensional objects that form a compact
! * representation for rotations. Many thorough treatments of
! * quaternions and their use in simulations can be readily found
! * on the web.
*/
class SIMDATA_EXPORT Quaternion: public BaseType
***************
*** 67,73 ****
double w, x, y, z;
! // construction and destruction
! Quaternion (double fW = 1.0f, double fX = 0.0f, double fY = 0.0f, double fZ = 0.0f);
! Quaternion (const Quaternion& rkQ);
// BaseType interface
--- 70,85 ----
double w, x, y, z;
! /**
! * Construct a new quaternion.
! *
! * Specifiy the four real-valued components, or use the defaults
! * to construct a unit quaternion.
! */
! Quaternion(double fW = 1.0f, double fX = 0.0f, double fY = 0.0f, double fZ = 0.0f);
!
! /**
! * Copy constructor.
! */
! Quaternion(const Quaternion& rkQ);
// BaseType interface
***************
*** 77,146 ****
// conversion between Quaternions, matrices, and angle-axes
! void FromRotationMatrix (const Matrix3& kRot);
! void ToRotationMatrix (Matrix3& kRot) const;
! void FromAngleAxis (const double& rfAngle, const Vector3& rkAxis);
! void ToAngleAxis (double& rfAngle, Vector3& rkAxis) const;
! void FromAxes (const Vector3* akAxis);
! void ToAxes (Vector3* akAxis) const;
// arithmetic operations
#ifndef SWIG
Quaternion & operator+=(const Quaternion & q);
Quaternion & operator/=(double s);
! Quaternion& operator= (const Quaternion& rkQ);
#endif // SWIG
! inline Quaternion operator+ (const Quaternion& rhs) const {
return Quaternion(w+rhs.w,x+rhs.x,y+rhs.y,z+rhs.z);
}
! inline Quaternion operator- (const Quaternion& rhs) const {
return Quaternion(w-rhs.w,x-rhs.x,y-rhs.y,z-rhs.z);
}
#ifndef SWIG
! inline const Quaternion operator* (const double fScalar) const {
return Quaternion(fScalar*w,fScalar*x,fScalar*y,fScalar*z);
}
/**
* Compare two quaternions for equality.
*/
SIMDATA_EXPORT friend bool operator==(const Quaternion &a, const Quaternion &b);
/**
* Compare two quaternions for inequality.
*/
SIMDATA_EXPORT friend bool operator!=(const Quaternion &a, const Quaternion &b);
SIMDATA_EXPORT friend Quaternion operator*(double fScalar, Quaternion const& rkQ);
! // Multiplication of a Quaternion and with a Vector, yielding a quaternion.
SIMDATA_EXPORT friend Quaternion operator*(Quaternion const& q, Vector3 const& v);
SIMDATA_EXPORT friend Quaternion operator*(Vector3 const& v, Quaternion const& q);
! SIMDATA_EXPORT friend std::ostream& operator<< (std::ostream& os, Quaternion const& m);
! Quaternion operator* (const Quaternion& rkQ) const;
#endif // SWIG
! Quaternion operator- () const;
! Quaternion operator~ (void) const { return Quaternion(w, -x, -y, -z);}
// functions of a Quaternion
! double Dot (const Quaternion& rkQ) const; // dot product
! double Norm () const; // squared-length
double Magnitude(void) const;
Vector3 GetVector(void);
double GetScalar(void);
Quaternion Bar() const;
Quaternion Inverse() const; // apply to non-zero Quaternion
Quaternion UnitInverse() const; // apply to unit-length Quaternion
Quaternion Exp() const;
Quaternion Log() const;
! // Use QVRotate instead.
! // rotation of a vector by a Quaternion
! // Vector3 operator* (const Vector3& rkVector) const;
! // spherical linear interpolation
static Quaternion Slerp(double fT, const Quaternion& rkP, const Quaternion& rkQ);
static Quaternion SlerpExtraSpins(double fT,
const Quaternion& rkP,
--- 89,306 ----
// conversion between Quaternions, matrices, and angle-axes
!
! /**
! * Convert from a rotation matrix.
! */
! void FromRotationMatrix(const Matrix3& kRot);
!
! /**
! * Convert to a rotation matrix.
! */
! void ToRotationMatrix(Matrix3& kRot) const;
!
! /**
! * Convert from a rotation specified by an axis and angle.
! */
! void FromAngleAxis(const double& rfAngle, const Vector3& rkAxis);
!
! /**
! * Convert to a rotation specified by an axis and angle.
! */
! void ToAngleAxis(double& rfAngle, Vector3& rkAxis) const;
!
! /**
! * Convert from a rotation matrix specified by three axes.
! */
! void FromAxes(const Vector3* akAxis);
!
! /**
! * Convert to a rotation matrix specified by three axes.
! */
! void ToAxes(Vector3* akAxis) const;
// arithmetic operations
#ifndef SWIG
+ /**
+ * In-place addition.
+ */
Quaternion & operator+=(const Quaternion & q);
+
+ /**
+ * In place division by a scalar.
+ */
Quaternion & operator/=(double s);
!
! /**
! * Copy operator.
! */
! Quaternion& operator=(const Quaternion& rkQ);
#endif // SWIG
! /**
! * Add two quaternions.
! */
! inline Quaternion operator+(const Quaternion& rhs) const {
return Quaternion(w+rhs.w,x+rhs.x,y+rhs.y,z+rhs.z);
}
! /**
! * Subtract two quaternions.
! */
! inline Quaternion operator-(const Quaternion& rhs) const {
return Quaternion(w-rhs.w,x-rhs.x,y-rhs.y,z-rhs.z);
}
#ifndef SWIG
! /**
! * Multiply by a scalar.
! */
! inline const Quaternion operator*(const double fScalar) const {
return Quaternion(fScalar*w,fScalar*x,fScalar*y,fScalar*z);
}
+
/**
* Compare two quaternions for equality.
*/
SIMDATA_EXPORT friend bool operator==(const Quaternion &a, const Quaternion &b);
+
/**
* Compare two quaternions for inequality.
*/
SIMDATA_EXPORT friend bool operator!=(const Quaternion &a, const Quaternion &b);
+
+ /**
+ * Multiplication of a Quaternion and with a Scalar, yielding a quaternion.
+ */
SIMDATA_EXPORT friend Quaternion operator*(double fScalar, Quaternion const& rkQ);
!
! /**
! * Multiplication of a Quaternion and with a Vector, yielding a quaternion.
! */
SIMDATA_EXPORT friend Quaternion operator*(Quaternion const& q, Vector3 const& v);
+
+ /**
+ * Multiplication of a Vector with a Quaternion, yielding a quaternion.
+ */
SIMDATA_EXPORT friend Quaternion operator*(Vector3 const& v, Quaternion const& q);
!
! /**
! * Stream output of a quaternion.
! */
! SIMDATA_EXPORT friend std::ostream& operator<<(std::ostream& os, Quaternion const& m);
!
! /**
! * Multply by a quaternion.
! */
! Quaternion operator*(const Quaternion& rkQ) const;
#endif // SWIG
! /**
! * get (-w, -x, -y, -z).
! */
! Quaternion operator-() const;
!
! /**
! * get the conjugate (w, -x, -y, -z).
! */
! Quaternion operator~(void) const { return Quaternion(w, -x, -y, -z);}
// functions of a Quaternion
!
! /**
! * get the dot product with another quaternion.
! */
! double Dot(const Quaternion& rkQ) const; // dot product
!
! /**
! * get the squared length (magnitude squared).
! */
! double Norm() const;
!
! /**
! * get the length (4-vector modulus).
! */
double Magnitude(void) const;
+
+ /**
+ * get the vector component of the quaternion (x, y, z).
+ */
Vector3 GetVector(void);
+
+ /**
+ * get the scalar component of the quaternion (w).
+ */
double GetScalar(void);
+ /**
+ * get the conjugate (w, -x, -y, -z).
+ */
Quaternion Bar() const;
+
+ /**
+ * get the inverse a a quaternion.
+ *
+ * This is the same as Bar() and ~() for normalized quaternions.
+ */
Quaternion Inverse() const; // apply to non-zero Quaternion
+
Quaternion UnitInverse() const; // apply to unit-length Quaternion
+
+ /**
+ * Compute the exponential.
+ *
+ * If q = A*(x*i+y*j+z*k) where (x,y,z) is unit length, then
+ * exp(q) = cos(A)+sin(A)*(x*i+y*j+z*k). If sin(A) is near zero,
+ * we use exp(q) = cos(A)+A*(x*i+y*j+z*k) since A/sin(A) has a
+ * limit of 1.
+ */
Quaternion Exp() const;
+
+ /**
+ * Compute the logarithm.
+ *
+ * If q = cos(A)+sin(A)*(x*i+y*j+z*k) where (x,y,z) is unit length,
+ * then log(q) = A*(x*i+y*j+z*k). If sin(A) is near zero, we use
+ * log(q) = sin(A)*(x*i+y*j+z*k) since sin(A)/A has a limit of 1.
+ */
Quaternion Log() const;
! /**
! * rotate a vector.
! *
! * NOTE: assumes the quaternion has unit length.
! */
! Vector3 GetRotated(Vector3 const &) const;
! /**
! * anti-rotate a vector.
! *
! * NOTE: assumes the quaternion has unit length.
! */
! Vector3 GetInverseRotated(Vector3 const &) const;
!
! /**
! * rotate a vector in place.
! *
! * NOTE: assumes the quaternion has unit length.
! */
! void Rotate(Vector3 &) const;
!
! /**
! * anti-rotate a vector in place.
! *
! * NOTE: assumes the quaternion has unit length.
! */
! void InverseRotate(Vector3 &) const;
!
! /*
! * spherical linear interpolation
! */
static Quaternion Slerp(double fT, const Quaternion& rkP, const Quaternion& rkQ);
+ /**
+ *
+ */
static Quaternion SlerpExtraSpins(double fT,
const Quaternion& rkP,
***************
*** 148,152 ****
int iExtraSpins);
! // setup for spherical quadratic interpolation
static void Intermediate(const Quaternion& rkQ0,
const Quaternion& rkQ1,
--- 308,314 ----
int iExtraSpins);
! /**
! * setup for spherical quadratic interpolation.
! */
static void Intermediate(const Quaternion& rkQ0,
const Quaternion& rkQ1,
***************
*** 155,159 ****
Quaternion& rkB);
! // spherical quadratic interpolation
static Quaternion Squad(double fT,
const Quaternion& rkP,
--- 317,323 ----
Quaternion& rkB);
! /**
! * spherical quadratic interpolation
! */
static Quaternion Squad(double fT,
const Quaternion& rkP,
***************
*** 163,175 ****
--- 327,352 ----
// special values
+
static const Quaternion ZERO;
static const Quaternion IDENTITY;
+ /**
+ * Convert a quaternion to Euler angles.
+ */
static Vector3 MakeEulerAnglesFromQ(Quaternion const &q);
+
+ /**
+ * Construct a new quaternion from Euler angles.
+ */
static Quaternion MakeQFromEulerAngles(double x, double y, double z);
+ /**
+ * String representation.
+ */
std::string asString() const;
+
// explicit operators for Python
+
#ifdef SWIG
%extend {
***************
*** 186,191 ****
! SIMDATA_EXPORT Vector3 QVRotate(Quaternion const& q, Vector3 const& v);
! Quaternion QRotate(Quaternion const& q1, Quaternion const& q2);
--- 363,487 ----
! //SIMDATA_EXPORT Vector3 QVRotate(Quaternion const& q, Vector3 const& v);
! //Quaternion QRotate(Quaternion const& q1, Quaternion const& q2);
!
! //----------------------------------------------------------------------------
! // INLINE
! //
!
! inline Quaternion::Quaternion(double fW, double fX, double fY, double fZ)
! {
! w = fW;
! x = fX;
! y = fY;
! z = fZ;
! }
!
! inline Quaternion::Quaternion(const Quaternion& rkQ)
! {
! w = rkQ.w;
! x = rkQ.x;
! y = rkQ.y;
! z = rkQ.z;
! }
!
! inline Quaternion& Quaternion::operator=(const Quaternion& rkQ)
! {
! w = rkQ.w;
! x = rkQ.x;
! y = rkQ.y;
! z = rkQ.z;
! return *this;
! }
!
!
! inline Quaternion Quaternion::operator-() const
! {
! return Quaternion(-w,-x,-y,-z);
! }
!
!
! inline double Quaternion::Dot(const Quaternion& rkQ) const
! {
! return w*rkQ.w+x*rkQ.x+y*rkQ.y+z*rkQ.z;
! }
!
!
! inline double Quaternion::Norm() const
! {
! return w*w+x*x+y*y+z*z;
! }
!
!
! inline Quaternion Quaternion::UnitInverse() const //checked (delta)
! {
! // assert: 'this' is unit length
! return Quaternion(w,-x,-y,-z);
! }
!
!
! inline double Quaternion::Magnitude(void) const
! {
! return sqrt(w*w + x*x + y*y + z*z);
! }
!
! /*
! inline Vector3 Quaternion::GetRotated(Vector3 const &v) const
! {
! Quaternion t = (*this*v)*Bar();
! return t.GetVector();
! }
! */
!
! inline Vector3 Quaternion::GetInverseRotated(Vector3 const &v) const
! {
! Quaternion t = (Bar()*v)*(*this);
! return t.GetVector();
! }
!
! inline void Quaternion::Rotate(Vector3 &v) const
! {
! v = GetRotated(v);
! }
!
! inline void Quaternion::InverseRotate(Vector3 &v) const
! {
! v = GetInverseRotated(v);
! }
!
! /**
! * Use a quaternion to rotate a vector.
! *
! * Given a vector u = (x0,y0,z0) and a unit length Quaternion
! * q = <w,x,y,z>, the vector v = (x1,y1,z1) which represents the
! * rotation of u by q is v = q*u*q^{-1} where * indicates Quaternion
! * multiplication and where u is treated as the Quaternion <0,x0,y0,z0>.
! * Note that q^{-1} = <w,-x,-y,-z>, so no double work is required to
! * invert q.
! */
! inline Vector3 QVRotate(Quaternion const& q, Vector3 const& v)
! {
! return q.GetRotated(v);
! }
!
! inline Quaternion Quaternion::Bar() const
! {
! return Quaternion(w,-x,-y,-z);
! }
!
! inline Quaternion QRotate(Quaternion const& q1, Quaternion const& q2)
! {
! return q1*q2*(~q1);
! }
!
! inline Vector3 Quaternion::GetVector(void)
! {
! return Vector3(x, y, z);
! }
!
! inline double Quaternion::GetScalar(void)
! {
! return w;
! }
Index: cSimData.i
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/cSimData.i,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** cSimData.i 27 Mar 2003 10:37:06 -0000 1.6
--- cSimData.i 18 Apr 2003 11:51:28 -0000 1.7
***************
*** 26,29 ****
--- 26,30 ----
#include <SimData/Types.h>
#include <SimData/DataArchive.h>
+ #include <SimData/DataManager.h>
#include <SimData/InterfaceRegistry.h>
#include <SimData/Version.h>
***************
*** 74,77 ****
--- 75,79 ----
%include "SimData/DataArchive.i"
+ %include "SimData/DataManager.i"
%include "SimData/InterfaceRegistry.i"
%exception;
|