Age | Commit message (Collapse) | Author |
|
Implement collision impulse in Godot Physics 3D
|
|
|
|
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.
It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).
We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).
Also fixed "cf." Frenchism - it's meant as "refer to / see".
|
|
Allow to apply the angular velocity of a moving platform
|
|
Non-exhaustive list of case-sensitive renames:
GDExtension -> GDNative
GDNATIVE -> GDEXTENSION
gdextension -> gdnative
ExtensionExtension ->Extension (for where there was GDNativeExtension)
EXTENSION_EXTENSION ->EXTENSION (for where there was GDNATIVE_EXTENSION)
gdnlib -> gdextension
gdn_interface -> gde_interface
gdni -> gde_interface
|
|
Also update the documentation to refer to the get_rid() method.
|
|
Change type of exclude property from `Vector<RID>` to `TypedArray<RID>` which is consistent with the 2D version.
|
|
Revert "Turn on recovery as collisions only for floor snapping"
|
|
to unwanted behaviour for other surface than the floor."
This reverts commit 10395f5df2a1cac6ed83e674c084e62a88fcdde9.
|
|
|
|
make `body_set_state_sync_callback` take a `Callable`
|
|
unwanted behaviour for other surface than the floor.
|
|
a Callable
Prefer Callable to a C-style callback. This is helpful for GDExtension.
|
|
This exposes PhysicsServer2DManager and PhysicsServer3DManager.
|
|
|
|
|
|
|
|
Co-authored-by: Juan Linietsky <reduzio@gmail.com>
|
|
|
|
|
|
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
|
|
This makes the intent explicit in each use case.
|
|
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
(order matters) but use is discouraged.
There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
|
|
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
|
|
* Allows creating a GDExtension based 3D Physics Server (for Bullet, PhysX, etc. support)
* Some changes on native struct binding for PhysicsServer
This allows a 3D Physics server created entirely from GDExtension. Once it works, the idea is to port the 2D one to it.
|
|
Happy new year to the wonderful Godot community!
|
|
Makes the API for forces and impulses more flexible, easier to
understand and harmonized between 2D and 3D.
Rigid bodies now have 3 sets of methods for forces and impulses:
-apply_impulse() for impulses (one-shot and time independent)
-apply_force() for forces (time dependent) applied for the current step
-add_constant_force() for forces that keeps being applied each step
Also updated the documentation to clarify the different methods and
parameters in rigid body nodes, body direct state and physics servers.
|
|
Helps with discovery and setup of physics solver settings, in a specific
project settings section for both 2D and 3D.
Other changes for cleanup:
-Removed unused space parameters in 3D
SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO
SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS
-Added custom solver bias for Shape3D (same as Shape2D)
-Improved documentation for solver settings
|
|
|
|
Clarified space parameters for contacts and added missing ones.
List of changes:
-Add contact bias to space parameters
-Add solver iterations to space parameters, instead of a specific
physics server function
-Renamed BODY_MAX_ALLOWED_PENETRATION to CONTACT_MAX_ALLOWED_PENETRATION
to make it consistent with other contact parameters
|
|
We prefer to prevent using chained assignment (`T a = b = c = T();`) as this
can lead to confusing code and subtle bugs.
According to https://en.wikipedia.org/wiki/Assignment_operator_(C%2B%2B), C++
allows any arbitrary return type, so this is standard compliant.
This could be re-assessed if/when we have an actual need for a behavior more
akin to that of the C++ STL, for now this PR simply changes a handful of
cases which were inconsistent with the rest of the codebase (`void` return
type was already the most common case prior to this commit).
|
|
Separate space override modes for gravity/damping in Area
|
|
Makes the results consistent for all shape types with options to set
the desired behavior.
|
|
Also make inspector clearer for gravity point properties.
|
|
Expose local center of mass in physics servers
|
|
Center of mass in body's local space is more useful than the transformed
one in some cases, like drawing its position for debug.
It's especially useful to get the generated local center of mass when
in auto mode (by default).
Physics Server BODY_PARAM_CENTER_OF_MASS:
Now always returns the local center of mass, instead of setting a local
center of mass and getting a transformed one.
This causes compatibility breaking, but it makes more sense for the
parameter to be consistent between getter and setter.
Direct Body State:
There are now two properties, because both of them can be useful in
different situations.
center_of_mass: relative position in global coordinates (same as before)
center_of_mass_local: position in local coordinates
|
|
Same as what is already done for shape queries, applied to point and ray
queries. Easier to document and more flexible to add more parameters.
Also expose intersect_point method to script in 3D.
Remove intersect_point_on_canvas in 2D, replaced with a parameter.
|
|
|
|
Damping values are now non-negative.
Add new properties linear_damp_mode and angular_damp_mode to set the way
RigidDynamicBody and PhysicalBone (2D & 3D) use damping values.
It can now be Combine (default) to add to the default/areas, or Replace
to override the value completely (current behavior).
|
|
Also moved MT physics server wrappers to the main servers folder, since
they don't have to be implementation specific.
|
|
Added a parameter in test_body_motion to exclude attached objects from
collision, used to avoid collision with all TileMap tiles with moving
platform motion instead of just the one tile the character touches.
Same changes made in 3D for consistency, and handling potential similar
cases.
|
|
-Physics servers test body motion use a class to hold parameters instead
of multiple arguments to make it more readable and flexible since there
are many options
-Improved documentation for test body motion and kinematic collision
-Removed read-only properties for body motion results (not handled in
scripts, so they should be get_ methods only instead)
|
|
Replaced Mesh with mesh RID in Godot Physics 3D and Bullet.
|
|
Shape metadata was only used to get tile information when colliding with
tilemaps. It's not needed anymore since there's an API in tilemap using
body ids instead.
|
|
Clarify RigidDynamicBody modes
|
|
Allows 2D character controller to work without applying gravity when
touching the ground (also more safely in 3D), and collision detection
is more flexible with different safe margin values.
Character body motion changes in 2D and 3D:
-Recovery only for depth > min contact depth to help with collision
detection consistency (rest info could be lost if recovery was too much)
-Adaptive min contact depth (based on margin) instead of space parameter
Extra CharacterBody changes:
-2D: apply changes made in 3D for stop on slope and floor snap that help
fixing some jittering cases
-3D: fix minor inconsistencies in stop on slope and floor snap logic
|
|
Co-authored-by: Camille Mohr-Daurat <pouleyketchoup@gmail.com>
|
|
RigidDynamicBody modes are replaced with several properties to make their
usage clearer:
-lock_rotation: disable body's rotation (instead of MODE_LOCKED)
-freeze: no gravity or forces (instead of MODE_STATIC and MODE_KINEMATIC)
-freeze_mode: Static (can be only teleported) or Kinematic (can be animated)
Also renamed MODE_DYNAMIC_LOCKED to MODE_DYNAMIC_LINEAR in the physics
servers.
|
|
|
|
Changes:
-Added support for custom inertia and center of mass in 3D
-Added support for custom center of mass in 2D
-Calculated center of mass from shapes in 2D (same as in 3D)
-Fixed mass properties calculation with disabled shapes in 2D/3D
-Removed first_integration which is not used in 2D and doesn't seem to
make a lot of sense (prevents omit_force_integration to work during the
first frame)
-Support for custom inertia on different axes for RigidBody3D
|