OccluderShapePolygon¶
Inherits: OccluderShape < Resource < Reference < Object
Polygon occlusion primitive for use with the Occluder node.
Description¶
OccluderShapes are resources used by Occluder nodes, allowing geometric occlusion culling.
The polygon must be a convex polygon. The polygon points can be created and deleted either in the Editor inspector or by calling set_polygon_points
. The points of the edges can be set by dragging the handles in the Editor viewport.
Additionally each polygon occluder can optionally support a single hole. If you add at least three points in the Editor inspector to the hole, you can drag the edge points of the hole in the Editor viewport.
In general, the lower the number of edges in polygons and holes, the faster the system will operate at runtime, so in most cases you will want to use 4 points for each.
Properties¶
|
||
|
||
|
Methods¶
void |
set_hole_point ( int index, Vector2 position ) |
void |
set_polygon_point ( int index, Vector2 position ) |
Property Descriptions¶
PoolVector2Array hole_points = PoolVector2Array( )
void set_hole_points ( PoolVector2Array value )
PoolVector2Array get_hole_points ( )
Allows changing the hole geometry from code.
PoolVector2Array polygon_points = PoolVector2Array( 1, -1, 1, 1, -1, 1, -1, -1 )
void set_polygon_points ( PoolVector2Array value )
PoolVector2Array get_polygon_points ( )
Allows changing the polygon geometry from code.
bool two_way = true
Specifies whether the occluder should operate from both sides. If false
, the occluder will operate one way only.
Method Descriptions¶
void set_hole_point ( int index, Vector2 position )
Sets an individual hole point position. Primarily for use by the editor.
Note: This function will not resize the hole point array. Set hole_points to set the number of points.
void set_polygon_point ( int index, Vector2 position )
Sets an individual polygon point position. Primarily for use by the editor.
Note: This function will not resize the polygon point array. Set polygon_points to set the number of points.