Better way to import vrms; fix physics in editor

This commit is contained in:
2026-02-08 14:36:45 +03:00
parent d139e77969
commit 71a560ab3f
8 changed files with 309 additions and 38 deletions

View File

@@ -20,6 +20,8 @@
#include "AppModule.h"
#include "EditorGizmoModule.h"
#include "EditorInputModule.h"
#include "PhysicsModule.h"
#include "physics.h"
#include "sound.h"
class App;
@@ -588,10 +590,14 @@ public:
{
}
bool switchWindow = false;
void createContent()
JoltPhysicsWrapper *mJolt;
void createContent()
{
int i;
sky = new SkyBoxRenderer(mEditorNormalScene.getSceneManager());
mJolt = new JoltPhysicsWrapper(
mEditorNormalScene.getSceneManager(),
mEditorNormalScene.mCameraNode);
sky = new SkyBoxRenderer(mEditorNormalScene.getSceneManager());
bool drawFirst = true;
uint8_t renderQueue = drawFirst ?
Ogre::RENDER_QUEUE_SKIES_EARLY :
@@ -611,8 +617,12 @@ public:
mEditorNormalScene.mScnMgr,
/*mDynWorld.get(), */ mEditorNormalScene.mCameraNode,
mEditorNormalScene.mCamera, getRenderWindow());
ECS::get().import <ECS::EditorGizmoModule>();
ECS::get().import <ECS::EditorInputModule>();
ECS::get().import <ECS::PhysicsModule>();
ECS::get().import <ECS::EditorGizmoModule>();
ECS::get().import <ECS::EditorInputModule>();
ECS::Physics &ph = ECS::get().ensure<ECS::Physics>();
ph.physics = mJolt;
ECS::modified<ECS::Physics>();
ECS::get().set<ECS::RenderWindow>(
{ getRenderWindow(), getDisplayDPI() });
ECS::get()