Browse Source

Add some doc to ImmediateGeometry

Juan Linietsky 9 years ago
parent
commit
221cb58382
1 changed files with 16 additions and 0 deletions
  1. 16 0
      doc/base/classes.xml

+ 16 - 0
doc/base/classes.xml

@@ -15688,9 +15688,14 @@
 </class>
 </class>
 <class name="ImmediateGeometry" inherits="GeometryInstance" category="Core">
 <class name="ImmediateGeometry" inherits="GeometryInstance" category="Core">
 	<brief_description>
 	<brief_description>
+	Node to draw simple geometry from code, ala OpenGL 1.x
 	</brief_description>
 	</brief_description>
 	<description>
 	<description>
 	</description>
 	</description>
+	ImmediateGeometry is a node used for displaying simple geometry created from code, very similar to how glBegin() and glEnd() worked in old versions of OpenGL (1.x). 
+	Simply call [method begin()], and add vertices. For custom vertex colors, uvs, normal, etc. call one of the set_ functions below before adding each vertex. When done, call [method end]
+	Calls to begin/end are accumulative and all geometry is added together. To clear all the geometry, call [method clear].
+	If a material override is set, and this material contains a texture, it's possible to override the texture used in this material for every begin/end set of calls.
 	<methods>
 	<methods>
 		<method name="add_sphere">
 		<method name="add_sphere">
 			<argument index="0" name="lats" type="int">
 			<argument index="0" name="lats" type="int">
@@ -15700,12 +15705,14 @@
 			<argument index="2" name="radius" type="float">
 			<argument index="2" name="radius" type="float">
 			</argument>
 			</argument>
 			<description>
 			<description>
+			Simple helper to draw an uvsphere, with given latitudes, longitude and radius.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="add_vertex">
 		<method name="add_vertex">
 			<argument index="0" name="pos" type="Vector3">
 			<argument index="0" name="pos" type="Vector3">
 			</argument>
 			</argument>
 			<description>
 			<description>
+			Add a vertex with the currently set color/uv/etc.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="begin">
 		<method name="begin">
@@ -15714,44 +15721,53 @@
 			<argument index="1" name="texture" type="Texture">
 			<argument index="1" name="texture" type="Texture">
 			</argument>
 			</argument>
 			<description>
 			<description>
+			Begin drawing (And optionally pass a texture override). When done call end(). For more information on how this works, search for glBegin() glEnd() references.
+			For the type of primitive, use the [Mesh].PRIMITIVE_* enumerations.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="clear">
 		<method name="clear">
 			<description>
 			<description>
+			Clear everything that was drawn using begin/end.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="end">
 		<method name="end">
 			<description>
 			<description>
+			Call this when done adding a batch of geometry, otherwise it can't be displayed.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set_color">
 		<method name="set_color">
 			<argument index="0" name="color" type="Color">
 			<argument index="0" name="color" type="Color">
 			</argument>
 			</argument>
 			<description>
 			<description>
+			Set the color that the next vertex will use to be drawn.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set_normal">
 		<method name="set_normal">
 			<argument index="0" name="normal" type="Vector3">
 			<argument index="0" name="normal" type="Vector3">
 			</argument>
 			</argument>
 			<description>
 			<description>
+			Set the normal that the next vertex will use to be drawn.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set_tangent">
 		<method name="set_tangent">
 			<argument index="0" name="tangent" type="Plane">
 			<argument index="0" name="tangent" type="Plane">
 			</argument>
 			</argument>
 			<description>
 			<description>
+			Set the tangent (and binormal facing) that the next vertex will use to be drawn.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set_uv">
 		<method name="set_uv">
 			<argument index="0" name="uv" type="Vector2">
 			<argument index="0" name="uv" type="Vector2">
 			</argument>
 			</argument>
 			<description>
 			<description>
+			Set the UV that the next vertex will use to be drawn.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set_uv2">
 		<method name="set_uv2">
 			<argument index="0" name="uv" type="Vector2">
 			<argument index="0" name="uv" type="Vector2">
 			</argument>
 			</argument>
 			<description>
 			<description>
+			Set the second layer of UV that the next vertex will use to be drawn.
 			</description>
 			</description>
 		</method>
 		</method>
 	</methods>
 	</methods>