mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Improve segmentation math for DebugDrawHemiSphere
Use actual number of segments per semi.
This commit is contained in:
parent
2ffb1da730
commit
d47eaf98a0
@ -135,8 +135,8 @@ void DebugDrawCapsule(const Vector3D& vStart, const QAngle& vAngles, const Vecto
|
|||||||
|
|
||||||
AngleCompose(vAngles, { 180, 180, 0 }, vHemi);
|
AngleCompose(vAngles, { 180, 180, 0 }, vHemi);
|
||||||
|
|
||||||
DebugDrawHemiSphere(vStart + (vUp * flHeight), vAngles, vRadius, color, 16, bZBuffer);
|
DebugDrawHemiSphere(vStart + (vUp * flHeight), vAngles, vRadius, color, 8, bZBuffer);
|
||||||
DebugDrawHemiSphere(vStart, vHemi, vRadius, color, 16, bZBuffer);
|
DebugDrawHemiSphere(vStart, vHemi, vRadius, color, 8, bZBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -180,9 +180,9 @@ void DebugDrawHemiSphere(const Vector3D& vOrigin, const QAngle& vAngles, const V
|
|||||||
Vector3D vForward[4];
|
Vector3D vForward[4];
|
||||||
QAngle vComposed[4];
|
QAngle vComposed[4];
|
||||||
|
|
||||||
float flDegrees = 360.0 / float(nSegments);
|
float flDegrees = 360.0 / float(nSegments * 2);
|
||||||
|
|
||||||
for (int i = 0; i < (nSegments / 2 + 1); i++)
|
for (int i = 0; i < (nSegments + 1); i++)
|
||||||
{
|
{
|
||||||
AngleCompose(vAngles, { -flDegrees * i, 0, 0 }, vComposed[0]);
|
AngleCompose(vAngles, { -flDegrees * i, 0, 0 }, vComposed[0]);
|
||||||
AngleCompose(vAngles, { 0, flDegrees * i - 90, 0 }, vComposed[1]);
|
AngleCompose(vAngles, { 0, flDegrees * i - 90, 0 }, vComposed[1]);
|
||||||
|
@ -6,7 +6,7 @@ void DebugDrawBox(const Vector3D& vOrigin, const QAngle& vAngles, const Vector3D
|
|||||||
void DebugDrawCylinder(const Vector3D& vOrigin, const QAngle& vAngles, float flRadius, float flHeight, Color color, int nSides = 16, bool bZBuffer = true);
|
void DebugDrawCylinder(const Vector3D& vOrigin, const QAngle& vAngles, float flRadius, float flHeight, Color color, int nSides = 16, bool bZBuffer = true);
|
||||||
void DebugDrawCapsule(const Vector3D& vStart, const QAngle& vAngles, const Vector3D& vRadius, float flHeight, Color color, bool bZBuffer = true);
|
void DebugDrawCapsule(const Vector3D& vStart, const QAngle& vAngles, const Vector3D& vRadius, float flHeight, Color color, bool bZBuffer = true);
|
||||||
void DebugDrawSphere(const Vector3D& vOrigin, float flRadius, Color color, int nSegments = 16, bool bZBuffer = true);
|
void DebugDrawSphere(const Vector3D& vOrigin, float flRadius, Color color, int nSegments = 16, bool bZBuffer = true);
|
||||||
void DebugDrawHemiSphere(const Vector3D& vOrigin, const QAngle& vAngles, const Vector3D& vRadius, Color color, int nSegments = 16, bool bZBuffer = true);
|
void DebugDrawHemiSphere(const Vector3D& vOrigin, const QAngle& vAngles, const Vector3D& vRadius, Color color, int nSegments = 8, bool bZBuffer = true);
|
||||||
void DebugDrawCircle(const Vector3D& vOrigin, const QAngle& vAngles, float flRadius, Color color, int nSegments = 16, bool bZBuffer = true);
|
void DebugDrawCircle(const Vector3D& vOrigin, const QAngle& vAngles, float flRadius, Color color, int nSegments = 16, bool bZBuffer = true);
|
||||||
void DebugDrawSquare(const Vector3D& vOrigin, const QAngle& vAngles, float flSquareSize, Color color, bool bZBuffer = true);
|
void DebugDrawSquare(const Vector3D& vOrigin, const QAngle& vAngles, float flSquareSize, Color color, bool bZBuffer = true);
|
||||||
void DebugDrawTriangle(const Vector3D& vOrigin, const QAngle& vAngles, float flTriangleSize, Color color, bool bZBuffer = true);
|
void DebugDrawTriangle(const Vector3D& vOrigin, const QAngle& vAngles, float flTriangleSize, Color color, bool bZBuffer = true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user