ImmediateGeometry¶
Inherits: GeometryInstance < VisualInstance < Spatial < Node < Object
Category: Core
Brief Description¶
Node to draw simple geometry from code, ala OpenGL 1.x
Member Functions¶
void | add_sphere ( int lats, int lons, float radius, bool add_uv=true ) |
void | add_vertex ( Vector3 pos ) |
void | begin ( int primitive, Texture texture=NULL ) |
void | clear ( ) |
void | end ( ) |
void | set_color ( Color color ) |
void | set_normal ( Vector3 normal ) |
void | set_tangent ( Plane tangent ) |
void | set_uv ( Vector2 uv ) |
void | set_uv2 ( Vector2 uv ) |
Member Function Description¶
Simple helper to draw a uvsphere, with given latitudes, longitude and radius.
- void add_vertex ( Vector3 pos )
Add a vertex with the currently set color/uv/etc.
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.
- void clear ( )
Clear everything that was drawn using begin/end.
- void end ( )
Call this when done adding a batch of geometry, otherwise it can’t be displayed.
- void set_color ( Color color )
Set the color that the next vertex will use to be drawn.
- void set_normal ( Vector3 normal )
Set the normal that the next vertex will use to be drawn.
- void set_tangent ( Plane tangent )
Set the tangent (and binormal facing) that the next vertex will use to be drawn.
- void set_uv ( Vector2 uv )
Set the UV that the next vertex will use to be drawn.
- void set_uv2 ( Vector2 uv )
Set the second layer of UV that the next vertex will use to be drawn.