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: <sv...@ww...> - 2004-05-10 04:35:50
|
Author: delta Date: 2004-05-02 07:39:04 -0700 (Sun, 02 May 2004) New Revision: 936 Modified: trunk/CSP/CSPSim/CHANGES.current Log: Updated vcproj. Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-05-02 14:37:20 UTC (rev 935) +++ trunk/CSP/CSPSim/CHANGES.current 2004-05-02 14:39:04 UTC (rev 936) @@ -1,6 +1,11 @@ Version 0.4.0 (in progress) =========================== - +2004-05-02: delta + * Corrected a PYTHONPATH instead of PYTHON_PATH in the debug + vs project file. + + * Minor others changes. + 2004-04-25: delta * Added CSPSim/Data/Fonts. |
|
From: <sv...@ww...> - 2004-05-10 04:34:56
|
Author: delta
Date: 2004-05-02 07:29:47 -0700 (Sun, 02 May 2004)
New Revision: 933
Modified:
trunk/CSP/CSPSim/Source/Exception.cpp
Log:
Cleaned up #include.
Modified: trunk/CSP/CSPSim/Source/Exception.cpp
===================================================================
--- trunk/CSP/CSPSim/Source/Exception.cpp 2004-05-02 14:27:22 UTC (rev 932)
+++ trunk/CSP/CSPSim/Source/Exception.cpp 2004-05-02 14:29:47 UTC (rev 933)
@@ -21,18 +21,13 @@
* @file Exception.cpp
*
**/
-
-
-#include "Exception.h"
-#include "Log.h"
-
#include <cstdio>
#include <iostream>
#include "DemeterException.h"
-#include <SimData/ExceptionBase.h>
+#include "Exception.h"
+#include "Log.h"
-
namespace csp {
void FatalException(Exception &e, std::string const &location) {
|
|
From: <sv...@ww...> - 2004-05-10 04:34:51
|
Author: delta
Date: 2004-05-02 07:27:22 -0700 (Sun, 02 May 2004)
New Revision: 932
Modified:
trunk/CSP/CSPSim/Include/Exception.h
Log:
Moved #include "DemeterException.h" to Exception.cpp.
Modified: trunk/CSP/CSPSim/Include/Exception.h
===================================================================
--- trunk/CSP/CSPSim/Include/Exception.h 2004-04-26 20:35:41 UTC (rev 931)
+++ trunk/CSP/CSPSim/Include/Exception.h 2004-05-02 14:27:22 UTC (rev 932)
@@ -25,11 +25,11 @@
#ifndef __CSP_EXCEPTION_H__
#define __CSP_EXCEPTION_H__
-
#include <SimData/ExceptionBase.h>
-#include "DemeterException.h"
+class DemeterException;
+
namespace csp {
/**
|
|
From: <sv...@ww...> - 2004-05-10 04:34:45
|
Author: delta
Date: 2004-04-26 13:35:41 -0700 (Mon, 26 Apr 2004)
New Revision: 931
Modified:
trunk/CSP/CSPSim/CHANGES.current
trunk/CSP/CSPSim/Source/VirtualScene.cpp
Log:
see CHANGES.current
Modified: trunk/CSP/CSPSim/CHANGES.current
===================================================================
--- trunk/CSP/CSPSim/CHANGES.current 2004-04-26 20:33:40 UTC (rev 930)
+++ trunk/CSP/CSPSim/CHANGES.current 2004-04-26 20:35:41 UTC (rev 931)
@@ -10,6 +10,8 @@
Building CSPSim now builds terrain lib dependencies.
* Adjusted paths in CSPSim project.
+
+ * Cleaned up VirtualScene.cpp.
2004-04-17: delta
* Minor fixes to get the build going under windows.
Modified: trunk/CSP/CSPSim/Source/VirtualScene.cpp
===================================================================
--- trunk/CSP/CSPSim/Source/VirtualScene.cpp 2004-04-26 20:33:40 UTC (rev 930)
+++ trunk/CSP/CSPSim/Source/VirtualScene.cpp 2004-04-26 20:35:41 UTC (rev 931)
@@ -48,9 +48,7 @@
#include <osgUtil/CullVisitor>
#include <osgUtil/DisplayListVisitor>
-//#include "Terrain.h"
-
// SHADOW is an *extremely* experimental feature. It is based on the
// osgShadow demo, and does (did) work to some extent, but only for a
// single localized object. A more robust approach needs to be taken
@@ -60,29 +58,9 @@
#include "shadow.h"
#endif
-extern int g_ScreenWidth;
-extern int g_ScreenHeight;
-
-
-extern osg::Node *makeBase( void );
extern osg::Node *makeTreesPatch( float xcen, float ycen, float spacing, float width,
float height, VirtualBattlefield * pBattlefield);
-// XXX these values are no longer used
-
-const float SKY_RED = 0.1f;
-const float SKY_GREEN = 0.1f;
-const float SKY_BLUE = 0.6f;
-const float SKY_ALPHA = 1.0f;
-
-// XXX these values are no longer used
-
-const float FOG_RED = 0.4f;
-const float FOG_GREEN = 0.4f;
-const float FOG_BLUE = 0.5f;
-const float FOG_ALPHA = 1.0f;
-
-
using simdata::Ref;
@@ -175,7 +153,7 @@
m_NearView = NULL;
m_ViewAngle = 60.0;
m_NearPlane = 2.0;
- m_Aspect = static_cast<float>(g_ScreenWidth)/g_ScreenHeight;
+ m_Aspect = static_cast<float>(CSPSim::theSim->getSDLScreen()->w)/CSPSim::theSim->getSDLScreen()->h;
m_ViewDistance = 30000.0;
m_SpinTheWorld = false;
m_ResetTheWorld = false;
@@ -190,8 +168,8 @@
{
CSP_LOG(APP, INFO, "VirtualScene::buildScene() ");
- int ScreenWidth = g_ScreenWidth;
- int ScreenHeight = g_ScreenHeight;
+ int ScreenWidth = CSPSim::theSim->getSDLScreen()->w;
+ int ScreenHeight = CSPSim::theSim->getSDLScreen()->h;
/////////////////////////////////////
//
@@ -213,7 +191,6 @@
m_FarView->setDefaults();
ds->setDepthBuffer(true);
m_FarView->setViewport(0, 0, ScreenWidth, ScreenHeight);
- m_FarView->setBackgroundColor(osg::Vec4(SKY_RED, SKY_GREEN, SKY_BLUE, SKY_ALPHA));
m_FarView->setComputeNearFarMode(osgUtil::CullVisitor::DO_NOT_COMPUTE_NEAR_FAR);
m_FarView->getCullVisitor()->setImpostorsActive(true);
// override default HEADLIGHT mode, we provide our own lights.
@@ -306,17 +283,6 @@
osg::Fog* fog = new osg::Fog;
fog->setMode(osg::Fog::LINEAR);
fog->setDensity(0.3f);
- osg::Vec4 fogColor;
- fogColor[0] = FOG_RED;
- fogColor[1] = FOG_GREEN;
- fogColor[2] = FOG_BLUE;
- fogColor[3] = FOG_ALPHA;
- m_FogEnabled = true;
- m_FogStart = 20000.0;
- m_FogEnd = 40000.0;
- fog->setColor(fogColor);
- fog->setStart(m_FogStart);
- fog->setEnd(m_FogEnd);
if (m_FogEnabled) {
pFogState->setAttributeAndModes(fog, osg::StateAttribute::ON);
} else {
@@ -336,12 +302,6 @@
m_NearGroup->addChild(m_NearObjectGroup.get());
m_NearView->setSceneData(m_NearGroup.get());
m_NearView->setFrameStamp(m_FrameStamp.get());
-#ifdef CSP_OSG_094
- m_NearView->setCamera(m_FarView->getCamera());
-#else
- //m_NearView->setProjectionMatrix(m_FarView->getProjectionMatrix());
- //m_NearView->setViewMatrix(m_FarView->getViewMatrix());
-#endif
m_NearView->getRenderStage()->setClearMask(GL_DEPTH_BUFFER_BIT);
//FIXME: why ALL_OPTIMIZATIONS don t work as expected?
@@ -390,12 +350,7 @@
osgUtil::CullVisitor * CullVisitor;
-#ifdef CSP_OSG_094
- osg::Camera * camera = m_FarView->getCamera();
- camera->setPerspective(m_ViewAngle, 1.0, 2.0f, m_ViewDistance);
-#else
m_FarView->setProjectionMatrixAsPerspective(m_ViewAngle, m_Aspect, m_NearPlane, m_ViewDistance);
-#endif
CullVisitor = m_FarView->getCullVisitor();
CullVisitor->setComputeNearFarMode(osgUtil::CullVisitor::COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES);
CullVisitor->setCullingMode(osgUtil::CullVisitor::ENABLE_ALL_CULLING);
@@ -405,11 +360,7 @@
m_FarView->draw();
if (m_NearObjectGroup->getNumChildren() > 0) {
-#ifdef CSP_OSG_094
- camera->setPerspective(m_ViewAngle, 1.0, 0.01f, 100.0);
-#else
m_NearView->setProjectionMatrixAsPerspective(m_ViewAngle, m_Aspect, 0.01f, 100.0);
-#endif
CullVisitor = m_NearView->getCullVisitor();
CullVisitor->setComputeNearFarMode(osgUtil::CullVisitor::COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES);
CullVisitor->setCullingMode(osgUtil::CullVisitor::ENABLE_ALL_CULLING);
@@ -471,14 +422,9 @@
assert(m_FarView.valid());
m_Origin = eyePos;
osg::Vec3 _up (upVec.x(), upVec.y(), upVec.z() );
-#ifdef CSP_OSG_094
- osg::Camera * camera = m_FarView->getCamera();
- camera->setLookAt(osg::Vec3(0.0, 0.0, 0.0), simdata::toOSG(lookPos - eyePos), _up);
- camera->ensureOrthogonalUpVector();
-#else
+
m_FarView->setViewMatrixAsLookAt(osg::Vec3(0.0, 0.0, 0.0), simdata::toOSG(lookPos - eyePos), _up);
m_NearView->setViewMatrixAsLookAt(osg::Vec3(0.0, 0.0, 0.0), simdata::toOSG(lookPos - eyePos), _up);
-#endif
m_GlobalFrame->setPosition(simdata::toOSG(-eyePos));
@@ -493,15 +439,6 @@
m_TerrainGroup->setPosition(simdata::toOSG(tpos));
}
-#ifdef CSP_OSG_094
- CSP_LOG(APP, DEBUG,
- "VirtualScene::setLookAt - eye: " << camera->getEyePoint()
- << ", look: " << camera->getCenterPoint()
- << ", up: " << camera->getUpVector()
- << ", near: " << camera->zNear()
- << ", far: " << camera->zFar()
- );
-#else
// FIXME this shouldn't run in debug builds
osg::Vec3 _camEyePos;
osg::Vec3 _camLookPos;
@@ -512,8 +449,6 @@
<< ", look: " << _camLookPos
<< ", up: " << _camUpVec
);
-#endif
-
}
// TODO externalize a couple fixed parameters
@@ -547,25 +482,9 @@
m_Sky->updateHorizon(m_FogColor, eyePos.z(), m_ViewDistance);
}
-#ifdef CSP_OSG_094
void VirtualScene::getLookAt(simdata::Vector3 & eyePos, simdata::Vector3 & lookPos, simdata::Vector3 & upVec) const
{
assert(m_FarView.valid());
- osg::Camera const * camera = m_FarView->getCamera();
-
- osg::Vec3 _eye = camera->getEyePoint();
- eyePos = simdata::Vector3(_eye.x(), _eye.y(),_eye.z());
- osg::Vec3 _center = camera->getCenterPoint();
- lookPos = simdata::Vector3(_center.x(), _center.y(),_center.z());
- osg::Vec3 _up = camera->getUpVector();
- upVec = simdata::Vector3(_up.x(), _up.y(),_up.z());
-
- CSP_LOG(APP, DEBUG, "VirtualScene::getLookAt - eye: " << eyePos << ", look: " << lookPos << ", up: " << upVec);
-}
-#else
-void VirtualScene::getLookAt(simdata::Vector3 & eyePos, simdata::Vector3 & lookPos, simdata::Vector3 & upVec) const
-{
- assert(m_FarView.valid());
osg::Vec3 _eye;
osg::Vec3 _center;
osg::Vec3 _up;
@@ -576,7 +495,6 @@
CSP_LOG(APP, DEBUG, "VirtualScene::getLookAt - eye: " << eyePos << ", look: " << lookPos << ", up: " << upVec);
}
-#endif
void VirtualScene::addParticleSystem(osg::Node *system, osg::Node *program) {
|
|
From: <sv...@ww...> - 2004-05-10 04:34:24
|
Author: delta Date: 2004-04-26 13:33:40 -0700 (Mon, 26 Apr 2004) New Revision: 930 Modified: trunk/CSP/CSPChunkLod/include/osgChunkLod/ChunkLod Log: By default NV & Cg support are disabled. Modified: trunk/CSP/CSPChunkLod/include/osgChunkLod/ChunkLod =================================================================== --- trunk/CSP/CSPChunkLod/include/osgChunkLod/ChunkLod 2004-04-25 16:28:48 UTC (rev 929) +++ trunk/CSP/CSPChunkLod/include/osgChunkLod/ChunkLod 2004-04-26 20:33:40 UTC (rev 930) @@ -54,7 +54,7 @@ #include <osgChunkLod/MultiTextureDetails> //#define USE_CG -#define USE_NV +//#define USE_NV #ifdef USE_CG #include <osgNVCg/Context> |
|
From: <sv...@ww...> - 2004-05-10 04:33:28
|
Author: delta
Date: 2004-04-25 03:06:30 -0700 (Sun, 25 Apr 2004)
New Revision: 928
Modified:
trunk/CSP/SimData/CHANGES.current
Log:
Removed MSVCSimData
Modified: trunk/CSP/SimData/CHANGES.current
===================================================================
--- trunk/CSP/SimData/CHANGES.current 2004-04-25 10:00:31 UTC (rev 927)
+++ trunk/CSP/SimData/CHANGES.current 2004-04-25 10:06:30 UTC (rev 928)
@@ -1,5 +1,8 @@
Version 0.4.0 (in progress)
===========================
+2004-04-25: delta
+ * Removed obsolete SimDataMSVC folder.
+
2004-04-17: wolverine
* made changes to Vector3, Quad and Matrix3 to write data
to binary buffers that are used to serialize and deserialize
|
|
From: <sv...@ww...> - 2004-05-10 04:31:39
|
Author: delta Date: 2004-04-25 03:00:31 -0700 (Sun, 25 Apr 2004) New Revision: 927 Modified: trunk/CSP/CSPSim/Tools/Terrain/dem2dat/Makefile Log: Changed python path from python2.2 to python2.3 Modified: trunk/CSP/CSPSim/Tools/Terrain/dem2dat/Makefile =================================================================== --- trunk/CSP/CSPSim/Tools/Terrain/dem2dat/Makefile 2004-04-25 09:50:50 UTC (rev 926) +++ trunk/CSP/CSPSim/Tools/Terrain/dem2dat/Makefile 2004-04-25 10:00:31 UTC (rev 927) @@ -1,5 +1,5 @@ -PYTHONLIB = /usr/lib/python2.2/site-packages -PYTHONINC = /usr/include/python2.2 +PYTHONLIB = /usr/lib/python2.3/site-packages +PYTHONINC = /usr/include/python2.3 CXX = g++ CXXFLAGS = -O2 -g -W -Wall |
|
From: <sv...@vi...> - 2004-05-10 04:23:47
|
Author: delta Date: 2004-04-25 02:50:50 -0700 (Sun, 25 Apr 2004) New Revision: 926 Removed: trunk/CSP/SimData/SimDataMSVC/ Log: Importation initiale |
|
From: <de...@us...> - 2004-04-17 19:59:21
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4282 Modified Files: CHANGES.current Log Message: no message Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** CHANGES.current 17 Apr 2004 19:07:29 -0000 1.90 --- CHANGES.current 17 Apr 2004 19:59:04 -0000 1.91 *************** *** 2,15 **** =========================== 2004-04-17: wolverine ! * Added initial networking functionality, This includes new files in the Source/Networking subdirectory and changes to some current file. ! * made some changes in NetworkSocket.cpp to be more compatible with windows. 2004-04-17: delta ! * Changes COLOR to COLOR0 to enforce arbvp1 compatibility in nvMorph.cg. --- 2,18 ---- =========================== + 2004-04-17: delta + * Minor fixes to get the build going under windows. + 2004-04-17: wolverine ! * Added initial networking functionality. This includes new files in the Source/Networking subdirectory and changes to some current file. ! * Made some changes in NetworkSocket.cpp to be more compatible with windows. 2004-04-17: delta ! * Changed COLOR to COLOR0 to enforce arbvp1 compatibility in nvMorph.cg. |
|
From: <de...@us...> - 2004-04-17 19:51:23
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/VisualStudio/CSPSimDLL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2288 Modified Files: CSPSimDLL.vcproj Log Message: see CHANGES.current Index: CSPSimDLL.vcproj =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** CSPSimDLL.vcproj 17 Apr 2004 07:51:44 -0000 1.20 --- CSPSimDLL.vcproj 17 Apr 2004 19:51:13 -0000 1.21 *************** *** 45,49 **** Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" ! AdditionalDependencies="osgProducerd.lib OpenThreadsWin32d.lib osgChunkLodd.lib osgFXd.lib sigc-1.2d.lib producerd.lib opengl32.lib SDL.lib osgDBd.lib DemeterVisualC6d.lib osgTextd.lib osgUtild.lib osgParticled.lib osgd.lib _cSimData.lib" OutputFile="../../Bin/_cCSP.dll" LinkIncremental="2" --- 45,49 ---- Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" ! AdditionalDependencies="ws2_32.lib OpenThreadsWin32d.lib osgChunkLodd.lib osgFXd.lib sigc-1.2d.lib producerd.lib opengl32.lib SDL.lib osgDBd.lib DemeterVisualC6d.lib osgTextd.lib osgUtild.lib osgParticled.lib osgd.lib _cSimData.lib" OutputFile="../../Bin/_cCSP.dll" LinkIncremental="2" *************** *** 122,126 **** Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" ! AdditionalDependencies="osgFX.lib osgChunkLod.lib producer.lib osgText.lib DemeterVisualC6.lib opengl32.lib SDL.lib _cSimData.lib osgParticle.lib osgUtil.lib osgDB.lib osg.lib sigc-1.2.lib OpenThreadsWin32.lib" OutputFile="../../Bin/_cCSP.dll" LinkIncremental="1" --- 122,126 ---- Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" ! AdditionalDependencies="ws2_32.lib osgFX.lib osgChunkLod.lib producer.lib osgText.lib DemeterVisualC6.lib opengl32.lib SDL.lib _cSimData.lib osgParticle.lib osgUtil.lib osgDB.lib osg.lib sigc-1.2.lib OpenThreadsWin32.lib" OutputFile="../../Bin/_cCSP.dll" LinkIncremental="1" *************** *** 209,222 **** <File RelativePath="..\..\Source\ChunkLodTerrain.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool"/> - </FileConfiguration> </File> <File --- 209,212 ---- *************** *** 424,427 **** --- 414,442 ---- </File> </Filter> + <Filter + Name="Networking" + Filter=""> + <File + RelativePath="..\..\Source\Networking\NetworkBroadcaster.cpp"> + </File> + <File + RelativePath="..\..\Source\Networking\NetworkListener.cpp"> + </File> + <File + RelativePath="..\..\Source\Networking\NetworkMessage.cpp"> + </File> + <File + RelativePath="..\..\Source\Networking\NetworkMessenger.cpp"> + </File> + <File + RelativePath="..\..\Source\Networking\NetworkNode.cpp"> + </File> + <File + RelativePath="..\..\Source\Networking\NetworkSocket.cpp"> + </File> + <File + RelativePath="..\..\Source\Networking\ObjectUpdateMessage.cpp"> + </File> + </Filter> </Filter> <Filter *************** *** 540,543 **** --- 555,561 ---- </File> <File + RelativePath="..\..\Include\Networking.h"> + </File> + <File RelativePath="..\..\Include\NumericalMethod.h"> </File> |
|
From: <de...@us...> - 2004-04-17 19:41:48
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source/Networking In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32632 Modified Files: NetworkSocket.cpp Log Message: see CHANGES.current Index: NetworkSocket.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Networking/NetworkSocket.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NetworkSocket.cpp 17 Apr 2004 19:25:25 -0000 1.3 --- NetworkSocket.cpp 17 Apr 2004 19:41:40 -0000 1.4 *************** *** 22,25 **** --- 22,29 ---- * @author Scott Flicker (Wolverine) */ + #if _MSC_VER + #include <WinSock2.h> + #endif + #include "Networking.h" *************** *** 35,44 **** m_servaddr->sin_port = htons( port ); addrptr->s_addr = inet_addr( node->getNetworkName() ); - } int NetworkSocket::sendto(NetworkMessage * message) { ! printf("Sending Network Packet\n"); ! return ::sendto(m_sockfd, (const void *)message->getBufferPtr(), message->getBufferLen(), 0, (const struct sockaddr *)m_servaddr, sizeof(sockaddr_in)); } --- 39,51 ---- m_servaddr->sin_port = htons( port ); addrptr->s_addr = inet_addr( node->getNetworkName() ); } int NetworkSocket::sendto(NetworkMessage * message) { ! printf("Sending Network Packet\n"); ! #ifdef _MSC_VER ! return ::sendto(m_sockfd, (const char *)message->getBufferPtr(), message->getBufferLen(), 0, (const struct sockaddr *)m_servaddr, sizeof(sockaddr_in)); ! #else ! return ::sendto(m_sockfd, (const void *)message->getBufferPtr(), message->getBufferLen(), 0, (const struct sockaddr *)m_servaddr, sizeof(sockaddr_in)); ! #endif } |
|
From: <de...@us...> - 2004-04-17 19:41:14
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32565 Modified Files: Networking.h Log Message: see CHANGES.current Index: Networking.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/Networking.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Networking.h 17 Apr 2004 17:19:19 -0000 1.1 --- Networking.h 17 Apr 2004 19:41:05 -0000 1.2 *************** *** 31,38 **** #include <assert.h> #include <errno.h> - #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <arpa/inet.h> #include <SimData/Vector3.h> --- 31,41 ---- #include <assert.h> #include <errno.h> #include <sys/types.h> + + #ifndef _MSC_VER + #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> + #endif #include <SimData/Vector3.h> |
|
From: <wol...@us...> - 2004-04-17 19:25:34
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source/Networking In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29587 Modified Files: NetworkSocket.cpp Log Message: see changes Index: NetworkSocket.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Networking/NetworkSocket.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NetworkSocket.cpp 17 Apr 2004 19:04:33 -0000 1.2 --- NetworkSocket.cpp 17 Apr 2004 19:25:25 -0000 1.3 *************** *** 34,38 **** m_servaddr->sin_family = AF_INET; m_servaddr->sin_port = htons( port ); ! inet_aton( node->getNetworkName(), addrptr); } --- 34,38 ---- m_servaddr->sin_family = AF_INET; m_servaddr->sin_port = htons( port ); ! addrptr->s_addr = inet_addr( node->getNetworkName() ); } |
|
From: <wol...@us...> - 2004-04-17 19:07:56
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26901 Modified Files: CHANGES.current Log Message: new changes added. Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** CHANGES.current 17 Apr 2004 17:21:04 -0000 1.89 --- CHANGES.current 17 Apr 2004 19:07:29 -0000 1.90 *************** *** 7,10 **** --- 7,13 ---- file. + * made some changes in NetworkSocket.cpp to be more compatible with + windows. + 2004-04-17: delta * Changes COLOR to COLOR0 to enforce arbvp1 compatibility in |
|
From: <wol...@us...> - 2004-04-17 19:04:42
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source/Networking In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26507 Modified Files: NetworkSocket.cpp Log Message: Made changes to be compatible with windows Index: NetworkSocket.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Networking/NetworkSocket.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NetworkSocket.cpp 17 Apr 2004 17:14:35 -0000 1.1 --- NetworkSocket.cpp 17 Apr 2004 19:04:33 -0000 1.2 *************** *** 28,37 **** m_sockfd = socket(AF_INET, SOCK_DGRAM, 0); m_servaddr = new sockaddr_in; printf("Opening socket to %s on port %d\n", node->getNetworkName(), port); ! bzero( m_servaddr, sizeof (struct sockaddr_in)); m_servaddr->sin_family = AF_INET; m_servaddr->sin_port = htons( port ); ! inet_pton(AF_INET, node->getNetworkName(), (void*)&m_servaddr->sin_addr); } --- 28,38 ---- m_sockfd = socket(AF_INET, SOCK_DGRAM, 0); m_servaddr = new sockaddr_in; + struct in_addr * addrptr = &m_servaddr->sin_addr; printf("Opening socket to %s on port %d\n", node->getNetworkName(), port); ! memset( m_servaddr, 0, sizeof (struct sockaddr_in)); m_servaddr->sin_family = AF_INET; m_servaddr->sin_port = htons( port ); ! inet_aton( node->getNetworkName(), addrptr); } |
|
From: <wol...@us...> - 2004-04-17 17:33:12
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11640/Source Modified Files: Matrix3.cpp Quat.cpp Vector3.cpp Log Message: Changes to serialize and deserialize to binary buffers to use for network packets. Index: Matrix3.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Matrix3.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Matrix3.cpp 19 Oct 2003 23:53:56 -0000 1.10 --- Matrix3.cpp 17 Apr 2004 17:33:02 -0000 1.11 *************** *** 343,346 **** --- 343,386 ---- } + int Matrix3::readBinary(const unsigned char * ptrBuf, int size) + { + if (size != 9*sizeof(double)) + { + printf("Matrix3::readBinary - buffer is incorrect size\n"); + return 0; + } + memcpy((void*)&_mat[0][0], (void*)ptrBuf, sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)&_mat[0][1], (void*)ptrBuf, sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)&_mat[0][2], (void*)ptrBuf, sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)&_mat[1][0], (void*)ptrBuf, sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)&_mat[1][1], (void*)ptrBuf, sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)&_mat[1][2], (void*)ptrBuf, sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)&_mat[2][0], (void*)ptrBuf, sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)&_mat[2][1], (void*)ptrBuf, sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)&_mat[2][2], (void*)ptrBuf, sizeof(double)); ptrBuf += sizeof(double); + return 9*sizeof(double); + + } + int Matrix3::writeBinary(unsigned char * ptrBuf, int size) + { + if (size != 9*sizeof(double)) + { + printf("Matrix3::writeBinary - buffer is incorrect size\n"); + return 0; + } + + memcpy((void*)ptrBuf, (void*)&_mat[0][0], sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)ptrBuf, (void*)&_mat[0][1], sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)ptrBuf, (void*)&_mat[0][2], sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)ptrBuf, (void*)&_mat[1][0], sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)ptrBuf, (void*)&_mat[1][1], sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)ptrBuf, (void*)&_mat[1][2], sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)ptrBuf, (void*)&_mat[2][0], sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)ptrBuf, (void*)&_mat[2][1], sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)ptrBuf, (void*)&_mat[2][2], sizeof(double)); ptrBuf += sizeof(double); + return 9*sizeof(double); + } + + std::ostream& operator<< (std::ostream& os, const Matrix3& m) { Index: Quat.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Quat.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Quat.cpp 19 Oct 2003 23:53:57 -0000 1.4 --- Quat.cpp 17 Apr 2004 17:33:03 -0000 1.5 *************** *** 353,356 **** --- 353,383 ---- } + int Quat::readBinary(const unsigned char * ptrBuf, int size) + { + if (size != sizeof(Quat)) + { + printf("Trying to read a binary Quat with the wrong size\n"); + return 0; + } + memcpy((void*)&_x, (void*)ptrBuf, sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)&_y, (void*)ptrBuf, sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)&_z, (void*)ptrBuf, sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)&_w, (void*)ptrBuf, sizeof(double)); ptrBuf += sizeof(double); + return 4*sizeof(double); + } + + int Quat::writeBinary(unsigned char * ptrBuf, int size) + { + if (size != sizeof(Quat)) + { + printf("Trying to write a binary Quat with the wrong size\n"); + return 0; + } + memcpy((void*)ptrBuf, (void*)&_x, sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)ptrBuf, (void*)&_y, sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)ptrBuf, (void*)&_z, sizeof(double)); ptrBuf += sizeof(double); + memcpy((void*)ptrBuf, (void*)&_w, sizeof(double)); ptrBuf += sizeof(double); + return 4*sizeof(double); + } NAMESPACE_SIMDATA_END Index: Vector3.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Vector3.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Vector3.cpp 19 Oct 2003 23:53:57 -0000 1.9 --- Vector3.cpp 17 Apr 2004 17:33:03 -0000 1.10 *************** *** 84,87 **** --- 84,139 ---- } + /** + * Copy a vector into a binary buffer + */ + int Vector3::readBinary(const unsigned char * data, int size) { + + if (size != sizeof(Vector3)) + { + fprintf(stderr, "Illegal mem copy operation attempted\n"); + return 0; + } + + double dvalue; + printf("Vector3::readBinary() - loading double values binary into Vector3\n"); + memcpy((void*)&dvalue, (void*)data, sizeof(double)); data += sizeof(double); + printf("Vector3::readBinary() dvalue: %f\n", dvalue); + _x = dvalue; + memcpy((void*)&dvalue, (void*)data, sizeof(double)); data += sizeof(double); + printf("Vector3::readBinary() dvalue: %f\n", dvalue); + _y = dvalue; + memcpy((void*)&dvalue, (void*)data, sizeof(double)); + printf("Vector3::readBinary() dvalue: %f\n", dvalue); + _z = dvalue; + printf("Vector3::readBinary() - finished loading double values for Vector3\n"); + + return 3*sizeof(double); + } + + /** + * Copy a binary buffer into a vector. + */ + int Vector3::writeBinary(unsigned char * data, int size) { + + if (size != sizeof(Vector3)) + { + fprintf(stderr, "Illegal mem copy operation attempted\n"); + return 0; + } + + printf("Vector3::writeBinary() - loading Vector3 into binary buffer.\n"); + memcpy( (void*)data, (void*)&_x, sizeof(double)); data += sizeof(double); + printf("Vector3::writeBinary() - _x: %f\n", _x); + memcpy( (void*)data, (void*)&_y, sizeof(double)); data += sizeof(double); + printf("Vector3::writeBinary() - _y: %f\n", _y); + memcpy( (void*)data, (void*)&_z, sizeof(double)); + printf("Vector3::writeBinary() - _z: %f\n", _z); + printf("Vector3::writeBinary() - finished loading Vector3 values into binary buffer.\n"); + + return 3*sizeof(double); + + } + + NAMESPACE_SIMDATA_END |
|
From: <wol...@us...> - 2004-04-17 17:33:11
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11640/Include/SimData Modified Files: Matrix3.h Quat.h Vector3.h Log Message: Changes to serialize and deserialize to binary buffers to use for network packets. Index: Matrix3.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Matrix3.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Matrix3.h 19 Oct 2003 23:53:56 -0000 1.15 --- Matrix3.h 17 Apr 2004 17:33:02 -0000 1.16 *************** *** 587,590 **** --- 587,594 ---- #endif // SWIG + virtual int readBinary(const unsigned char *, int size); + virtual int writeBinary(unsigned char *, int size); + + protected: /** The matrix elements */ Index: Quat.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Quat.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Quat.h 19 Oct 2003 23:53:56 -0000 1.9 --- Quat.h 17 Apr 2004 17:33:02 -0000 1.10 *************** *** 457,460 **** --- 457,464 ---- #endif // SWIG + virtual int readBinary(const unsigned char *, int size); + virtual int writeBinary(unsigned char *, int size); + + }; // end of class prototype Index: Vector3.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Vector3.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Vector3.h 25 Oct 2003 00:25:00 -0000 1.18 --- Vector3.h 17 Apr 2004 17:33:02 -0000 1.19 *************** *** 330,333 **** --- 330,336 ---- virtual void parseXML(const char*); + virtual int readBinary(const unsigned char *, int size); + virtual int writeBinary(unsigned char *, int size); + #ifdef SWIG // setup accessors for x, y, and z (ugly hack) *************** *** 362,365 **** --- 365,369 ---- inline Vector3 operator * (double lhs, const Vector3 &rhs) { return rhs*lhs; } + NAMESPACE_SIMDATA_END // simdata |
|
From: <wol...@us...> - 2004-04-17 17:33:11
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11640 Modified Files: CHANGES.current Log Message: Changes to serialize and deserialize to binary buffers to use for network packets. Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** CHANGES.current 31 Mar 2004 15:53:31 -0000 1.103 --- CHANGES.current 17 Apr 2004 17:33:02 -0000 1.104 *************** *** 1,4 **** --- 1,9 ---- Version 0.4.0 (in progress) =========================== + 2004-04-17: wolverine + * made changes to Vector3, Quad and Matrix3 to write data + to binary buffers that are used to serialize and deserialize + the object for network packets. + 2004-03-31: delta * Namespace & SIMDATA_EXPORT symbol hacks cleaned in |
|
From: <wol...@us...> - 2004-04-17 17:28:43
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Tools/HID/Maps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10391 Added Files: WingManExtreme.map Log Message: new map for WingManExtreme joystick --- NEW FILE: WingManExtreme.map --- # hid event identifier definitions for the joystick. # primary buttons define WingManExtreme:FireA 1 define WingManExtreme:FireB 2 define WingManExtreme:FireC 7 define WingManExtreme:FireD 4 # additional buttons define WingManExtreme:Pinkie 6 define WingManExtreme:Launch 3 # coolie hat define WingManExtreme:Mouse 5 define WingManExtreme:Mouse_Up 22 define WingManExtreme:Mouse_Right 23 define WingManExtreme:Mouse_Down 24 define WingManExtreme:Mouse_Left 25 # axes define WingManExtreme:Stick_X 0 define WingManExtreme:Stick_Y 1 define WingManExtreme:Rudder 2 define WingManExtreme:Throttle 3 |
|
From: <wol...@us...> - 2004-04-17 17:23:28
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9292 Modified Files: Makefile.in Log Message: Added new subdirectories for Networking and Views Index: Makefile.in =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Makefile.in,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Makefile.in 3 Apr 2004 23:49:50 -0000 1.22 --- Makefile.in 17 Apr 2004 17:23:07 -0000 1.23 *************** *** 3,7 **** BIN = $(TOPDIR)/Bin ! SUBDIRS = Theater DEMETER_PREFIX = $(TOPDIR)/$(DEMETER_RELATIVE) --- 3,7 ---- BIN = $(TOPDIR)/Bin ! SUBDIRS = Theater Networking Views DEMETER_PREFIX = $(TOPDIR)/$(DEMETER_RELATIVE) *************** *** 58,61 **** --- 58,68 ---- MenuScreen.cpp \ Message.cpp \ + Networking/NetworkNode.cpp \ + Networking/NetworkMessage.cpp \ + Networking/ObjectUpdateMessage.cpp \ + Networking/NetworkMessenger.cpp \ + Networking/NetworkBroadcaster.cpp \ + Networking/NetworkListener.cpp \ + Networking/NetworkSocket.cpp \ NumericalMethod.cpp \ ObjectModel.cpp \ *************** *** 102,106 **** DEPFILES = $(addprefix $(DEPDIR)/,$(addsuffix .d, $(SOURCES))) $(DEPDIR)/cCSP.i.swigdep DEPFILTER = ! DEPS_MAGIC := $(shell mkdir $(DEPDIR) $(DEPDIR)/Theater $(DEPDIR)/Systems > /dev/null 2>&1 || :) .PHONY: clean-deps clean all default --- 109,113 ---- DEPFILES = $(addprefix $(DEPDIR)/,$(addsuffix .d, $(SOURCES))) $(DEPDIR)/cCSP.i.swigdep DEPFILTER = ! DEPS_MAGIC := $(shell mkdir $(DEPDIR) $(DEPDIR)/Theater $(DEPDIR)/Systems $(DEPDIR)/Networking $(DEPDIR)/Views > /dev/null 2>&1 || :) .PHONY: clean-deps clean all default |
|
From: <wol...@us...> - 2004-04-17 17:22:21
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9139 Modified Files: CSPSim.cpp DynamicObject.cpp Log Message: changes for networking Index: CSPSim.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/CSPSim.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** CSPSim.cpp 3 Apr 2004 22:15:21 -0000 1.42 --- CSPSim.cpp 17 Apr 2004 17:22:11 -0000 1.43 *************** *** 49,52 **** --- 49,53 ---- #include "ConsoleCommands.h" #include "Profile.h" + #include "Networking.h" #include <SimData/Types.h> *************** *** 113,120 **** --- 114,128 ---- CSPSim::CSPSim() { + if (theSim == 0) { theSim = this; } + int level = g_Config.getInt("Debug", "LoggingLevel", 0, true); + csplog().setLogLevels(CSP_ALL, level); + csplog().setOutput("CSPSim.log"); + + CSP_LOG(APP, INFO, "Constructing CSPSim Object..."); + m_Clean = true; *************** *** 139,146 **** m_Shell = new PyShell(); - int level = g_Config.getInt("Debug", "LoggingLevel", 0, true); - csplog().setLogLevels(CSP_ALL, level); - csplog().setOutput("CSPSim.log"); } --- 147,153 ---- m_Shell = new PyShell(); + + m_NetworkBroadcaster = NULL; } *************** *** 156,164 **** void CSPSim::setActiveObject(simdata::Ref<DynamicObject> object) { ! /* CSP_LOG(APP, INFO, "CSPSim::setActiveObject - objectID: " << object->getObjectID() << ", ObjectType: " << object->getObjectType() << ", Position: " << object->getGlobalPosition()); ! */ if (m_ActiveObject.valid()) { --- 163,173 ---- void CSPSim::setActiveObject(simdata::Ref<DynamicObject> object) { ! /* CSP_LOG(APP, INFO, "CSPSim::setActiveObject - objectID: " << object->getObjectID() << ", ObjectType: " << object->getObjectType() << ", Position: " << object->getGlobalPosition()); ! */ ! ! CSP_LOG(APP, INFO, "CSPSim::setActiveObject()"); if (m_ActiveObject.valid()) { *************** *** 402,405 **** --- 411,417 ---- m_GameScreen = new GameScreen; m_GameScreen->onInit(); + + // create the networking layer + m_NetworkBroadcaster = new NetworkBroadcaster; #if 0 *************** *** 494,498 **** try { date.parseXML(date_string.c_str()); ! } catch (...) { std::cerr << "Invalid starting date in INI file (Testing:Date).\n" << std::endl; --- 506,510 ---- try { date.parseXML(date_string.c_str()); ! } catch (...) { std::cerr << "Invalid starting date in INI file (Testing:Date).\n" << std::endl; *************** *** 558,562 **** PROF1(_screen_render, 60); } ! // Swap OpenGL buffers #ifndef __CSPSIM_EXE__ --- 570,577 ---- PROF1(_screen_render, 60); } ! ! ! ! // Swap OpenGL buffers #ifndef __CSPSIM_EXE__ *************** *** 661,664 **** --- 676,680 ---- } if (!handled && m_Interface.valid()) { + CSP_LOG(APP, DEBUG, "CSPSim::doInput()-Calling m_Interface->onEvent()"); handled = m_Interface->onEvent(event); } *************** *** 680,684 **** CSP_LOG(APP, DEBUG, "CSPSim::updateObjects..."); ! if (m_Battlefield.valid()) { m_Battlefield->onUpdate(dt); } --- 696,700 ---- CSP_LOG(APP, DEBUG, "CSPSim::updateObjects..."); ! if (m_Battlefield.valid()) { m_Battlefield->onUpdate(dt); } *************** *** 686,689 **** --- 702,724 ---- m_Scene->onUpdate(dt); } + + // call networking layer. + // TODO the code below tests the networking section. Later it probably needs to + // be moved elsewhere. Currently commenting out so we can move to subversion. + // CSP_LOG(APP, DEBUG, "CSPSim::run... beginning network updates"); + + // simdata::Ref<DynamicObject> dynamicObject = (simdata::Ref<DynamicObject>)m_ActiveObject; + // NetworkMessage * message = dynamicObject->getUpdateMessage(); + + // m_NetworkBroadcaster->sendMessage(1, message ); + + // dynamicObject->putUpdateMessage( message ); + + // CSP_LOG(APP, DEBUG, "CSPSim::run... finished network updates"); + + // this may not be necessary. especially if a memory pool of messages objects is used. + // delete message; + + } Index: DynamicObject.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/DynamicObject.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** DynamicObject.cpp 20 Oct 2003 00:23:23 -0000 1.19 --- DynamicObject.cpp 17 Apr 2004 17:22:12 -0000 1.20 *************** *** 384,392 **** } ! void DynamicObject::updateScene(simdata::Vector3 const &origin) { if (m_SceneModel.valid()) { ! m_SceneModel->setPositionAttitude(b_GlobalPosition->value() - origin, b_Attitude->value()); onRender(); } } --- 384,484 ---- } ! void DynamicObject::updateScene(simdata::Vector3 const &origin) { if (m_SceneModel.valid()) { ! m_SceneModel->setPositionAttitude(b_GlobalPosition->value() - origin, b_Attitude->value()); onRender(); } } + + NetworkMessage * DynamicObject::getUpdateMessage() + { + unsigned short messageType = 2; + unsigned short payloadLen = sizeof(int) + sizeof(double) + 3*sizeof(simdata::Vector3) + + sizeof(simdata::Quat) /* + sizeof(simdata::Matrix3) + sizeof(double) */; + + NetworkMessage * message = new NetworkMessage(); + message->initialize( messageType, payloadLen); + + unsigned char * ptrBuf = (unsigned char*)message->getPayloadPtr(); + + printf("Generating network update message for object id: %d\n", m_ID); + memcpy((void*)ptrBuf, (void*)&m_ID, sizeof(unsigned int)); ptrBuf += sizeof(unsigned int); + + simdata::SimTime timeStamp = CSPSim::theSim->getElapsedTime(); + memcpy((void*)ptrBuf, (void*)&timeStamp, sizeof(simdata::SimTime)); ptrBuf += sizeof(simdata::SimTime); + + int bytescopied; + bytescopied = b_GlobalPosition->value().writeBinary(ptrBuf, sizeof(simdata::Vector3)); + ptrBuf += bytescopied; + + bytescopied = b_LinearVelocity->value().writeBinary(ptrBuf, sizeof(simdata::Vector3)); + ptrBuf += bytescopied; + + bytescopied = b_AngularVelocity->value().writeBinary(ptrBuf, sizeof(simdata::Vector3)); + ptrBuf += bytescopied; + + bytescopied = b_Attitude->value().writeBinary(ptrBuf, sizeof(simdata::Quat)); + ptrBuf += bytescopied; + + // bytescopied = b_Inertia->value().writeBinary(ptrBuf, sizeof(simdata::Quat)); + // ptrBuf += bytescopied; + + // memcpy((void*)ptrBuf, (void*)&b_Mass->value(), sizeof(double)); + // ptrBuf += bytescopied; + + + + return message; + } + + void DynamicObject::putUpdateMessage(NetworkMessage* message) + { + // read message + + unsigned char * ptrBuf = (unsigned char*)message->getPayloadPtr(); + + // skip object id + unsigned int idValue; + memcpy((void*)&idValue, (void*)ptrBuf, sizeof(unsigned int)); + ptrBuf += sizeof(unsigned int); + + // verify we have the correct id in the packet for this object. + if (m_ID == idValue) + { + printf("Loading update message of object %d\n", m_ID); + } + else + { + printf("Error loading update message, object id (%d) does not match\n", idValue); + } + + // get timestamp + simdata::SimTime timeStamp; + memcpy((void*)&timeStamp, (void*)ptrBuf, sizeof(simdata::SimTime)); ptrBuf += sizeof(simdata::SimTime); + + int bytescopied; + bytescopied = b_GlobalPosition->value().readBinary(ptrBuf, sizeof(simdata::Vector3)); + ptrBuf += bytescopied; + bytescopied = b_LinearVelocity->value().readBinary(ptrBuf, sizeof(simdata::Vector3)); + ptrBuf += bytescopied; + bytescopied = b_AngularVelocity->value().readBinary(ptrBuf, sizeof(simdata::Vector3)); + ptrBuf += bytescopied; + bytescopied = b_Attitude->value().readBinary(ptrBuf, sizeof(simdata::Quat)); + ptrBuf += bytescopied; + // bytescopied = b_Inertia->value().readBinary(ptrBuf, sizeof(simdata::Matrix3)); + // ptrBuf += bytescopied; + + // double *pValue = &b_Mass->value(); + // memcpy((void*)&pValue, (void*)ptrBuf, sizeof(double)); + + //ptrBuf += sizeof(double); + + // return message to shared pool. + // NetworkMessagePool.putMessageObject(message); + // delete message; + } + + + + |
|
From: <wol...@us...> - 2004-04-17 17:21:13
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8956 Modified Files: CHANGES.current Log Message: additions to CHANGES Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** CHANGES.current 17 Apr 2004 08:08:11 -0000 1.88 --- CHANGES.current 17 Apr 2004 17:21:04 -0000 1.89 *************** *** 2,5 **** --- 2,10 ---- =========================== + 2004-04-17: wolverine + * Added initial networking functionality, This includes new files + in the Source/Networking subdirectory and changes to some current + file. + 2004-04-17: delta * Changes COLOR to COLOR0 to enforce arbvp1 compatibility in |
|
From: <wol...@us...> - 2004-04-17 17:19:28
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8579 Modified Files: CSPSim.h DynamicObject.h Added Files: Networking.h Log Message: Changes for networking --- NEW FILE: Networking.h --- // Combat Simulator Project - FlightSim Demo // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file Networking.h * */ #ifndef __NETWORKING_H__ #define __NETWORKING_H__ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <errno.h> #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <arpa/inet.h> #include <SimData/Vector3.h> class NetworkMessage { protected: unsigned char * m_Buf; unsigned char * m_PayloadBuf; unsigned short m_BufferLen; unsigned short m_MessageType; unsigned short m_PayloadLen; bool m_Initialized; static unsigned short magicNumber; static unsigned short m_HeaderLen; public: NetworkMessage(); virtual ~NetworkMessage(); bool initialize(unsigned short type, unsigned short payloadLength); unsigned short getType(); void * getBufferPtr(); void * getPayloadPtr(); unsigned short getBufferLen(); unsigned short getPayloadLen(); unsigned short getHeaderLen(); bool isInitialized(); bool isHeaderValid(); }; class NetworkMessagePool { }; class ObjectUpdateMessage : public NetworkMessage { public: ObjectUpdateMessage(unsigned int id, simdata::Vector3 position, simdata::Vector3 velocity); }; class NetworkNode { public: NetworkNode(); char * getNetworkName(); }; class NetworkSocket { int m_sockfd; struct sockaddr_in * m_servaddr; public: NetworkSocket(NetworkNode * node, short port); int sendto(NetworkMessage * message); }; class NetworkMessenger { NetworkMessenger(); }; class NetworkBroadcaster { short m_server_port; NetworkNode * m_node; NetworkSocket * m_socket; public: NetworkBroadcaster(); void sendMessage( int NodeID, NetworkMessage * message); }; class NetworkListener { public: NetworkListener(); void receiveAvailableMessages(); }; #endif Index: CSPSim.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/CSPSim.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** CSPSim.h 20 Oct 2003 00:23:22 -0000 1.17 --- CSPSim.h 17 Apr 2004 17:19:19 -0000 1.18 *************** *** 60,63 **** --- 60,64 ---- class EventMapIndex; class PyConsole; + class NetworkBroadcaster; *************** *** 88,92 **** simdata::SimDate & getCurrentTime() { return m_CurrentTime; } simdata::SimTime const & getFrameRate() const{ return m_FrameRate; } ! void setActiveObject(simdata::Ref<DynamicObject> object); simdata::Ref<DynamicObject> getActiveObject() const; --- 89,94 ---- simdata::SimDate & getCurrentTime() { return m_CurrentTime; } simdata::SimTime const & getFrameRate() const{ return m_FrameRate; } ! simdata::SimTime const & getElapsedTime() const { return m_ElapsedTime; } ! void setActiveObject(simdata::Ref<DynamicObject> object); simdata::Ref<DynamicObject> getActiveObject() const; *************** *** 175,178 **** --- 177,185 ---- osg::ref_ptr<PyConsole> m_Console; simdata::Ref<PyShell> m_Shell; + + /** + * The network layer + */ + NetworkBroadcaster * m_NetworkBroadcaster; #ifndef CSP_OSG_094 Index: DynamicObject.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/DynamicObject.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** DynamicObject.h 20 Oct 2003 00:23:22 -0000 1.13 --- DynamicObject.h 17 Apr 2004 17:19:19 -0000 1.14 *************** *** 2,16 **** // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net ! // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. ! // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. ! // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software --- 2,16 ---- // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net ! // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. ! // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. ! // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software *************** *** 35,38 **** --- 35,40 ---- #include "SystemsModel.h" + #include "Networking.h" + namespace osgParticle { *************** *** 98,101 **** --- 100,105 ---- void setVehicleCore(SystemsModel::Ref); + + protected: void setAir(bool flag) { setFlags(F_AIR, flag); } *************** *** 176,179 **** --- 180,185 ---- virtual void setDataRecorder(DataRecorder *recorder); + virtual NetworkMessage * getUpdateMessage(); + virtual void putUpdateMessage(NetworkMessage* message); protected: |
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source/Networking In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7546 Added Files: NetworkBroadcaster.cpp NetworkListener.cpp NetworkMessage.cpp NetworkMessenger.cpp NetworkNode.cpp NetworkSocket.cpp ObjectUpdateMessage.cpp Log Message: new networking files. --- NEW FILE: NetworkBroadcaster.cpp --- // Combat Simulator Project - FlightSim Demo // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file NetworkBroadcaster.cpp: * @author Scott Flicker (Wolverine) * * Broadcasts network messages */ #include "Networking.h" NetworkBroadcaster::NetworkBroadcaster() { m_server_port = 2874; m_node = new NetworkNode();; m_socket = new NetworkSocket(m_node, m_server_port); } void NetworkBroadcaster::sendMessage( int NodeID, NetworkMessage * message) { m_socket->sendto( message ); } --- NEW FILE: NetworkListener.cpp --- // Combat Simulator Project - FlightSim Demo // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file NetworkListener.cpp: * @author Scott Flicker (Wolverine) * * Listens for network messages */ #include "Networking.h" NetworkListener::NetworkListener() { } void NetworkListener::receiveAvailableMessages() { } --- NEW FILE: NetworkMessage.cpp --- // Combat Simulator Project - FlightSim Demo // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file NetworkMessage.cpp: * @author Scott Flicker (Wolverine) * * Base class for Network Messages. * Currently contains for header and buffer routines */ #include "Networking.h" unsigned short NetworkMessage::magicNumber = 0xFCCF; unsigned short NetworkMessage::m_HeaderLen = 6; /** * NetworkMessage() * * create an empty NetworkMessage Object. * to use this class the object should be first created then initialized with * a specific type and payloadLen. Once it has been initialized it can then be * loaded with message specific data by first uptaining the payload ptr then setting * bytes within it to the proper values. Note also once a message object has * been initialized it should be free to be used multiple times. */ NetworkMessage::NetworkMessage() { m_Buf = NULL; m_PayloadBuf = NULL; m_BufferLen = 0; m_PayloadLen = 0; m_MessageType = 0; m_Initialized = false; } /** * ~NetworkMessage * * Deletes a network message including removing the memory allocated for the buffer. */ NetworkMessage::~NetworkMessage() { if (m_Initialized) delete [] m_Buf; } /** * initialize() * * This method initializes a NetworkMessage, Including allocating a buffer to * hold the message header and payload and also setting up the header. */ bool NetworkMessage::initialize( unsigned short type, unsigned short payloadLen) { // return false if this has already been initialized. if (m_Initialized) return false; m_PayloadLen = payloadLen; m_MessageType = type; m_BufferLen = m_HeaderLen + m_PayloadLen; m_Buf = new unsigned char[m_BufferLen]; m_PayloadBuf = m_Buf + m_HeaderLen; // write the header; unsigned char * ptrBuf = m_Buf; memcpy((void*)ptrBuf , (void*)&magicNumber, sizeof(unsigned short)); ptrBuf += sizeof(unsigned short); memcpy((void*)ptrBuf , (void*)&m_BufferLen, sizeof(unsigned short)); ptrBuf += sizeof(unsigned short); memcpy((void*)ptrBuf , (void*)&m_MessageType , sizeof(unsigned short) ); ptrBuf += sizeof(unsigned short); // write zeros to the payload section of the buffer. memset(m_PayloadBuf, 0x00, m_PayloadLen); m_Initialized = true; return true; } /** * getBufferLen() * * Returns the number of bytes as a short that the message * buffer uses including the header and payload. */ unsigned short NetworkMessage::getBufferLen() { return m_BufferLen; } /** * getBufferPtr() * * Returns the buffer pointer so functions can copy binary * data into the underlying buffer. */ void * NetworkMessage::getBufferPtr() { return m_Buf; } /** * getPayloadPtr() * Returns the payload pointer so functions can copy and read * binary data from the undering payload section of the message. */ void * NetworkMessage::getPayloadPtr() { return (void*)m_PayloadBuf; } /** * getType() * Returns the message type which is stored in the message header. */ unsigned short NetworkMessage::getType() { unsigned int type; memcpy((void*)&type , (void*)(m_Buf + 2), sizeof(unsigned short)); return type; } /** * isHeaderValid() * Determine if the header is valid by looking at the magic number. */ bool NetworkMessage::isHeaderValid() { unsigned short magicNumber = 0xFCCF; unsigned short number; memcpy((void*)&number , (void*)&m_Buf, sizeof(unsigned short)); return (number == magicNumber); } /** * getHeaderLen() * returns the number of bytes as a short that the header occupies. */ unsigned short NetworkMessage::getHeaderLen() { return m_HeaderLen; } /** * getPayloadLen() * returns the number of bytes as a short that the payload occupies. */ unsigned short NetworkMessage::getPayloadLen() { return m_PayloadLen; } --- NEW FILE: NetworkMessenger.cpp --- // Combat Simulator Project - FlightSim Demo // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file NetworkMessenger.cpp: * @author Scott Flicker (Wolverine) */ #include "Networking.h" NetworkMessenger::NetworkMessenger() { } --- NEW FILE: NetworkNode.cpp --- // Combat Simulator Project - FlightSim Demo // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file NetworkNode.cpp: * @author Scott Flicker (Wolverine) * * This class encapsulates a node in the simulation network. */ #include "Networking.h" NetworkNode::NetworkNode() { } char * NetworkNode::getNetworkName() { //FIXME this needs to be not hardcoded. return "192.168.2.3"; } --- NEW FILE: NetworkSocket.cpp --- // Combat Simulator Project - FlightSim Demo // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file NetworkSocket.cpp: * @author Scott Flicker (Wolverine) */ #include "Networking.h" NetworkSocket::NetworkSocket(NetworkNode * node, short port) { m_sockfd = socket(AF_INET, SOCK_DGRAM, 0); m_servaddr = new sockaddr_in; printf("Opening socket to %s on port %d\n", node->getNetworkName(), port); bzero( m_servaddr, sizeof (struct sockaddr_in)); m_servaddr->sin_family = AF_INET; m_servaddr->sin_port = htons( port ); inet_pton(AF_INET, node->getNetworkName(), (void*)&m_servaddr->sin_addr); } int NetworkSocket::sendto(NetworkMessage * message) { printf("Sending Network Packet\n"); return ::sendto(m_sockfd, (const void *)message->getBufferPtr(), message->getBufferLen(), 0, (const struct sockaddr *)m_servaddr, sizeof(sockaddr_in)); } --- NEW FILE: ObjectUpdateMessage.cpp --- // Combat Simulator Project - FlightSim Demo // Copyright (C) 2004 The Combat Simulator Project // http://csp.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** * @file ObjectUpdateMessage.cpp * @author Scott Flicker (Wolverine) */ #include "Networking.h" ObjectUpdateMessage::ObjectUpdateMessage(unsigned int id, simdata::Vector3 position, simdata::Vector3 velocity) { // reserve space to hold 6 doubles. double num; short magicNumber = 0xFCCF; m_BufferLen = 3*sizeof(short) + sizeof(unsigned int) + 6 * sizeof(double); m_Buf = new unsigned char [ m_BufferLen ]; m_MessageType = 2; unsigned char * ptrBuf = m_Buf; memcpy((void*)ptrBuf, (void*)&magicNumber, sizeof(short)); ptrBuf += sizeof(short); memcpy((void*)ptrBuf, (void*)&m_BufferLen, sizeof(short)); ptrBuf += sizeof(short); memcpy((void*)ptrBuf, (void*)&m_MessageType, sizeof(short)); ptrBuf += sizeof(short); memcpy((void*)ptrBuf, (void*)&id, sizeof(unsigned int)); ptrBuf += sizeof(unsigned int); num = position.x(); memcpy((void*)ptrBuf, (void*)&num, sizeof(double)); ptrBuf += sizeof(double); num = position.y(); memcpy((void*)ptrBuf, (void*)&num, sizeof(double)); ptrBuf += sizeof(double); num = position.z(); memcpy((void*)ptrBuf, (void*)&num, sizeof(double)); ptrBuf += sizeof(double); num = velocity.z(); memcpy((void*)ptrBuf, (void*)&num, sizeof(double)); ptrBuf += sizeof(double); num = velocity.y(); memcpy((void*)ptrBuf, (void*)&num, sizeof(double)); ptrBuf += sizeof(double); num = velocity.z(); memcpy((void*)ptrBuf, (void*)&num, sizeof(double)); } |
|
From: <wol...@us...> - 2004-04-17 17:12:47
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source/Networking In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/Networking Log Message: Directory /cvsroot/csp/APPLICATIONS/CSPSim/Source/Networking added to the repository |