mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 08:09:19 +02:00
Remove sad workaround
This commit is contained in:
@@ -46,11 +46,10 @@ basic_cell::on_click( TAnimModel const *Instance ) {
|
||||
void
|
||||
basic_cell::update_traction( TDynamicObject *Vehicle, int const Pantographindex ) {
|
||||
// Winger 170204 - szukanie trakcji nad pantografami
|
||||
// TODO: Why glm::make_vec3 and glm::value_ptr?
|
||||
auto const vFront = glm::make_vec3( glm::value_ptr(Vehicle->VectorFront()) ); // wektor normalny dla płaszczyzny ruchu pantografu
|
||||
auto const vUp = glm::make_vec3( glm::value_ptr(Vehicle->VectorUp()) ); // wektor pionu pudła (pochylony od pionu na przechyłce)
|
||||
auto const vLeft = glm::make_vec3( glm::value_ptr(Vehicle->VectorLeft()) ); // wektor odległości w bok (odchylony od poziomu na przechyłce)
|
||||
auto const position = glm::dvec3 { Vehicle->GetPosition() }; // współrzędne środka pojazdu
|
||||
auto const vFront = Vehicle->VectorFront(); // wektor normalny dla płaszczyzny ruchu pantografu
|
||||
auto const vUp = Vehicle->VectorUp(); // wektor pionu pudła (pochylony od pionu na przechyłce)
|
||||
auto const vLeft = Vehicle->VectorLeft(); // wektor odległości w bok (odchylony od poziomu na przechyłce)
|
||||
auto const position = Vehicle->GetPosition(); // współrzędne środka pojazdu
|
||||
|
||||
auto pantograph = Vehicle->pants[ Pantographindex ].fParamPants;
|
||||
auto const pantographposition = position + ( vLeft * pantograph->vPos.z ) + ( vUp * pantograph->vPos.y ) + ( vFront * pantograph->vPos.x );
|
||||
@@ -519,15 +518,13 @@ basic_cell::find( glm::dvec3 const &Point, float const Radius, bool const Onlyco
|
||||
// finds a path with one of its ends located in specified point. returns: located path and id of the matching endpoint
|
||||
std::tuple<TTrack *, int>
|
||||
basic_cell::find( glm::dvec3 const &Point, TTrack const *Exclude ) const {
|
||||
|
||||
glm::dvec3 point{Point.x, Point.y, Point.z}; // sad workaround until math classes unification // TODO: Is it needed?
|
||||
int endpointid;
|
||||
|
||||
for( auto *path : m_directories.paths ) {
|
||||
|
||||
if( path == Exclude ) { continue; }
|
||||
|
||||
endpointid = path->TestPoint( &point );
|
||||
endpointid = path->TestPoint( &Point );
|
||||
if( endpointid >= 0 ) {
|
||||
|
||||
return { path, endpointid };
|
||||
@@ -692,11 +689,10 @@ basic_section::on_click( TAnimModel const *Instance ) {
|
||||
// legacy method, finds and assigns traction piece(s) to pantographs of provided vehicle
|
||||
void
|
||||
basic_section::update_traction( TDynamicObject *Vehicle, int const Pantographindex ) {
|
||||
// TODO: Why glm::make_vec3 and glm::value_ptr?
|
||||
auto const vFront = glm::make_vec3( glm::value_ptr(Vehicle->VectorFront()) ); // wektor normalny dla płaszczyzny ruchu pantografu
|
||||
auto const vUp = glm::make_vec3( glm::value_ptr(Vehicle->VectorUp()) ); // wektor pionu pudła (pochylony od pionu na przechyłce)
|
||||
auto const vLeft = glm::make_vec3( glm::value_ptr(Vehicle->VectorLeft()) ); // wektor odległości w bok (odchylony od poziomu na przechyłce)
|
||||
auto const position = glm::dvec3{ Vehicle->GetPosition() }; // współrzędne środka pojazdu
|
||||
auto const vFront = Vehicle->VectorFront(); // wektor normalny dla płaszczyzny ruchu pantografu
|
||||
auto const vUp = Vehicle->VectorUp(); // wektor pionu pudła (pochylony od pionu na przechyłce)
|
||||
auto const vLeft = Vehicle->VectorLeft(); // wektor odległości w bok (odchylony od poziomu na przechyłce)
|
||||
auto const position = Vehicle->GetPosition(); // współrzędne środka pojazdu
|
||||
|
||||
auto pantograph = Vehicle->pants[ Pantographindex ].fParamPants;
|
||||
auto const pantographposition = position + ( vLeft * pantograph->vPos.z ) + ( vUp * pantograph->vPos.y ) + ( vFront * pantograph->vPos.x );
|
||||
@@ -1061,11 +1057,10 @@ basic_region::update_sounds() {
|
||||
void
|
||||
basic_region::update_traction( TDynamicObject *Vehicle, int const Pantographindex ) {
|
||||
// TODO: convert vectors to transformation matrix and pass them down the chain along with calculated position
|
||||
// TODO: Why glm::make_vec3 and glm::value_ptr?
|
||||
auto const vFront = glm::make_vec3( glm::value_ptr(Vehicle->VectorFront()) ); // wektor normalny dla płaszczyzny ruchu pantografu
|
||||
auto const vUp = glm::make_vec3( glm::value_ptr(Vehicle->VectorUp()) ); // wektor pionu pudła (pochylony od pionu na przechyłce)
|
||||
auto const vLeft = glm::make_vec3( glm::value_ptr(Vehicle->VectorLeft()) ); // wektor odległości w bok (odchylony od poziomu na przechyłce)
|
||||
auto const position = glm::dvec3 { Vehicle->GetPosition() }; // współrzędne środka pojazdu
|
||||
auto const vFront = Vehicle->VectorFront(); // wektor normalny dla płaszczyzny ruchu pantografu
|
||||
auto const vUp = Vehicle->VectorUp(); // wektor pionu pudła (pochylony od pionu na przechyłce)
|
||||
auto const vLeft = Vehicle->VectorLeft(); // wektor odległości w bok (odchylony od poziomu na przechyłce)
|
||||
auto const position = Vehicle->GetPosition(); // współrzędne środka pojazdu
|
||||
|
||||
auto p = Vehicle->pants[ Pantographindex ].fParamPants;
|
||||
auto const pant0 = position + ( vLeft * p->vPos.z ) + ( vUp * p->vPos.y ) + ( vFront * p->vPos.x );
|
||||
|
||||
Reference in New Issue
Block a user