| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="PhysicsDirectBodyState2DExtension" inherits="PhysicsDirectBodyState2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | Provides virtual methods that can be overridden to create custom [PhysicsDirectBodyState2D] implementations. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | This class extends [PhysicsDirectBodyState2D] by providing additional virtual methods that can be overridden. When these methods are overridden, they will be called instead of the internal methods of the physics server. |
| 8 | Intended for use with GDExtension to create custom implementations of [PhysicsDirectBodyState2D]. |
| 9 | </description> |
| 10 | <tutorials> |
| 11 | </tutorials> |
| 12 | <methods> |
| 13 | <method name="_add_constant_central_force" qualifiers="virtual required"> |
| 14 | <return type="void" /> |
| 15 | <param index="0" name="force" type="Vector2" /> |
| 16 | <description> |
| 17 | Overridable version of [method PhysicsDirectBodyState2D.add_constant_central_force]. |
| 18 | </description> |
| 19 | </method> |
| 20 | <method name="_add_constant_force" qualifiers="virtual required"> |
| 21 | <return type="void" /> |
| 22 | <param index="0" name="force" type="Vector2" /> |
| 23 | <param index="1" name="position" type="Vector2" /> |
| 24 | <description> |
| 25 | Overridable version of [method PhysicsDirectBodyState2D.add_constant_force]. |
| 26 | </description> |
| 27 | </method> |
| 28 | <method name="_add_constant_torque" qualifiers="virtual required"> |
| 29 | <return type="void" /> |
| 30 | <param index="0" name="torque" type="float" /> |
| 31 | <description> |
| 32 | Overridable version of [method PhysicsDirectBodyState2D.add_constant_torque]. |
| 33 | </description> |
| 34 | </method> |
| 35 | <method name="_apply_central_force" qualifiers="virtual required"> |
| 36 | <return type="void" /> |
| 37 | <param index="0" name="force" type="Vector2" /> |
| 38 | <description> |
| 39 | Overridable version of [method PhysicsDirectBodyState2D.apply_central_force]. |
| 40 | </description> |
| 41 | </method> |
| 42 | <method name="_apply_central_impulse" qualifiers="virtual required"> |
| 43 | <return type="void" /> |
| 44 | <param index="0" name="impulse" type="Vector2" /> |
| 45 | <description> |
| 46 | Overridable version of [method PhysicsDirectBodyState2D.apply_central_impulse]. |
| 47 | </description> |
| 48 | </method> |
| 49 | <method name="_apply_force" qualifiers="virtual required"> |
| 50 | <return type="void" /> |
| 51 | <param index="0" name="force" type="Vector2" /> |
| 52 | <param index="1" name="position" type="Vector2" /> |
| 53 | <description> |
| 54 | Overridable version of [method PhysicsDirectBodyState2D.apply_force]. |
| 55 | </description> |
| 56 | </method> |
| 57 | <method name="_apply_impulse" qualifiers="virtual required"> |
| 58 | <return type="void" /> |
| 59 | <param index="0" name="impulse" type="Vector2" /> |
| 60 | <param index="1" name="position" type="Vector2" /> |
| 61 | <description> |
| 62 | Overridable version of [method PhysicsDirectBodyState2D.apply_impulse]. |
| 63 | </description> |
| 64 | </method> |
| 65 | <method name="_apply_torque" qualifiers="virtual required"> |
| 66 | <return type="void" /> |
| 67 | <param index="0" name="torque" type="float" /> |
| 68 | <description> |
| 69 | Overridable version of [method PhysicsDirectBodyState2D.apply_torque]. |
| 70 | </description> |
| 71 | </method> |
| 72 | <method name="_apply_torque_impulse" qualifiers="virtual required"> |
| 73 | <return type="void" /> |
| 74 | <param index="0" name="impulse" type="float" /> |
| 75 | <description> |
| 76 | Overridable version of [method PhysicsDirectBodyState2D.apply_torque_impulse]. |
| 77 | </description> |
| 78 | </method> |
| 79 | <method name="_get_angular_velocity" qualifiers="virtual required const"> |
| 80 | <return type="float" /> |
| 81 | <description> |
| 82 | Implement to override the behavior of [member PhysicsDirectBodyState2D.angular_velocity] and its respective getter. |
| 83 | </description> |
| 84 | </method> |
| 85 | <method name="_get_center_of_mass" qualifiers="virtual required const"> |
| 86 | <return type="Vector2" /> |
| 87 | <description> |
| 88 | Implement to override the behavior of [member PhysicsDirectBodyState2D.center_of_mass] and its respective getter. |
| 89 | </description> |
| 90 | </method> |
| 91 | <method name="_get_center_of_mass_local" qualifiers="virtual required const"> |
| 92 | <return type="Vector2" /> |
| 93 | <description> |
| 94 | Implement to override the behavior of [member PhysicsDirectBodyState2D.center_of_mass_local] and its respective getter. |
| 95 | </description> |
| 96 | </method> |
| 97 | <method name="_get_collision_layer" qualifiers="virtual required const"> |
| 98 | <return type="int" /> |
| 99 | <description> |
| 100 | </description> |
| 101 | </method> |
| 102 | <method name="_get_collision_mask" qualifiers="virtual required const"> |
| 103 | <return type="int" /> |
| 104 | <description> |
| 105 | </description> |
| 106 | </method> |
| 107 | <method name="_get_constant_force" qualifiers="virtual required const"> |
| 108 | <return type="Vector2" /> |
| 109 | <description> |
| 110 | Overridable version of [method PhysicsDirectBodyState2D.get_constant_force]. |
| 111 | </description> |
| 112 | </method> |
| 113 | <method name="_get_constant_torque" qualifiers="virtual required const"> |
| 114 | <return type="float" /> |
| 115 | <description> |
| 116 | Overridable version of [method PhysicsDirectBodyState2D.get_constant_torque]. |
| 117 | </description> |
| 118 | </method> |
| 119 | <method name="_get_contact_collider" qualifiers="virtual required const"> |
| 120 | <return type="RID" /> |
| 121 | <param index="0" name="contact_idx" type="int" /> |
| 122 | <description> |
| 123 | Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider]. |
| 124 | </description> |
| 125 | </method> |
| 126 | <method name="_get_contact_collider_id" qualifiers="virtual required const"> |
| 127 | <return type="int" /> |
| 128 | <param index="0" name="contact_idx" type="int" /> |
| 129 | <description> |
| 130 | Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_id]. |
| 131 | </description> |
| 132 | </method> |
| 133 | <method name="_get_contact_collider_object" qualifiers="virtual required const"> |
| 134 | <return type="Object" /> |
| 135 | <param index="0" name="contact_idx" type="int" /> |
| 136 | <description> |
| 137 | Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_object]. |
| 138 | </description> |
| 139 | </method> |
| 140 | <method name="_get_contact_collider_position" qualifiers="virtual required const"> |
| 141 | <return type="Vector2" /> |
| 142 | <param index="0" name="contact_idx" type="int" /> |
| 143 | <description> |
| 144 | Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_position]. |
| 145 | </description> |
| 146 | </method> |
| 147 | <method name="_get_contact_collider_shape" qualifiers="virtual required const"> |
| 148 | <return type="int" /> |
| 149 | <param index="0" name="contact_idx" type="int" /> |
| 150 | <description> |
| 151 | Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_shape]. |
| 152 | </description> |
| 153 | </method> |
| 154 | <method name="_get_contact_collider_velocity_at_position" qualifiers="virtual required const"> |
| 155 | <return type="Vector2" /> |
| 156 | <param index="0" name="contact_idx" type="int" /> |
| 157 | <description> |
| 158 | Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_velocity_at_position]. |
| 159 | </description> |
| 160 | </method> |
| 161 | <method name="_get_contact_count" qualifiers="virtual required const"> |
| 162 | <return type="int" /> |
| 163 | <description> |
| 164 | Overridable version of [method PhysicsDirectBodyState2D.get_contact_count]. |
| 165 | </description> |
| 166 | </method> |
| 167 | <method name="_get_contact_impulse" qualifiers="virtual required const"> |
| 168 | <return type="Vector2" /> |
| 169 | <param index="0" name="contact_idx" type="int" /> |
| 170 | <description> |
| 171 | Overridable version of [method PhysicsDirectBodyState2D.get_contact_impulse]. |
| 172 | </description> |
| 173 | </method> |
| 174 | <method name="_get_contact_local_normal" qualifiers="virtual required const"> |
| 175 | <return type="Vector2" /> |
| 176 | <param index="0" name="contact_idx" type="int" /> |
| 177 | <description> |
| 178 | Overridable version of [method PhysicsDirectBodyState2D.get_contact_local_normal]. |
| 179 | </description> |
| 180 | </method> |
| 181 | <method name="_get_contact_local_position" qualifiers="virtual required const"> |
| 182 | <return type="Vector2" /> |
| 183 | <param index="0" name="contact_idx" type="int" /> |
| 184 | <description> |
| 185 | Overridable version of [method PhysicsDirectBodyState2D.get_contact_local_position]. |
| 186 | </description> |
| 187 | </method> |
| 188 | <method name="_get_contact_local_shape" qualifiers="virtual required const"> |
| 189 | <return type="int" /> |
| 190 | <param index="0" name="contact_idx" type="int" /> |
| 191 | <description> |
| 192 | Overridable version of [method PhysicsDirectBodyState2D.get_contact_local_shape]. |
| 193 | </description> |
| 194 | </method> |
| 195 | <method name="_get_contact_local_velocity_at_position" qualifiers="virtual required const"> |
| 196 | <return type="Vector2" /> |
| 197 | <param index="0" name="contact_idx" type="int" /> |
| 198 | <description> |
| 199 | Overridable version of [method PhysicsDirectBodyState2D.get_contact_local_velocity_at_position]. |
| 200 | </description> |
| 201 | </method> |
| 202 | <method name="_get_inverse_inertia" qualifiers="virtual required const"> |
| 203 | <return type="float" /> |
| 204 | <description> |
| 205 | Implement to override the behavior of [member PhysicsDirectBodyState2D.inverse_inertia] and its respective getter. |
| 206 | </description> |
| 207 | </method> |
| 208 | <method name="_get_inverse_mass" qualifiers="virtual required const"> |
| 209 | <return type="float" /> |
| 210 | <description> |
| 211 | Implement to override the behavior of [member PhysicsDirectBodyState2D.inverse_mass] and its respective getter. |
| 212 | </description> |
| 213 | </method> |
| 214 | <method name="_get_linear_velocity" qualifiers="virtual required const"> |
| 215 | <return type="Vector2" /> |
| 216 | <description> |
| 217 | Implement to override the behavior of [member PhysicsDirectBodyState2D.linear_velocity] and its respective getter. |
| 218 | </description> |
| 219 | </method> |
| 220 | <method name="_get_space_state" qualifiers="virtual required"> |
| 221 | <return type="PhysicsDirectSpaceState2D" /> |
| 222 | <description> |
| 223 | Overridable version of [method PhysicsDirectBodyState2D.get_space_state]. |
| 224 | </description> |
| 225 | </method> |
| 226 | <method name="_get_step" qualifiers="virtual required const"> |
| 227 | <return type="float" /> |
| 228 | <description> |
| 229 | Implement to override the behavior of [member PhysicsDirectBodyState2D.step] and its respective getter. |
| 230 | </description> |
| 231 | </method> |
| 232 | <method name="_get_total_angular_damp" qualifiers="virtual required const"> |
| 233 | <return type="float" /> |
| 234 | <description> |
| 235 | Implement to override the behavior of [member PhysicsDirectBodyState2D.total_angular_damp] and its respective getter. |
| 236 | </description> |
| 237 | </method> |
| 238 | <method name="_get_total_gravity" qualifiers="virtual required const"> |
| 239 | <return type="Vector2" /> |
| 240 | <description> |
| 241 | Implement to override the behavior of [member PhysicsDirectBodyState2D.total_gravity] and its respective getter. |
| 242 | </description> |
| 243 | </method> |
| 244 | <method name="_get_total_linear_damp" qualifiers="virtual required const"> |
| 245 | <return type="float" /> |
| 246 | <description> |
| 247 | Implement to override the behavior of [member PhysicsDirectBodyState2D.total_linear_damp] and its respective getter. |
| 248 | </description> |
| 249 | </method> |
| 250 | <method name="_get_transform" qualifiers="virtual required const"> |
| 251 | <return type="Transform2D" /> |
| 252 | <description> |
| 253 | Implement to override the behavior of [member PhysicsDirectBodyState2D.transform] and its respective getter. |
| 254 | </description> |
| 255 | </method> |
| 256 | <method name="_get_velocity_at_local_position" qualifiers="virtual required const"> |
| 257 | <return type="Vector2" /> |
| 258 | <param index="0" name="local_position" type="Vector2" /> |
| 259 | <description> |
| 260 | Overridable version of [method PhysicsDirectBodyState2D.get_velocity_at_local_position]. |
| 261 | </description> |
| 262 | </method> |
| 263 | <method name="_integrate_forces" qualifiers="virtual required"> |
| 264 | <return type="void" /> |
| 265 | <description> |
| 266 | Overridable version of [method PhysicsDirectBodyState2D.integrate_forces]. |
| 267 | </description> |
| 268 | </method> |
| 269 | <method name="_is_sleeping" qualifiers="virtual required const"> |
| 270 | <return type="bool" /> |
| 271 | <description> |
| 272 | Implement to override the behavior of [member PhysicsDirectBodyState2D.sleeping] and its respective getter. |
| 273 | </description> |
| 274 | </method> |
| 275 | <method name="_set_angular_velocity" qualifiers="virtual required"> |
| 276 | <return type="void" /> |
| 277 | <param index="0" name="velocity" type="float" /> |
| 278 | <description> |
| 279 | Implement to override the behavior of [member PhysicsDirectBodyState2D.angular_velocity] and its respective setter. |
| 280 | </description> |
| 281 | </method> |
| 282 | <method name="_set_collision_layer" qualifiers="virtual required"> |
| 283 | <return type="void" /> |
| 284 | <param index="0" name="layer" type="int" /> |
| 285 | <description> |
| 286 | </description> |
| 287 | </method> |
| 288 | <method name="_set_collision_mask" qualifiers="virtual required"> |
| 289 | <return type="void" /> |
| 290 | <param index="0" name="mask" type="int" /> |
| 291 | <description> |
| 292 | </description> |
| 293 | </method> |
| 294 | <method name="_set_constant_force" qualifiers="virtual required"> |
| 295 | <return type="void" /> |
| 296 | <param index="0" name="force" type="Vector2" /> |
| 297 | <description> |
| 298 | Overridable version of [method PhysicsDirectBodyState2D.set_constant_force]. |
| 299 | </description> |
| 300 | </method> |
| 301 | <method name="_set_constant_torque" qualifiers="virtual required"> |
| 302 | <return type="void" /> |
| 303 | <param index="0" name="torque" type="float" /> |
| 304 | <description> |
| 305 | Overridable version of [method PhysicsDirectBodyState2D.set_constant_torque]. |
| 306 | </description> |
| 307 | </method> |
| 308 | <method name="_set_linear_velocity" qualifiers="virtual required"> |
| 309 | <return type="void" /> |
| 310 | <param index="0" name="velocity" type="Vector2" /> |
| 311 | <description> |
| 312 | Implement to override the behavior of [member PhysicsDirectBodyState2D.linear_velocity] and its respective setter. |
| 313 | </description> |
| 314 | </method> |
| 315 | <method name="_set_sleep_state" qualifiers="virtual required"> |
| 316 | <return type="void" /> |
| 317 | <param index="0" name="enabled" type="bool" /> |
| 318 | <description> |
| 319 | Implement to override the behavior of [member PhysicsDirectBodyState2D.sleeping] and its respective setter. |
| 320 | </description> |
| 321 | </method> |
| 322 | <method name="_set_transform" qualifiers="virtual required"> |
| 323 | <return type="void" /> |
| 324 | <param index="0" name="transform" type="Transform2D" /> |
| 325 | <description> |
| 326 | Implement to override the behavior of [member PhysicsDirectBodyState2D.transform] and its respective setter. |
| 327 | </description> |
| 328 | </method> |
| 329 | </methods> |
| 330 | </class> |