mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-27 18:43:48 +00:00
Fixes issue where Regenerate Bounds button for SceneGroup/SubScenes wasn't displaying by moving it to Editing inspector group
Added mode toggle for if changing the transform influences the child objects of a SubScene or not Added onSelected/onUnselected callbacks for SimObjects to allow contextual behavior in the editor Added functionality of programmatic/dynamic Tool Button Palettes Added logic so when selecting SubScenes the world editor palette has new buttons for letting the move/rotate actions influence the child objects
This commit is contained in:
parent
10d1aeca1f
commit
e2d0cc1981
11 changed files with 318 additions and 25 deletions
|
|
@ -119,7 +119,7 @@ void SceneGroup::onInspect(GuiInspector* inspector)
|
|||
Parent::onInspect(inspector);
|
||||
|
||||
//Put the SubScene group before everything that'd be SubScene-effecting, for orginazational purposes
|
||||
GuiInspectorGroup* sceneGroupGrp = inspector->findExistentGroup(StringTable->insert("SceneGroup"));
|
||||
GuiInspectorGroup* sceneGroupGrp = inspector->findExistentGroup(StringTable->insert("Editing"));
|
||||
if (!sceneGroupGrp)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@
|
|||
#include "gui/editor/inspector/group.h"
|
||||
#include "T3D/gameBase/gameBase.h"
|
||||
|
||||
bool SubScene::smTransformChildren = false;
|
||||
|
||||
IMPLEMENT_CO_NETOBJECT_V1(SubScene);
|
||||
|
||||
S32 SubScene::mUnloadTimeoutMs = 5000;
|
||||
|
|
@ -86,6 +88,10 @@ void SubScene::consoleInit()
|
|||
|
||||
Con::addVariable("$SubScene::UnloadTimeoutMS", TypeBool, &SubScene::mUnloadTimeoutMs, "The amount of time in milliseconds it takes for a SubScene to be unloaded if it's inactive.\n"
|
||||
"@ingroup Editors\n");
|
||||
|
||||
Con::addVariable("$SubScene::transformChildren", TypeBool, &SubScene::smTransformChildren,
|
||||
"@brief If true, then transform manipulations modify child objects. If false, only triggering bounds is manipulated\n\n"
|
||||
"@ingroup Editors");
|
||||
}
|
||||
|
||||
void SubScene::addObject(SimObject* object)
|
||||
|
|
@ -163,6 +169,30 @@ void SubScene::inspectPostApply()
|
|||
setMaskBits(-1);
|
||||
}
|
||||
|
||||
void SubScene::setTransform(const MatrixF& mat)
|
||||
{
|
||||
if(SubScene::smTransformChildren)
|
||||
{
|
||||
Parent::setTransform(mat);
|
||||
}
|
||||
else
|
||||
{
|
||||
SceneObject::setTransform(mat);
|
||||
}
|
||||
}
|
||||
|
||||
void SubScene::setRenderTransform(const MatrixF& mat)
|
||||
{
|
||||
if (SubScene::smTransformChildren)
|
||||
{
|
||||
Parent::setRenderTransform(mat);
|
||||
}
|
||||
else
|
||||
{
|
||||
SceneObject::setRenderTransform(mat);
|
||||
}
|
||||
}
|
||||
|
||||
bool SubScene::evaluateCondition()
|
||||
{
|
||||
if (!mLoadIf.isEmpty())
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ public:
|
|||
|
||||
void onLevelChanged() {}
|
||||
|
||||
protected:
|
||||
static bool smTransformChildren;
|
||||
|
||||
private:
|
||||
DECLARE_LEVELASSET(SubScene, Level, onLevelChanged);
|
||||
|
||||
|
|
@ -47,6 +50,7 @@ private:
|
|||
U32 mCurrTick;
|
||||
|
||||
bool mGlobalLayer;
|
||||
|
||||
public:
|
||||
SubScene();
|
||||
virtual ~SubScene();
|
||||
|
|
@ -71,6 +75,9 @@ public:
|
|||
//void onEditorDisable() override;
|
||||
void inspectPostApply() override;
|
||||
|
||||
void setTransform(const MatrixF& mat) override;
|
||||
void setRenderTransform(const MatrixF& mat) override;
|
||||
|
||||
bool testBox(const Box3F& testBox);
|
||||
bool evaluateCondition();
|
||||
void _onSelected() override;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue