]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AICarrier.cxx
Remove unused variables
[flightgear.git] / src / AIModel / AICarrier.cxx
index 0ec684609330c0ac19211bcacc7e62e6b9aa493a..1a9a1d2b72dc51fddfadfd4ed221ca26b474a3c7 100644 (file)
@@ -71,6 +71,7 @@ public:
         != mSolidObjects.end()) {
       mFoundHot = true;
       mUserData = FGAICarrierHardware::newSolid(mCarrier);
+      //SG_LOG(SG_GENERAL, SG_ALERT, "AICarrierVisitor::apply() solidObject" );
     }
     node.setUserData(mUserData.get());
 
@@ -271,7 +272,7 @@ void FGAICarrier::update(double dt) {
     // For the flols reuse some computations done above ...
 
     // The position of the eyepoint - at least near that ...
-    SGVec3d eyePos(globals->get_current_view()->get_absolute_view_pos());
+    SGVec3d eyePos(globals->get_current_view()->get_view_pos());
     // Add the position offset of the AIModel to gain the earth
     // centered position
     SGVec3d eyeWrtCarrier = eyePos - cartPos;
@@ -309,24 +310,10 @@ void FGAICarrier::update(double dt) {
       source = 0;
 } //end update
 
-bool FGAICarrier::init() {
-    if (!FGAIShip::init())
+bool FGAICarrier::init(bool search_in_AI_path) {
+    if (!FGAIShip::init(search_in_AI_path))
         return false;
 
-    // process the 3d model here
-    // mark some objects solid, mark the wires ...
-
-    // The model should be used for altitude computations.
-    // To avoid that every detail in a carrier 3D model will end into
-    // the aircraft local cache, only set the HOT traversal bit on
-    // selected objects.
-    osg::Node* sel = aip.getSceneGraph();
-    // Clear the HOT traversal flag
-    // Selectively set that flag again for wires/cats/solid objects.
-    // Attach a pointer to this carrier class to those objects.
-    FGCarrierVisitor carrierVisitor(this, wire_objects, catapult_objects, solid_objects);
-    sel->accept(carrierVisitor);
-
     _longitude_node = fgGetNode("/position/longitude-deg", true);
     _latitude_node = fgGetNode("/position/latitude-deg", true);
     _altitude_node = fgGetNode("/position/altitude-ft", true);
@@ -357,6 +344,27 @@ bool FGAICarrier::init() {
     return true;
 }
 
+void FGAICarrier::initModel(osg::Node *node)
+{
+    // SG_LOG(SG_GENERAL, SG_BULK, "AICarrier::initModel()" );
+    FGAIShip::initModel(node);
+    // process the 3d model here
+    // mark some objects solid, mark the wires ...
+
+    // The model should be used for altitude computations.
+    // To avoid that every detail in a carrier 3D model will end into
+    // the aircraft local cache, only set the HOT traversal bit on
+    // selected objects.
+
+    // Clear the HOT traversal flag
+    // Selectively set that flag again for wires/cats/solid objects.
+    // Attach a pointer to this carrier class to those objects.
+    // SG_LOG(SG_GENERAL, SG_BULK, "AICarrier::initModel() visit" );
+    FGCarrierVisitor carrierVisitor(this, wire_objects, catapult_objects, solid_objects);
+    model->accept(carrierVisitor);
+//    model->setNodeMask(node->getNodeMask() & SG_NODEMASK_TERRAIN_BIT | model->getNodeMask());
+}
+
 void FGAICarrier::bind() {
     FGAIShip::bind();