mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-20 04:34:48 +00:00
Selection Highlighting
This commit is contained in:
parent
fec893cd8b
commit
9106eef98b
|
|
@ -5013,3 +5013,22 @@ DefineEngineMethod( ShapeBase, getModelFile, const char *, (),,
|
|||
const char *fieldName = StringTable->insert( String("shapeFile") );
|
||||
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:
|
||||
DECLARE_CALLBACK( F32, validateCameraFov, (F32 fov) );
|
||||
|
||||
|
||||
virtual void setSelectionFlags(U8 flags);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -375,6 +375,8 @@ bool TSStatic::_createShape()
|
|||
|
||||
mShapeInstance = new TSShapeInstance( mShape, isClientObject() );
|
||||
|
||||
if (isClientObject())
|
||||
mShapeInstance->cloneMaterialList();
|
||||
if( isGhost() )
|
||||
{
|
||||
// Reapply the current skin
|
||||
|
|
@ -1405,3 +1407,22 @@ void TSStatic::onStaticModified(const char* slotName, const char*newValue)
|
|||
|
||||
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;
|
||||
private:
|
||||
void set_special_typing();
|
||||
virtual void setSelectionFlags(U8 flags);
|
||||
};
|
||||
|
||||
typedef TSStatic::MeshType TSMeshType;
|
||||
|
|
|
|||
|
|
@ -252,6 +252,11 @@ public:
|
|||
|
||||
virtual const GFXStateBlockDesc &getUserStateBlock() const = 0;
|
||||
|
||||
protected:
|
||||
bool needsHighlighting;
|
||||
public:
|
||||
bool needsSelectionHighlighting() { return needsHighlighting; };
|
||||
void setSelectionHighlighting(bool flag) { needsHighlighting = flag; };
|
||||
};
|
||||
|
||||
#endif /// _BASEMATINSTANCE_H_
|
||||
|
|
|
|||
|
|
@ -253,6 +253,7 @@ void MatInstance::construct()
|
|||
mIsForwardLit = false;
|
||||
mIsValid = false;
|
||||
mIsHardwareSkinned = false;
|
||||
needsHighlighting = false;
|
||||
|
||||
MATMGR->_track(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@ struct SceneData
|
|||
/// The deferred render bin.
|
||||
/// @RenderDeferredMgr
|
||||
DeferredBin,
|
||||
/// The selection-highlight render bin.
|
||||
/// @afxRenderHighlightMgr
|
||||
HighlightBin,
|
||||
};
|
||||
|
||||
/// This defines when we're rendering a special bin
|
||||
|
|
|
|||
Loading…
Reference in a new issue