Used to draw debug lines in the game world.
A LineObject is created with World.create_line_object().
You can add lines to a line object by calling the add_* functions, and queue it for rendering by calling dispatch(). The lines in a line object are not cleared automatically between frames, so any lines you add will persist on screen as long as you continue to dispatch the line object. Call reset() to clear the lines of a line object.
To draw lines that follow a moving object, call reset() every frame to clear out the old lines, then add the new lines for the object's new position before you call dispatch().
Constructors and accessors
Other related reference items
stingray.Actor.debug_draw() stingray.NavigationMesh.visualize_last_search() stingray.World.destroy_line_object() | |
Debugging |
Related help topics
add_axes ( self, pose, length )Adds lines for each axis with a given length.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
pose : | Specifies the position and orientation of the axes. | |
length : | The length of the axes lines. Defaults to 1. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
This function does not return any values. |
Colors are fixed: X is red, Y is green, Z is blue.
add_box ( self, color, pose, extents )Adds an oriented box.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
color : | The color of the box. This is an ARGB value stored in a Vector4 with each component ranging from 0-255. You can create such a value by calling Color(), passing three arguments for an RGB value or four for an ARGB value. To draw a bright yellow line, for example, you would use Color(255, 255, 0). | |
pose : | Specifies the position and orientation of the box. | |
extents : | The size of the box along its local right, forward and up axes. |
This function does not return any values. |
add_capsule ( self, color, from, to, radius, segments, circles, bars )Adds a capsule as a line between from and to fattened to the specified radius.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
color : | The color of the capsule. This is an ARGB value stored in a Vector4 with each component ranging from 0-255. You can create such a value by calling Color(), passing three arguments for an RGB value or four for an ARGB value. To draw a bright yellow line, for example, you would use Color(255, 255, 0). | |
from : | The start point. | |
to : | The end point. | |
radius : | number | The radius of the capsule. |
segments : | integer? | Optional; The number of line segments in each circle. If omitted, the default value of 20 is used. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
circles : | integer? | Optional; The number of circles along the length of the capsule. If omitted, the default value of 4 is used. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
bars : | integer? | Optional; The number of bars in the capsule. If omitted, the default value of 10 is used. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
This function does not return any values. |
The segments, circles and bars parameters specify how detailed to make the capsule.
add_circle ( self, color, center, radius, normal, segments )Adds a two-dimensional circle at the center position, with the specified radius and normal vector.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
color : | The color of the circle. This is an ARGB value stored in a Vector4 with each component ranging from 0-255. You can create such a value by calling Color(), passing three arguments for an RGB value or four for an ARGB value. To draw a bright yellow line, for example, you would use Color(255, 255, 0). | |
center : | The center point of the circle. | |
radius : | number | The radius of the circle. |
normal : | The normal vector. | |
segments : | integer? | Optional; The number of line segments that will be used to draw the circle. If omitted, the default value of 20 is used. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
This function does not return any values. |
add_cone ( self, color, from, to, radius, segments, bars )Adds a cone with the tip at from and the center of the base at to.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
color : | The color of the cone. This is an ARGB value stored in a Vector4 with each component ranging from 0-255. You can create such a value by calling Color(), passing three arguments for an RGB value or four for an ARGB value. To draw a bright yellow line, for example, you would use Color(255, 255, 0). | |
from : | The start point. | |
to : | The end point. | |
radius : | number | The radius of the base of the cone. |
segments : | integer? | Optional; The number of line segments in the cone. If omitted, the default value of 20 is used. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
bars : | integer? | Optional; The number of bars in the cone. If omitted, the default value of 10 is used. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
This function does not return any values. |
add_half_sphere ( self, color, center, radius, normal, segments, parts )Adds a half-sphere at the center position, with the specified normal from the circular plane.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
color : | The color of the sphere. This is an ARGB value stored in a Vector4 with each component ranging from 0-255. You can create such a value by calling Color(), passing three arguments for an RGB value or four for an ARGB value. To draw a bright yellow line, for example, you would use Color(255, 255, 0). | |
center : | The center point of the sphere. | |
radius : | number | The radius of the sphere. |
normal : | The normal vector. | |
segments : | integer? | Optional; The number of line segments that will be used to draw each circle. If omitted, the default value of 20 is used. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
parts : | integer? | Optional; The number of circles in the half-sphere. If omitted, the default value of 2 is used. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
This function does not return any values. |
add_line ( self, color, from, to )Adds to the line object a new line between from and to, with the specified color.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
color : | The color of the line. This is an ARGB value stored in a Vector4 with each component ranging from 0-255. You can create such a value by calling Color(), passing three arguments for an RGB value or four for an ARGB value. To draw a bright yellow line, for example, you would use Color(255, 255, 0). | |
from : | The starting point of the line. | |
to : | The ending point of the line. |
This function does not return any values. |
add_sphere ( self, color, center, radius, segments, parts )Adds a three-dimensional sphere at the center position, with specified radius.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
color : | The color of the sphere. This is an ARGB value stored in a Vector4 with each component ranging from 0-255. You can create such a value by calling Color(), passing three arguments for an RGB value or four for an ARGB value. To draw a bright yellow line, for example, you would use Color(255, 255, 0). | |
center : | The center point of the sphere. | |
radius : | number | The radius of the sphere. |
segments : | integer? | Optional; The number of line segments that will be used to draw each circle. If omitted, the default value of 20 is used. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
parts : | integer? | Optional; The number of circles in the sphere. If omitted, the default value of 2 is used. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
This function does not return any values. |
dispatch ( world, line_object )Queues the line object for rendering in the specified world.
|
world : | The world where the line object is rendered. | |
line_object : | The line object to dispatch for rendering. |
This function does not return any values. |
The world should be the same world that created the line object.
reset ( self )Clears the lines of the line object.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
This function does not return any values. |