mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-27 14:17:37 +01:00
73 lines
4.3 KiB
XML
73 lines
4.3 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<class name="NavigationObstacle2D" inherits="Node2D" version="3.12">
|
|
<brief_description>
|
|
2D Obstacle used in navigation to constrain avoidance controlled agents outside or inside an area.
|
|
</brief_description>
|
|
<description>
|
|
2D Obstacle used in navigation to constrain avoidance controlled agents outside or inside an area. The obstacle needs a navigation map and outline vertices defined to work correctly.
|
|
If the obstacle's vertices are winded in clockwise order, avoidance agents will be pushed in by the obstacle, otherwise, avoidance agents will be pushed out. Outlines must not cross or overlap.
|
|
Obstacles are [b]not[/b] a replacement for a (re)baked navigation mesh. Obstacles [b]don't[/b] change the resulting path from the pathfinding, obstacles only affect the navigation avoidance agent movement by altering the suggested velocity of the avoidance agent.
|
|
Obstacles using vertices can warp to a new position but should not moved every frame as each move requires a rebuild of the avoidance map.
|
|
</description>
|
|
<tutorials>
|
|
</tutorials>
|
|
<methods>
|
|
<method name="get_agent_rid" qualifiers="const">
|
|
<return type="RID" />
|
|
<description>
|
|
Returns the [RID] of this agent on the [NavigationServer2D]. This [RID] is used for the moving avoidance "obstacle" component (using a fake avoidance agent) which size is defined by [member radius] and velocity set by using [member velocity].
|
|
</description>
|
|
</method>
|
|
<method name="get_avoidance_layer_value" qualifiers="const">
|
|
<return type="bool" />
|
|
<argument index="0" name="layer_number" type="int" />
|
|
<description>
|
|
Returns whether or not the specified layer of the [member avoidance_layers] bitmask is enabled, given a [param layer_number] between 1 and 32.
|
|
</description>
|
|
</method>
|
|
<method name="get_navigation" qualifiers="const">
|
|
<return type="Node" />
|
|
<description>
|
|
Returns the [Navigation2D] node that the obstacle is using for its navigation system.
|
|
</description>
|
|
</method>
|
|
<method name="get_obstacle_rid" qualifiers="const">
|
|
<return type="RID" />
|
|
<description>
|
|
Returns the [RID] of this obstacle on the [NavigationServer2D]. This [RID] is used for the static avoidance obstacle component which shape is defined by [member vertices].
|
|
</description>
|
|
</method>
|
|
<method name="set_avoidance_layer_value">
|
|
<return type="void" />
|
|
<argument index="0" name="layer_number" type="int" />
|
|
<argument index="1" name="value" type="bool" />
|
|
<description>
|
|
Based on [param value], enables or disables the specified layer in the [member avoidance_layers] bitmask, given a [param layer_number] between 1 and 32.
|
|
</description>
|
|
</method>
|
|
<method name="set_navigation">
|
|
<return type="void" />
|
|
<argument index="0" name="navigation" type="Node" />
|
|
<description>
|
|
Sets the [Navigation2D] node used by the obstacle. Useful when you don't want to make the obstacle a child of a [Navigation2D] node.
|
|
</description>
|
|
</method>
|
|
</methods>
|
|
<members>
|
|
<member name="avoidance_layers" type="int" setter="set_avoidance_layers" getter="get_avoidance_layers" default="1">
|
|
A bitfield determining the avoidance layers for this obstacle. Agent's with a matching bit on the their avoidance mask will avoid this obstacle.
|
|
</member>
|
|
<member name="radius" type="float" setter="set_radius" getter="get_radius" default="0.0">
|
|
Sets the avoidance radius for the obstacle.
|
|
</member>
|
|
<member name="velocity" type="Vector2" setter="set_velocity" getter="get_velocity" default="Vector2( 0, 0 )">
|
|
Sets the wanted velocity for the obstacle so other agent's can better predict the obstacle if it is moved with a velocity regularly (every frame) instead of warped to a new position. Does only affect avoidance for the obstacles [member radius]. Does nothing for the obstacles static vertices.
|
|
</member>
|
|
<member name="vertices" type="PoolVector2Array" setter="set_vertices" getter="get_vertices" default="PoolVector2Array( )">
|
|
The outline vertices of the obstacle. If the vertices are winded in clockwise order agents will be pushed in by the obstacle, else they will be pushed out. Outlines can not be crossed or overlap. Should the vertices using obstacle be warped to a new position agent's can not predict this movement and may get trapped inside the obstacle.
|
|
</member>
|
|
</members>
|
|
<constants>
|
|
</constants>
|
|
</class>
|