1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Method add_pos for object/player (#14126)

This commit is contained in:
sfence 2024-01-01 22:48:56 +01:00 committed by GitHub
parent c9ab61aa8c
commit d0753dddb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 105 additions and 7 deletions

View file

@ -7465,15 +7465,20 @@ child will follow movement and rotation of that bone.
* Sets the position of the object.
* No-op if object is attached.
* `pos` is a vector `{x=num, y=num, z=num}`
* `add_pos(pos)`:
* Changes position by adding to the current position.
* No-op if object is attached.
* `pos` is a vector `{x=num, y=num, z=num}`.
* In comparison to using `set_pos`, `add_pos` will avoid synchronization problems.
* `get_velocity()`: returns the velocity, a vector.
* `add_velocity(vel)`
* Changes velocity by adding to the current velocity.
* `vel` is a vector, e.g. `{x=0.0, y=2.3, z=1.0}`
* In comparison to using get_velocity, adding the velocity and then using
set_velocity, add_velocity is supposed to avoid synchronization problems.
Additionally, players also do not support set_velocity.
* In comparison to using `get_velocity`, adding the velocity and then using
`set_velocity`, `add_velocity` is supposed to avoid synchronization problems.
Additionally, players also do not support `set_velocity`.
* If object is a player:
* Does not apply during free_move.
* Does not apply during `free_move`.
* Note that since the player speed is normalized at each move step,
increasing e.g. Y velocity beyond what would usually be achieved
(see: physics overrides) will cause existing X/Z velocity to be reduced.