-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add primitive 2D meshes #100574
Open
rburing
wants to merge
1
commit into
godotengine:master
Choose a base branch
from
rburing:primitive_mesh_2d
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,604
−0
Open
Add primitive 2D meshes #100574
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The icons are the same as for Shape2D.
You could make them filled at least.