-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allows drawing (anti-aliased) 2D shapes using MeshInstance2D. Based on the code for primitive 3D meshes.
- Loading branch information
Showing
13 changed files
with
1,604 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<class name="CapsuleMesh2D" inherits="PrimitiveMesh2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> | ||
<brief_description> | ||
A capsule-shaped [PrimitiveMesh2D]. | ||
</brief_description> | ||
<description> | ||
A capsule-shaped [PrimitiveMesh2D]. | ||
</description> | ||
<tutorials> | ||
</tutorials> | ||
<members> | ||
<member name="height" type="float" setter="set_height" getter="get_height" default="30.0"> | ||
Total height of the capsule mesh (including the semicircular ends). | ||
</member> | ||
<member name="radial_segments" type="int" setter="set_radial_segments" getter="get_radial_segments" default="32"> | ||
Number of radial segments on each semicircle of the capsule mesh. | ||
</member> | ||
<member name="radius" type="float" setter="set_radius" getter="get_radius" default="10.0"> | ||
Radius of the semicircles on the ends of the capsule mesh. | ||
</member> | ||
</members> | ||
</class> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<class name="CircleMesh2D" inherits="PrimitiveMesh2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> | ||
<brief_description> | ||
A circular [PrimitiveMesh2D]. | ||
</brief_description> | ||
<description> | ||
A circular [PrimitiveMesh2D]. | ||
</description> | ||
<tutorials> | ||
</tutorials> | ||
<members> | ||
<member name="radial_segments" type="int" setter="set_radial_segments" getter="get_radial_segments" default="64"> | ||
Number of radial segments on the circle. | ||
</member> | ||
<member name="radius" type="float" setter="set_radius" getter="get_radius" default="10.0"> | ||
Radius of the circle. | ||
</member> | ||
</members> | ||
</class> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<class name="PrimitiveMesh2D" inherits="Mesh" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> | ||
<brief_description> | ||
Base class for all primitive 2D meshes. | ||
</brief_description> | ||
<description> | ||
Base class for all primitive 2D meshes. Examples include [RectangleMesh2D], [CircleMesh2D], and [CapsuleMesh2D]. | ||
</description> | ||
<tutorials> | ||
</tutorials> | ||
<methods> | ||
<method name="_create_mesh_array" qualifiers="virtual const"> | ||
<return type="Array" /> | ||
<description> | ||
Override this method to customize how this primitive mesh should be generated. Should return an [Array] where each element is another Array of values required for the mesh (see the [enum Mesh.ArrayType] constants). | ||
</description> | ||
</method> | ||
<method name="get_mesh_arrays" qualifiers="const"> | ||
<return type="Array" /> | ||
<description> | ||
Returns the mesh arrays used to make up the surface of this primitive mesh. | ||
</description> | ||
</method> | ||
<method name="request_update"> | ||
<return type="void" /> | ||
<description> | ||
Request an update of this primitive mesh based on its properties. | ||
</description> | ||
</method> | ||
</methods> | ||
<members> | ||
<member name="antialiased" type="bool" setter="set_antialiased" getter="is_antialiased" default="false"> | ||
If [code]true[/code], a half transparent "skirt" will be attached to the boundary, making outlines smooth. | ||
</member> | ||
<member name="custom_aabb" type="AABB" setter="set_custom_aabb" getter="get_custom_aabb" default="AABB(0, 0, 0, 0, 0, 0)"> | ||
Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. | ||
</member> | ||
</members> | ||
</class> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<class name="RectangleMesh2D" inherits="PrimitiveMesh2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> | ||
<brief_description> | ||
A rectangular [PrimitiveMesh2D]. | ||
</brief_description> | ||
<description> | ||
A rectangular [PrimitiveMesh2D]. | ||
</description> | ||
<tutorials> | ||
</tutorials> | ||
<members> | ||
<member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2(20, 20)"> | ||
The rectangle's width and height. | ||
</member> | ||
<member name="subdivide_height" type="int" setter="set_subdivide_height" getter="get_subdivide_height" default="0"> | ||
Number of extra edge loops inserted along the Y axis. | ||
</member> | ||
<member name="subdivide_width" type="int" setter="set_subdivide_width" getter="get_subdivide_width" default="0"> | ||
Number of extra edge loops inserted along the X axis. | ||
</member> | ||
</members> | ||
</class> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.