X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAIModel%2FAIMultiplayer.cxx;h=ab9cc5c3cf8915a8c1320908fb7eafe034adf908;hb=47a7952f893dcb3d0b1372907cac375fedf81703;hp=40de4253c662b63104482fe458f63b2b8149229e;hpb=4cc30842565e25bd50e27477626c731a9de93b9a;p=flightgear.git diff --git a/src/AIModel/AIMultiplayer.cxx b/src/AIModel/AIMultiplayer.cxx index 40de4253c..ab9cc5c3c 100755 --- a/src/AIModel/AIMultiplayer.cxx +++ b/src/AIModel/AIMultiplayer.cxx @@ -29,6 +29,8 @@ #include "AIMultiplayer.hxx" +#include + // #define SG_DEBUG SG_ALERT FGAIMultiplayer::FGAIMultiplayer() : FGAIBase(otMultiplayer) { @@ -37,6 +39,9 @@ FGAIMultiplayer::FGAIMultiplayer() : FGAIBase(otMultiplayer) { mTimeOffsetSet = false; mAllowExtrapolation = true; mLagAdjustSystemSpeed = 10; + + aip.getSceneGraph()->setNodeMask(~SG_NODEMASK_TERRAIN_BIT); + } @@ -97,7 +102,7 @@ void FGAIMultiplayer::unbind() { void FGAIMultiplayer::update(double dt) { - using namespace simgear::props; + using namespace simgear; if (dt <= 0) return; @@ -202,19 +207,19 @@ void FGAIMultiplayer::update(double dt) { //cout << "Found " << pIt->second->getPath() << ":"; switch ((*firstPropIt)->type) { - case INT: - case BOOL: - case LONG: + case props::INT: + case props::BOOL: + case props::LONG: pIt->second->setIntValue((*firstPropIt)->int_value); //cout << "Int: " << (*firstPropIt)->int_value << "\n"; break; - case FLOAT: - case DOUBLE: + case props::FLOAT: + case props::DOUBLE: pIt->second->setFloatValue((*firstPropIt)->float_value); //cout << "Flo: " << (*firstPropIt)->float_value << "\n"; break; - case STRING: - case UNSPECIFIED: + case props::STRING: + case props::UNSPECIFIED: pIt->second->setStringValue((*firstPropIt)->string_value); //cout << "Str: " << (*firstPropIt)->string_value << "\n"; break; @@ -276,23 +281,23 @@ void FGAIMultiplayer::update(double dt) int ival; float val; switch ((*prevPropIt)->type) { - case INT: - case BOOL: - case LONG: + case props::INT: + case props::BOOL: + case props::LONG: ival = (int) (0.5+(1-tau)*((double) (*prevPropIt)->int_value) + tau*((double) (*nextPropIt)->int_value)); pIt->second->setIntValue(ival); //cout << "Int: " << ival << "\n"; break; - case FLOAT: - case DOUBLE: + case props::FLOAT: + case props::DOUBLE: val = (1-tau)*(*prevPropIt)->float_value + tau*(*nextPropIt)->float_value; //cout << "Flo: " << val << "\n"; pIt->second->setFloatValue(val); break; - case STRING: - case UNSPECIFIED: + case props::STRING: + case props::UNSPECIFIED: //cout << "Str: " << (*nextPropIt)->string_value << "\n"; pIt->second->setStringValue((*nextPropIt)->string_value); break; @@ -389,19 +394,19 @@ void FGAIMultiplayer::update(double dt) if (pIt != mPropertyMap.end()) { switch ((*firstPropIt)->type) { - case INT: - case BOOL: - case LONG: + case props::INT: + case props::BOOL: + case props::LONG: pIt->second->setIntValue((*firstPropIt)->int_value); //cout << "Int: " << (*firstPropIt)->int_value << "\n"; break; - case FLOAT: - case DOUBLE: + case props::FLOAT: + case props::DOUBLE: pIt->second->setFloatValue((*firstPropIt)->float_value); //cout << "Flo: " << (*firstPropIt)->float_value << "\n"; break; - case STRING: - case UNSPECIFIED: + case props::STRING: + case props::UNSPECIFIED: pIt->second->setStringValue((*firstPropIt)->string_value); //cout << "Str: " << (*firstPropIt)->string_value << "\n"; break;