A utility for visually debugging Angel Script logic in Portal 2 Community Edition.
It allows you to quickly draw any basic shapes in the world: lines, arrows, geometric shapes, text, paths, frustums, and etc.
Line,Cross,Box,OBox,GridPlane,PlaneWire,PlaneSolidCircle,Arc,ArcBetween,DiskSphere,Hemisphere,CappedHemisphereCylinder,CappedCylinder,Capsule,CapsuleHemiCone,Tube,Torus,HelixPyramid,Tetrahedron,PrismFrustum/SimpleFrustum
Arrow,DoubleArrow,ThickArrow,DoubleThickArrowVelocityArrow,AccelerationArrow,VelocityAccelerationArrowsBasis(coordinate axes)
Text()— in the worldScreenText()— on screenEntityText()/EntityTextAtPos()- Support for
TextFloat,TextInt,TextVec
- Support for solid (filled shapes) and wireframe modes.
- Convenient colors in
DebugRendererColors. - Extensible.
- The utility calls functions from VScript because VScript supports native rendering.
- All computations are performed on the Angel Script side.
- Copy
DebugRenderer.asin 'p2ce/code/'. - Include it in your script:
#include "DebugRenderer.as"
class CMyEntity : CBaseEntity
{
DebugRenderer@ m_dbg;
void Spawn()
{
@m_dbg = DebugRenderer(self);
m_dbg.Init();
}
void Think()
{
if (m_dbg.IsValid())
{
Vector pos = self.GetOrigin();
m_dbg.Arrow(pos, pos + Vector(0, 100, 50), DebugRendererColors::RED);
m_dbg.Sphere(pos + Vector(0, 0, 80), 25.0, DebugRendererColors::CYAN, 80);
m_dbg.Text(pos + Vector(0, 0, 120), "Hello Debug!");
}
}
}You are free to use, modify and share this library under the terms of the MIT License. The only condition is keeping the copyright notice, and stating whether or not the code was modified. See LICENSE for details.