Refactor physics force and impulse code

This commit is contained in:
Aaron Franke 2020-03-26 00:23:34 -04:00
parent 030a26206f
commit ba27deef06
No known key found for this signature in database
GPG key ID: 40A1750B977E56BF
35 changed files with 180 additions and 176 deletions

View file

@ -37,7 +37,7 @@
</return>
<argument index="0" name="force" type="Vector3">
</argument>
<argument index="1" name="position" type="Vector3">
<argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
Adds a constant directional force (i.e. acceleration).
@ -66,9 +66,9 @@
<method name="apply_impulse">
<return type="void">
</return>
<argument index="0" name="position" type="Vector3">
<argument index="0" name="impulse" type="Vector3">
</argument>
<argument index="1" name="impulse" type="Vector3">
<argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
Applies a positioned impulse to the body. An impulse is time independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts. The position uses the rotation of the global coordinate system, but is centered at the object's origin.