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
1 change: 1 addition & 0 deletions src/chrono_swig/interface/irrlicht/ChModuleIrrlicht.i
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ using namespace gui;
%import(module="pychrono.core") "chrono_swig/interface/core/ChFrame.i"
// %import(module="pychrono.core") "../../../chrono/functions/ChFunction.h"
// %import(module="pychrono.core") "chrono_swig/interface/core/ChFunction.i"
%import(module="pychrono.core") "chrono_swig/interface/core/ChObject.i" // ChObject should be imported before ChPhysicsItem
%import(module="pychrono.core") "chrono_swig/interface/core/ChPhysicsItem.i"
%import(module="pychrono.core") "chrono_swig/interface/core/ChVisualMaterial.i"
%import(module="pychrono.core") "chrono_swig/interface/core/ChVisualShape.i"
Expand Down
2 changes: 0 additions & 2 deletions src/chrono_swig/interface/irrlicht/ChVisualSystemIrrlicht.i
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
////#endif // --------------------------------------------------------------------- CSHARP

%{
#include "chrono/assets/ChVisualSystem.h"

#include "chrono_irrlicht/ChIrrNodeShape.h"
#include "chrono_irrlicht/ChIrrNodeModel.h"
#include "chrono_irrlicht/ChVisualSystemIrrlicht.h"
Expand Down
10 changes: 8 additions & 2 deletions src/chrono_swig/interface/vehicle/ChModuleVehicle.i
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@

#include "chrono_vehicle/tracked_vehicle/ChTrackContactManager.h"

#include "chrono_vehicle/ChVehicleVisualSystem.h"

// Vehicle models
#include "chrono_models/ChApiModels.h"
#include "chrono_models/vehicle/ChVehicleModelDefs.h"
Expand Down Expand Up @@ -425,6 +423,14 @@ Before adding a shared_ptr, mark as shared ptr all its inheritance tree in the m

%include "vehicleUtils.i"

#ifdef SWIGCSHARP // --------------------------------------------------------------------- CSHARP
// Import ChVisualSystem base class unconditionally (ChVehicleVisualSystem inherits from it)
// Python gets this via module imports from pychrono.irrlicht or pychrono.vsg3d into appropriate module
// but C# Unity with no visualisation module but with this vehicle module needs an unconditional
// for SWIG to understand the inheritance
%import "chrono_swig/interface/core/ChVisualSystem.i"
#endif // --------------------------------------------------------------------- CSHARP

%include "../../../chrono_vehicle/ChVehicleVisualSystem.h"

#ifdef CHRONO_IRRLICHT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ using namespace irr::scene; // This is inserted for the extend functions that us
// Extending the missing functions is a workaround
//

// Visual Systems, in SWIG order, 1- ChVehicleVisualSystem, 2- ChVisualSystemIrrlicht, 3 - ChVehicleVisualSystemIrrlicht
// Visual Systems, in SWIG order, 1- ChVehicleVisualSystem (in base ChModuleVehicle.i), 2- ChVisualSystemIrrlicht, 3- ChVehicleVisualSystemIrrlicht
// Ensure both base classes are fully defined before the derived MI class to avoid incomplete base warnings in C#.
%include "../../../chrono_vehicle/ChVehicleVisualSystem.h"
%include "../../../chrono_irrlicht/ChVisualSystemIrrlicht.h"
%include "../../../chrono_vehicle/visualization/ChVehicleVisualSystemIrrlicht.h"

Expand Down
1 change: 1 addition & 0 deletions src/chrono_swig/interface/vsg/ChModuleVsg.i
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ using namespace chrono::vsg3d;
%import(module="pychrono.core") "chrono_swig/interface/core/ChFrame.i"
// %import(module="pychrono.core") "../../../chrono/functions/ChFunction.h"
// %import(module="pychrono.core") "chrono_swig/interface/core/ChFunction.i"
%import(module="pychrono.core") "chrono_swig/interface/core/ChObject.i" // ChObject import before ChPhysicsItem
%import(module="pychrono.core") "chrono_swig/interface/core/ChPhysicsItem.i"
%import(module="pychrono.core") "chrono_swig/interface/core/ChVisualMaterial.i"
%import(module="pychrono.core") "chrono_swig/interface/core/ChVisualShape.i"
Expand Down
3 changes: 3 additions & 0 deletions src/chrono_swig/interface/vsg/ChVisualSystemVSG.i
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ using namespace chrono::vsg3d;
%shared_ptr(chrono::vsg3d::ChVisualSystemVSG)
%shared_ptr(chrono::vsg3d::ChVisualSystemVSGPlugin)

// Import base class ChVisualSystem (same pattern as in ChVisualSystemIrrlicht.i)
%import(module="pychrono.core") "chrono_swig/interface/core/ChVisualSystem.i"

/* Parse the header file to generate wrappers */
%include "../../../chrono_vsg/ChVisualSystemVSG.h"

Expand Down