Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/installNoSource.nsi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
;setup names
!define PROGRAMNAME "Bridge Command 5.10"
!ifndef OUTPUTFILE
!define OUTPUTFILE "..\BridgeCommand5.10.3-alpha.1.exe"
!define OUTPUTFILE "..\BridgeCommand5.10.3-alpha.3.exe"
!endif
!define INSTALLLOCATION "Bridge Command 5.10"
!define SMFOLDER "Bridge Command 5.10"
Expand Down
4 changes: 2 additions & 2 deletions src/Constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const irr::f32 DEG_IN_RAD = 180.0 / PI;
const irr::f32 RAD_PER_S_IN_DEG_PER_MINUTE = 180.0/PI * 60 ;

//general definitions
const std::string LONGNAME = "Bridge Command 5.10.3-alpha.1";
const std::string LONGNAME = "Bridge Command 5.10.3-alpha.3";
const std::string VERSION = "5.10";
const std::string LONGVERSION = "5.10.3-alpha.1";
const std::string LONGVERSION = "5.10.3-alpha.3";
#endif
14 changes: 8 additions & 6 deletions src/Line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,14 @@ void Line::setEnd(irr::scene::ISceneNode* lineEnd, irr::f32 shipMass, int nodeTy
}

//Check we have a non-null start and end, and if so, set nominal length to the distance between them
if (lineStart && lineEnd && lineStart->getParent()) {
if (lineStart && lineEnd) {

// Find distance between start and end
lineStart->getParent()->updateAbsolutePosition();
if (lineStart->getParent()) {
lineStart->getParent()->updateAbsolutePosition();
}
lineStart->updateAbsolutePosition();

// We don't check before if the lineEnd has a parent, as this isn't absolutely required
if (lineEnd->getParent()) {
lineEnd->getParent()->updateAbsolutePosition();
}
Expand Down Expand Up @@ -313,13 +314,14 @@ void Line::update(irr::f32 deltaTime) // Calculate the force and torque acting o
localForceVector = irr::core::vector3df(0.0, 0.0, 0.0);
localTorqueVector = irr::core::vector3df(0.0, 0.0, 0.0);

if (lineStart && lineEnd && lineStart->getParent()) {
if (lineStart && lineEnd) {

// Find distance between start and end
lineStart->getParent()->updateAbsolutePosition();
if (lineStart->getParent()) {
lineStart->getParent()->updateAbsolutePosition();
}
lineStart->updateAbsolutePosition();

// We don't check before if the lineEnd has a parent, as this isn't absolutely required
if (lineEnd->getParent()) {
lineEnd->getParent()->updateAbsolutePosition();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Lines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class Lines
Lines();
virtual ~Lines();
void addLine(SimulationModel* model, bool networkLine = false); // Add a line, which will be undefined
void setLineStart(irr::scene::ISceneNode* lineStart, int nodeType, int id, bool networkLine = false, int lineID = -1); //Set the start point of the line (default is most recently added line)
void setLineEnd(irr::scene::ISceneNode* lineEnd, irr::f32 shipMass, int nodeType, int id, irr::f32 lengthFactor, bool networkLine = false, int lineID = -1); //Set the end point (default is the most recently added line)
void setLineStart(irr::scene::ISceneNode* lineStart, int nodeType, int id, bool networkLine, int lineID); //Set the start point of the line (-1 for lineID is most recently added line)
void setLineEnd(irr::scene::ISceneNode* lineEnd, irr::f32 shipMass, int nodeType, int id, irr::f32 lengthFactor, bool networkLine, int lineID); //Set the end point (-1 for lineID is the most recently added line)
void clearLine(int lineID, bool networkLine = false);
void removeLine(int lineID, bool networkLine = false);
void setSelectedLine(int lineID);
Expand Down
6 changes: 3 additions & 3 deletions src/MyEventReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2098,14 +2098,14 @@ void MyEventReceiver::handleMooringLines(irr::core::line3df rayForLines)
// If connecting to another ship, find the minimum mass to use as the nominal mass for estimating default line properties
nominalMass = fmin(model->getOtherShipMassEstimate(nodeID), nominalMass);
}
model->getLines()->setLineEnd(contactNode, nominalMass, nodeType, nodeID, 1.0);
model->getLines()->setLineEnd(contactNode, nominalMass, nodeType, nodeID, 1.0, false, -1);
// Finished
linesMode = 0;
gui->setLinesControlsText("");
}
if (linesMode == 1)
{
model->getLines()->setLineStart(contactNode, nodeType, nodeID); // Start should always be on 'own ship' so nodeType = 1, and ID does not matter (leave as 0)
model->getLines()->setLineStart(contactNode, nodeType, nodeID, false, -1); // Start should always be on 'own ship' so nodeType = 1, and ID does not matter (leave as 0)
// Move on to end point
linesMode = 2;
gui->setLinesControlsText("Click in 3d view to set end position for line"); // TODO: Add translation
Expand Down Expand Up @@ -2137,7 +2137,7 @@ void MyEventReceiver::handleMooringLines(irr::core::line3df rayForLines)
contactPointNode->setName(terrainSceneNode->getName());

// Node ID is 0 as we always assume parent is terrain 0
model->getLines()->setLineEnd(contactPointNode, nominalMass, 5, 0, 1.5);
model->getLines()->setLineEnd(contactPointNode, nominalMass, 5, 0, 1.5, false, -1);

// Tidy up
linesMode = 0;
Expand Down
5 changes: 4 additions & 1 deletion src/NetworkSecondary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,12 @@ void NetworkSecondary::receiveMessage()
endNode->setName(endParent->getName());
}

// Length factor can be hard coded as 1.0, as line nominal length will be updated later
irr::f32 lengthFactor = 1.0;

// Create the lines
model->getLines()->setLineStart(startNode, lineStartType, lineStartID, true, i);
model->getLines()->setLineEnd(endNode, lineNominalShipMass, lineEndType, lineEndID, true, i);
model->getLines()->setLineEnd(endNode, lineNominalShipMass, lineEndType, lineEndID, lengthFactor, true, i);
}

}
Expand Down
3 changes: 2 additions & 1 deletion src/multiplayerHub/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,10 @@ int main()
linesString = linesString.substr(0,linesString.length()-1);
}
stringToSend.append(linesString);
stringToSend.append("#");

//12: 13 basic records in data sent, entry 12 is engine and wheel data for secondary controls, not needed, so send blank entry
stringToSend.append("12#");
stringToSend.append("12");

//std::cout << stringToSend << std::endl;

Expand Down