Update of /cvsroot/csp/APPLICATIONS/CSPSim/Bin
In directory sc8-pr-cvs1:/tmp/cvs-serv7214/Bin
Modified Files:
CSPSim.py TestObjects.py
Log Message:
Index: CSPSim.py
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Bin/CSPSim.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** CSPSim.py 23 Jul 2003 01:48:22 -0000 1.8
--- CSPSim.py 23 Jul 2003 07:11:57 -0000 1.9
***************
*** 93,96 ****
--- 93,97 ----
def compileData(args):
+ datapath = CSP.getDataPath()
cachepath = CSP.getCachePath()
dar = os.path.join(cachepath, "sim.dar")
Index: TestObjects.py
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Bin/TestObjects.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TestObjects.py 22 Jul 2003 07:36:36 -0000 1.3
--- TestObjects.py 23 Jul 2003 07:11:57 -0000 1.4
***************
*** 19,33 ****
import SimData
def create(app):
v = SimData.Vector3
m = SimData.LLA()
vehicle = app.createVehicle
vehicle("sim:vehicles.aircraft.f16", v(10, 10, 1000.2), v(0, 100.0, 0), v(2.0, 2.0, 140.0))
# 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))
-
# m.setDegrees(37.5, -121.0, 600)
--- 19,58 ----
import SimData
+ ##
+ # Create some test vehicles and other objects. The first vehicle created
+ # will be the initial active object.
+ #
+ # The create() method checks the terrain name (set in XML) and dispatches
+ # the appropriate object creation routine. This is a temporary hack until
+ # the theater code is developed to the point that objects are generated
+ # automatically via a campaign engine.
+
def create(app):
+ terrain = app.getTerrainName()
+ if terrain == "Balkan Terrain":
+ createBalkan(app)
+ elif terrain == "NCA Terrain":
+ createNCA(app)
+
+ def createBalkan(app):
v = SimData.Vector3
m = SimData.LLA()
vehicle = app.createVehicle
+ vehicle("sim:vehicles.aircraft.m2k", v(-29000, -13000, 88.5), v(0, 1.0, 0), v(5.0, 0.0, 0.0))
+ vehicle("sim:vehicles.aircraft.m2k", v(-29000, -13000, 1000), v(0, 100.0, 0), v(5.0, 0.0, 0.0))
+
+ def createNCA(app):
+ v = SimData.Vector3
+ m = SimData.LLA()
+ vehicle = app.createVehicle
+ vehicle("sim:vehicles.aircraft.m2k", v(0, 0, 1200.0), v(0, 100.0, 0), v(5.0, 0.0, 0.0))
vehicle("sim:vehicles.aircraft.f16", v(10, 10, 1000.2), v(0, 100.0, 0), v(2.0, 2.0, 140.0))
+
+
# 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))
# m.setDegrees(37.5, -121.0, 600)
|