leocad/common/lc_traintrack.h
Leonardo Zide ed29dad76a
Some checks failed
LeoCAD CI / build-ubuntu (push) Has been cancelled
LeoCAD CI / build-macos (push) Has been cancelled
Added train track gizmo.
2024-11-02 19:34:22 -07:00

44 lines
775 B
C++

#pragma once
#include "lc_math.h"
class lcPiece;
class lcPiecesLibrary;
struct lcTrainTrackConnection
{
lcMatrix44 Transform;
};
enum class lcTrainTrackType
{
Straight,
Left,
Right,
BranchLeft,
BranchRight,
Count
};
class lcTrainTrackInfo
{
public:
lcTrainTrackInfo() = default;
std::pair<PieceInfo*, lcMatrix44> GetPieceInsertPosition(lcPiece* Piece, quint32 ConnectionIndex, lcTrainTrackType TrainTrackType) const;
void AddConnection(const lcTrainTrackConnection& TrainTrackConnection)
{
mConnections.emplace_back(TrainTrackConnection);
}
const std::vector<lcTrainTrackConnection>& GetConnections() const
{
return mConnections;
}
protected:
std::vector<lcTrainTrackConnection> mConnections;
};
void lcTrainTrackInit(lcPiecesLibrary* Library);