mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Selection Highlighting
This commit is contained in:
parent
64d1b06866
commit
d4c2eeea98
7 changed files with 52 additions and 0 deletions
|
|
@ -5013,3 +5013,22 @@ DefineEngineMethod( ShapeBase, getModelFile, const char *, (),,
|
||||||
const char *fieldName = StringTable->insert( String("shapeFile") );
|
const char *fieldName = StringTable->insert( String("shapeFile") );
|
||||||
return datablock->getDataField( fieldName, NULL );
|
return datablock->getDataField( fieldName, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ShapeBase::setSelectionFlags(U8 flags)
|
||||||
|
{
|
||||||
|
Parent::setSelectionFlags(flags);
|
||||||
|
|
||||||
|
if (!mShapeInstance || !isClientObject())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!mShapeInstance->ownMaterialList())
|
||||||
|
return;
|
||||||
|
|
||||||
|
TSMaterialList* pMatList = mShapeInstance->getMaterialList();
|
||||||
|
for (S32 j = 0; j < pMatList->size(); j++)
|
||||||
|
{
|
||||||
|
BaseMatInstance * bmi = pMatList->getMaterialInst(j);
|
||||||
|
bmi->setSelectionHighlighting(needsSelectionHighlighting());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1852,6 +1852,8 @@ public:
|
||||||
protected:
|
protected:
|
||||||
DECLARE_CALLBACK( F32, validateCameraFov, (F32 fov) );
|
DECLARE_CALLBACK( F32, validateCameraFov, (F32 fov) );
|
||||||
|
|
||||||
|
|
||||||
|
virtual void setSelectionFlags(U8 flags);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -375,6 +375,8 @@ bool TSStatic::_createShape()
|
||||||
|
|
||||||
mShapeInstance = new TSShapeInstance( mShape, isClientObject() );
|
mShapeInstance = new TSShapeInstance( mShape, isClientObject() );
|
||||||
|
|
||||||
|
if (isClientObject())
|
||||||
|
mShapeInstance->cloneMaterialList();
|
||||||
if( isGhost() )
|
if( isGhost() )
|
||||||
{
|
{
|
||||||
// Reapply the current skin
|
// Reapply the current skin
|
||||||
|
|
@ -1405,3 +1407,22 @@ void TSStatic::onStaticModified(const char* slotName, const char*newValue)
|
||||||
|
|
||||||
set_special_typing();
|
set_special_typing();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TSStatic::setSelectionFlags(U8 flags)
|
||||||
|
{
|
||||||
|
Parent::setSelectionFlags(flags);
|
||||||
|
|
||||||
|
if (!mShapeInstance || !isClientObject())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!mShapeInstance->ownMaterialList())
|
||||||
|
return;
|
||||||
|
|
||||||
|
TSMaterialList* pMatList = mShapeInstance->getMaterialList();
|
||||||
|
for (S32 j = 0; j < pMatList->size(); j++)
|
||||||
|
{
|
||||||
|
BaseMatInstance * bmi = pMatList->getMaterialInst(j);
|
||||||
|
bmi->setSelectionHighlighting(needsSelectionHighlighting());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -254,6 +254,7 @@ public:
|
||||||
Point2F mGradientRange;
|
Point2F mGradientRange;
|
||||||
private:
|
private:
|
||||||
void set_special_typing();
|
void set_special_typing();
|
||||||
|
virtual void setSelectionFlags(U8 flags);
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef TSStatic::MeshType TSMeshType;
|
typedef TSStatic::MeshType TSMeshType;
|
||||||
|
|
|
||||||
|
|
@ -252,6 +252,11 @@ public:
|
||||||
|
|
||||||
virtual const GFXStateBlockDesc &getUserStateBlock() const = 0;
|
virtual const GFXStateBlockDesc &getUserStateBlock() const = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool needsHighlighting;
|
||||||
|
public:
|
||||||
|
bool needsSelectionHighlighting() { return needsHighlighting; };
|
||||||
|
void setSelectionHighlighting(bool flag) { needsHighlighting = flag; };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /// _BASEMATINSTANCE_H_
|
#endif /// _BASEMATINSTANCE_H_
|
||||||
|
|
|
||||||
|
|
@ -253,6 +253,7 @@ void MatInstance::construct()
|
||||||
mIsForwardLit = false;
|
mIsForwardLit = false;
|
||||||
mIsValid = false;
|
mIsValid = false;
|
||||||
mIsHardwareSkinned = false;
|
mIsHardwareSkinned = false;
|
||||||
|
needsHighlighting = false;
|
||||||
|
|
||||||
MATMGR->_track(this);
|
MATMGR->_track(this);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,9 @@ struct SceneData
|
||||||
/// The deferred render bin.
|
/// The deferred render bin.
|
||||||
/// @RenderDeferredMgr
|
/// @RenderDeferredMgr
|
||||||
DeferredBin,
|
DeferredBin,
|
||||||
|
/// The selection-highlight render bin.
|
||||||
|
/// @afxRenderHighlightMgr
|
||||||
|
HighlightBin,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// This defines when we're rendering a special bin
|
/// This defines when we're rendering a special bin
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue