2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2022-08-05 16:51:38 +00:00
<class name= "ImmediateGeometry" inherits= "GeometryInstance" version= "3.6" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-12 20:42:36 +00:00
<brief_description >
2017-10-09 10:49:12 +00:00
Draws simple geometry from code.
2017-09-12 20:42:36 +00:00
</brief_description>
<description >
2017-10-09 10:49:12 +00:00
Draws simple geometry from code. Uses a drawing mode similar to OpenGL 1.x.
2020-04-19 21:21:42 +00:00
See also [ArrayMesh], [MeshDataTool] and [SurfaceTool] for procedural geometry generation.
[b]Note:[/b] ImmediateGeometry3D is best suited to small amounts of mesh data that change every frame. It will be slow when handling large amounts of mesh data. If mesh data doesn't change often, use [ArrayMesh], [MeshDataTool] or [SurfaceTool] instead.
[b]Note:[/b] Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding order[/url] for front faces of triangle primitive modes.
2020-10-30 11:13:48 +00:00
[b]Note:[/b] In case of missing points when handling large amounts of mesh data, try increasing its buffer size limit under [member ProjectSettings.rendering/limits/buffers/immediate_buffer_size_kb].
2017-09-12 20:42:36 +00:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "add_sphere" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "lats" type= "int" />
<argument index= "1" name= "lons" type= "int" />
<argument index= "2" name= "radius" type= "float" />
<argument index= "3" name= "add_uv" type= "bool" default= "true" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00:00
Simple helper to draw an UV sphere with given latitude, longitude and radius.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "add_vertex" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "position" type= "Vector3" />
2017-09-12 20:42:36 +00:00
<description >
2019-12-24 04:20:32 +00:00
Adds a vertex in local coordinate space with the currently set color/uv/etc.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "begin" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "primitive" type= "int" enum= "Mesh.PrimitiveType" />
<argument index= "1" name= "texture" type= "Texture" default= "null" />
2017-09-12 20:42:36 +00:00
<description >
2019-12-06 22:09:20 +00:00
Begin drawing (and optionally pass a texture override). When done call [method end]. For more information on how this works, search for [code]glBegin()[/code] and [code]glEnd()[/code] references.
For the type of primitive, see the [enum Mesh.PrimitiveType] enum.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "clear" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2017-09-12 20:42:36 +00:00
<description >
2017-10-09 10:49:12 +00:00
Clears everything that was drawn using begin/end.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "end" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2017-09-12 20:42:36 +00:00
<description >
2017-10-09 10:49:12 +00:00
Ends a drawing context and displays the results.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_color" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "color" type= "Color" />
2017-09-12 20:42:36 +00:00
<description >
2017-10-09 10:49:12 +00:00
The current drawing color.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_normal" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "normal" type= "Vector3" />
2017-09-12 20:42:36 +00:00
<description >
2017-10-09 10:49:12 +00:00
The next vertex's normal.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_tangent" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "tangent" type= "Plane" />
2017-09-12 20:42:36 +00:00
<description >
2017-10-09 10:49:12 +00:00
The next vertex's tangent (and binormal facing).
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_uv" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "uv" type= "Vector2" />
2017-09-12 20:42:36 +00:00
<description >
2017-10-09 10:49:12 +00:00
The next vertex's UV.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_uv2" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "uv" type= "Vector2" />
2017-09-12 20:42:36 +00:00
<description >
2017-10-09 10:49:12 +00:00
The next vertex's second layer UV.
2017-09-12 20:42:36 +00:00
</description>
</method>
</methods>
<constants >
</constants>
</class>