Commit f1107a10 authored by Chae Ho Shin's avatar Chae Ho Shin

model update

parent d08511a5
...@@ -69,51 +69,29 @@ namespace flatland { ...@@ -69,51 +69,29 @@ namespace flatland {
{ {
public: public:
bool isPlayer = true; bool isPlayer = true;
//std::vector<std::tuple<Flatlandobject, int>> world = {}; std::vector<std::tuple<Flatlandobject, double>> world = {};
char pastlightcone[81] = "--------------------------------------------------------------------------------"; char pastlightcone[81] = "--------------------------------------------------------------------------------";
auto updatepastlightcone(Mainworldobserver* main) -> void auto updatepastlightcone(Mainworldobserver* mainobserver) -> void
{ {
for (auto i = 0; i < 80; ++i) for (auto object : world)
{ {
auto distance = i - 40; auto theobject = std::get<0>(object);
if (distance == 0) continue; for (auto objectstate : theobject.objecthistory)
auto point = std::vector<double>{(double)distance, (double)distance};
point = LORENTZ_BOOST(-this->currentvelocity) * point;
point = std::vector<double>{point[0] + main->currenttime, point[1] + std::get<1>(main->objectlist[0])};
for (auto anobject : main->objectlist)
{ {
auto theobject = std::get<0>(anobject); auto mainclocktimeatstatechange = std::get<1>(objectstate);
auto findcond = [](auto t, std::tuple<State, double, double, int, double, int> a) { return std::get<1>(a) > t; }; auto propertimeclockatstatechange = std::get<2>(objectstate);
auto newfindcond = std::bind(findcond, point[0], std::placeholders::_1); auto maincoordinatelocationatstatechange = std::get<3>(objectstate);
auto it = std::find_if(theobject.objecthistory.begin(), theobject.objecthistory.end(), newfindcond); auto mainrelativevelocity = std::get<4>(objectstate);
if (it == theobject.objecthistory.begin()) auto properacceleration = std::get<5>(objectstate);
{
if (std::get<0>(objectstate) == INERTIAL)
{
auto lightconeeq = std::vector<double>{ 1.0, mainobserver->currenttime - std::get<1>(mainobserver->objectlist[0]) };
} }
else else
{ {
auto recentstatechange = *std::prev(it);
auto mainclocktimeatstatechange = std::get<1>(recentstatechange);
auto propertimeclockatstatechange = std::get<2>(recentstatechange);
auto maincoordinatelocationatstatechange = std::get<3>(recentstatechange);
auto mainrelativevelocity = std::get<4>(recentstatechange);
auto properacceleration = std::get<5>(recentstatechange);
if ((maincoordinatelocationatstatechange < point[1] && mainrelativevelocity < 0.0 && properacceleration < 0.0)
|| (maincoordinatelocationatstatechange > point[1] && mainrelativevelocity > 0.0 && properacceleration > 0.0))
{
continue;
}
else
{
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment