- Reimplements autosave logic to handle levels, subscenes and terrains in a more consistent, reliable way.

- Adds entry to RMB menu in Asset Browser to restore an asset to a backup copy taken from autosaves
- Adds reparent out-of-bounds objects button to SceneGroup inspector
- Adds ability to have SubScene have a different loading bounds from the actual subscene bounds, allowing load triggering to happen ahead of the bounds of the subscene itself
- Fixes asset importer handling of animFPS field to be the correct type
- Adds onInspect handling to GameBase allowing better handling for any game class type with editor integration
- Add getAssetLooseFileCount and getAssetLooseFile to AssetManager to be able to iterate over all loose files associated to an asset
- Add standard/default preload function def to forestItem
- Fixes handling of text placement on GuiIconButtonCtrl when text is set to the right
- Adds setGlobalCenter utility function
- Adds ability to set guiInputCtrl active state
- Matched util functions for tracking if left and right mouse buttons are down to EditTSCtrl alongside the existing middle mouse
- Add empty element sanity check to appMesh loader
- Add callback for GameBase when game is created
- Add default graphics options config for steamdeck
- Fix typo in assetImportConfig default
- Filters SceneGroup utility buttons in inspector to only show for relevent class types
This commit is contained in:
JeffR 2025-05-25 07:40:10 -05:00
parent 70502d1b0f
commit bb7ee38bf4
33 changed files with 978 additions and 237 deletions

View file

@ -9,6 +9,7 @@
#include "physics/physicsShape.h"
#include "renderInstance/renderPassManager.h"
#include "scene/sceneRenderState.h"
#include "Scene.h"
IMPLEMENT_CO_NETOBJECT_V1(SceneGroup);
@ -156,6 +157,37 @@ void SceneGroup::onInspect(GuiInspector* inspector)
regenButton->setConsoleCommand(rgBuffer);
regenFieldGui->addObject(regenButton);
//
//Regen bounds button
GuiInspectorField* reparentFieldGui = sceneGroupGrp->createInspectorField();
reparentFieldGui->init(inspector, sceneGroupGrp);
reparentFieldGui->setSpecialEditField(true);
reparentFieldGui->setTargetObject(this);
fldnm = StringTable->insert("ReparentOOBObjs");
reparentFieldGui->setSpecialEditVariableName(fldnm);
reparentFieldGui->setInspectorField(NULL, fldnm);
reparentFieldGui->setDocs("");
stack->addObject(reparentFieldGui);
GuiButtonCtrl* reparentButton = new GuiButtonCtrl();
reparentButton->registerObject();
reparentButton->setDataField(StringTable->insert("profile"), NULL, "ToolsGuiButtonProfile");
reparentButton->setText("Reparent Out-of-bounds Objs");
reparentButton->resize(Point2I::Zero, regenFieldGui->getExtent());
reparentButton->setHorizSizing(GuiControl::horizResizeWidth);
reparentButton->setVertSizing(GuiControl::vertResizeHeight);
char rprntBuffer[512];
dSprintf(rprntBuffer, 512, "%d.reparentOOBObjects();", this->getId());
reparentButton->setConsoleCommand(rprntBuffer);
reparentFieldGui->addObject(reparentButton);
#endif
}
@ -279,6 +311,27 @@ void SceneGroup::recalculateBoundingBox()
setMaskBits(TransformMask);
}
void SceneGroup::reparentOOBObjects()
{
if (empty())
return;
// Extend the bounding box to include each child's bounding box
for (SimSetIterator itr(this); *itr; ++itr)
{
SceneObject* child = dynamic_cast<SceneObject*>(*itr);
if (child)
{
const Box3F& childBox = child->getWorldBox();
if(!mWorldBox.isOverlapped(childBox))
{
Scene::getRootScene()->addObject(child);
}
}
}
}
U32 SceneGroup::packUpdate(NetConnection* conn, U32 mask, BitStream* stream)
{
U32 retMask = Parent::packUpdate(conn, mask, stream);
@ -363,3 +416,9 @@ DefineEngineMethod(SceneGroup, recalculateBounds, void, (), ,
{
object->recalculateBoundingBox();
}
DefineEngineMethod(SceneGroup, reparentOOBObjects, void, (), ,
"Finds objects that are children of the SceneGroup and, if not overlapping or in the bounds, reparents them to the root scene.\n")
{
object->reparentOOBObjects();
}