mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-17 00:47:05 +00:00
Added rotation arrow for when billboards are selected
This commit is contained in:
@@ -197,15 +197,28 @@ void CScriptNode::Draw(FRenderOptions Options, int ComponentIndex, const SViewIn
|
||||
void CScriptNode::DrawSelection()
|
||||
{
|
||||
glBlendFunc(GL_ONE, GL_ZERO);
|
||||
LoadModelMatrix();
|
||||
|
||||
// Draw wireframe for models; billboards only get tinted
|
||||
// Draw wireframe for models
|
||||
if (UsesModel())
|
||||
{
|
||||
LoadModelMatrix();
|
||||
CModel *pModel = (mpActiveModel ? mpActiveModel : CDrawUtil::GetCubeModel());
|
||||
pModel->DrawWireframe(eNoRenderOptions, WireframeColor());
|
||||
}
|
||||
|
||||
// Draw rotation arrow for billboards
|
||||
else
|
||||
{
|
||||
// Create model matrix that doesn't take scaling into account, and draw
|
||||
CTransform4f Transform;
|
||||
Transform.Rotate(AbsoluteRotation());
|
||||
Transform.Translate(AbsolutePosition());
|
||||
CGraphics::sMVPBlock.ModelMatrix = Transform.ToMatrix4f();
|
||||
CGraphics::UpdateMVPBlock();
|
||||
|
||||
DrawRotationArrow();
|
||||
}
|
||||
|
||||
if (mpInstance)
|
||||
{
|
||||
CGraphics::sMVPBlock.ModelMatrix = CMatrix4f::skIdentity;
|
||||
@@ -503,7 +516,7 @@ void CScriptNode::CalculateTransform(CTransform4f& rOut) const
|
||||
rOut.Scale(Scale * pTemp->PreviewScale());
|
||||
}
|
||||
|
||||
if (UsesModel() && pTemp->RotationType() == CScriptTemplate::eRotationEnabled)
|
||||
if (pTemp->RotationType() == CScriptTemplate::eRotationEnabled)
|
||||
rOut.Rotate(AbsoluteRotation());
|
||||
|
||||
rOut.Translate(AbsolutePosition());
|
||||
|
||||
Reference in New Issue
Block a user