Added rotation arrow for when billboards are selected

This commit is contained in:
parax0
2016-01-25 22:26:38 -07:00
parent 9a24a34bc6
commit 75091f718c
7 changed files with 37 additions and 13 deletions

View File

@@ -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());