DebugDraw extra
fixes ray direction was dictating the length of ray now ray is normalized and multiplied by length added default vaule for Color& color to be Color::White [info] c# because Color color = Color.White is not valid think to do on c# side the default value is not genereted [to do] generate extra overload binding in c#
This commit is contained in:
@@ -920,9 +920,14 @@ void DebugDraw::DrawActors(Actor** selectedActors, int32 selectedActorsCount, bo
|
||||
}
|
||||
}
|
||||
|
||||
void DebugDraw::DrawRay(const Vector3& origin, const Vector3& direction, const Color& color, float duration, bool depthTest)
|
||||
void DebugDraw::DrawRay(const Vector3& origin, const Vector3& direction, Color& color, float length, float duration, bool depthTest)
|
||||
{
|
||||
DrawLine(origin, origin + direction, color, duration, depthTest);
|
||||
DrawLine(origin, origin + (direction.GetNormalized() * length), color, duration, depthTest);
|
||||
}
|
||||
|
||||
void DebugDraw::DrawRay(const Ray& ray, Color& color, float length, float duration, bool depthTest)
|
||||
{
|
||||
DrawLine(ray.Position, ray.Position + (ray.Direction.GetNormalized() * length), color, duration, depthTest);
|
||||
}
|
||||
|
||||
void DebugDraw::DrawLine(const Vector3& start, const Vector3& end, const Color& color, float duration, bool depthTest)
|
||||
|
||||
@@ -75,9 +75,20 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw
|
||||
/// <param name="origin">The origin of the line.</param>
|
||||
/// <param name="direction">The direction of the line.</param>
|
||||
/// <param name="color">The color.</param>
|
||||
/// <param name="length">The length of the ray.</param>
|
||||
/// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param>
|
||||
/// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param>
|
||||
API_FUNCTION() static void DrawRay(const Vector3& origin, const Vector3& direction, const Color& color, float duration = 0.0f, bool depthTest = true);
|
||||
API_FUNCTION() static void DrawRay(const Vector3& origin, const Vector3& direction, Color& color = Color::White, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true);
|
||||
|
||||
/// <summary>
|
||||
/// Draws the line in a direction.
|
||||
/// </summary>
|
||||
/// <param name="ray">The ray.</param>
|
||||
/// <param name="color">The color.</param>
|
||||
/// <param name="length">The length of the ray.</param>
|
||||
/// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param>
|
||||
/// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param>
|
||||
API_FUNCTION() static void DrawRay(const Ray& ray, Color& color = Color::White, float length = 3.402823466e+38f, float duration = 0.0f, bool depthTest = true);
|
||||
|
||||
/// <summary>
|
||||
/// Draws the line.
|
||||
|
||||
Reference in New Issue
Block a user