Commit graph

1188 commits

Author SHA1 Message Date
Lewis Pollard 4e68f089e0
Fix is_playing() method in AnimatedSprite3D
(cherry picked from commit 2450173495)
2021-09-14 13:41:26 +02:00
Rémi Verschelde f85ad007c0
Merge pull request #52338 from lawnjelly/portals_fix_portal_import
Portals - fix import of portal normal + small bug fixes
2021-09-14 10:21:44 +02:00
Max Hilbrunner 76693aa364
Merge pull request #52182 from lawnjelly/portals_pvs_enum
Portals - Fix RoomManager PVS enum
2021-09-07 21:23:48 +02:00
lawnjelly 116e2ce799 Portals - fix import of portal normal + small bug fixes
When converting portal meshes during import, indices were not being taken into account, which could lead to incorrect estimation of the portal direction. This PR now copes with either indexed or non-indexed portal meshes.

Added a bug fix to cope with portals pointing almost directly straight up or down, which could cause problems with the lookat transform.

Added the ability for named portals to link to short room names (in addition to postfix room names).
2021-09-02 10:39:47 +01:00
Aaron Franke ee69b57434
[3.x] Fix KinematicBody axis lock 2021-08-29 20:38:09 -05:00
lawnjelly 7ea35da462 Portals - Fix RoomManager PVS enum
The PVS mode enum had been declared using scope operator, which does not seem to work correctly from GDScript with the BIND_ENUM_CONSTANT macro.

This PR removes the scope operator in the declaration.
2021-08-28 07:27:50 +01:00
Haoyu Qiu 5183c473f7 Backport new methods for KinematicBody and KinematicCollision
For both 2D and 3D, three methods are added:

- `get_floor_angle` on `KinematicBody` to get the floor angle.
- `get_angle` on `KinematicCollision` to get the collision angle.
- `get_last_slide_collision` to quickly get the latest collision of `move_and_slide`.
2021-08-26 12:16:40 +08:00
Camille Mohr-Daurat 5ce734c073
Merge pull request #52056 from jmb462/fix-raycast3D-color-update
[3.x] Fix Raycast3D color update when not colliding anymore (Fix #52051)
2021-08-24 08:11:05 -07:00
fabriceci 13d5fa2c43 Remove the transmission of velocity when a body is on_wall 2021-08-24 11:29:40 +02:00
jmb462 5de6376a22 Fix Raycast3D color update when not colliding anymore 2021-08-24 11:24:02 +02:00
Rémi Verschelde 92a7ae022d
Merge pull request #51769 from The-O-King/oct_split_stream_fix
Fix Octahedral/Split Stream Options
2021-08-18 08:01:56 +02:00
Omar El Sheikh a63028e172 Fix Octahedral/Split Stream Options
Update mesh_surface_get_format_stride and
mesh_surface_make_offsets_from_format to return an array of offsets and
an array of strides in order to support vertex stream splitting

Update _get_array_from_surface to also support vertex stream splitting

Add a condition on split stream usage to ensure it does not get used on
dynamic meshes

Handle case when Tangent is compressed but Normal is not compressed

Make stream splitting option require a restart in the settings

Update SoftBody and Sprite3D to support and use strides and offsets
returned by updated visual_server functions

Update Sprite3D to use the dynamic mesh flag
2021-08-17 16:11:47 -04:00
Rémi Verschelde c0fc475078
Merge pull request #51521 from lawnjelly/portals_occluders
Sphere occluders (portals and general use)
2021-08-17 13:55:34 +02:00
Rémi Verschelde e321b5c12f
Merge pull request #51489 from nekomatata/fix-moving-platform-3d-snap-3.x
[3.x] Fix 2D/3D character snap on moving platforms
2021-08-17 11:40:17 +02:00
lawnjelly 115f4dce55 Sphere occluders (portals and general use)
Add framework for supporting geometrical occluders within rooms, and add support for sphere occluders.
Includes gizmos for editing.

They also work outside the portal system.
2021-08-17 09:02:06 +01:00
Gordon MacPherson f038c6a926 Fix octahedral compression with Sprite3D
Needs a default which is not zero
2021-08-16 22:25:44 +01:00
PouleyKetchoupp be13538b71 Fix 3D character snap on moving platforms
Applying the platform velocity when leaving the platform floor should be
done after snapping to keep things consistent.

Now it's done in both 2D and 3D, as it's already done in 2D on master.
2021-08-16 11:30:28 -07:00
Rémi Verschelde dc1b18e832
Merge pull request #51743 from fabriceci/3x-avoid-useless-snap
[3.x] Avoid useless call to move and collide during snapping
2021-08-16 20:19:39 +02:00
fabriceci 2cb364bab1 Avoid to snap when the body is already on the floor. 2021-08-16 18:09:44 +02:00
Rémi Verschelde e2e34812fe
Merge pull request #51556 from fabriceci/fix-move-and-slide-regression-multiple-collision-3x
[3.x] Fix move and slide regression by allowing multiple collision direction
2021-08-12 20:37:48 +02:00
Rémi Verschelde f3441fcff0
i18n: Sync translations with Weblate
And sync template with current 3.x codebase.
2021-08-12 17:08:10 +02:00
Morris Tabor a517ed7c6d Fix CPU Particles spread
Fixes https://github.com/godotengine/godot/issues/51162
This is the same change as for the GPU Particles in https://github.com/godotengine/godot/pull/47310, including the recent fix for zero direction vectors.
2021-08-12 14:00:02 +02:00
fabriceci 1d5a01d12d Fix regression by allowing multiple collision direction 2021-08-12 12:23:17 +02:00
Haoyu Qiu f4a6737eed Improve NavigationMesh typing, parameter validation and documentation 2021-08-11 18:18:27 +08:00
Rémi Verschelde 03c41fa34c
Merge pull request #51458 from nekomatata/moving-platforms-3d-3.x
[3.x] Fix 3D moving platform logic
2021-08-10 14:12:47 +02:00
clayjohn f7dbcf95e1 Allow unclamped colors in Sprite3D 2021-08-09 21:44:21 -07:00
PouleyKetchoupp da159cd258 Fix 3D moving platform logic
Same thing that was already done in 2D, applies moving platform motion
by using a call to move_and_collide that excludes the platform itself,
instead of making it part of the body motion.

Helps with handling walls and slopes correctly when the character walks
on the moving platform.

Also made some minor adjustments to the 2D version and documentation.

Co-authored-by: fabriceci <fabricecipolla@gmail.com>
2021-08-09 18:55:49 -07:00
Rémi Verschelde 0403cb8ad5
Merge pull request #51447 from nekomatata/fix-moving-platform-rotation-3.x
[3.x] Fix applied rotation from moving platforms in move_and_slide
2021-08-09 23:20:35 +02:00
PouleyKetchoupp f101349225 Fix applied rotation from moving platforms in move_and_slide
When synchronizing KinematicBody motion with moving the platform using
direct body state, only the linear velocity was taken into account.

This change exposes velocity at local point in direct body state and
uses it in move_and_slide to get the proper velocity that includes
rotations.
2021-08-09 12:04:57 -07:00
Rémi Verschelde 89313b9ed1
Merge pull request #51403 from lawnjelly/portals_move_settings
Portals - fix PVS generation and move settings
2021-08-09 00:17:13 +02:00
lawnjelly f3e6547a99 Portals - fix PVS generation and move settings
Fixed a bug in the complex PVS generation which was causing recursive loop.
Move some of the settings out of RoomManager into Project Settings.
Allow PVS generation method to be selected from Project Settings, and control PVS logging.
2021-08-08 19:57:27 +01:00
Rémi Verschelde 0b461cbb01
Merge pull request #51218 from timothyqiu/more-i18n-3x
[3.x] Fix various i18n failures
2021-08-08 19:24:45 +02:00
Rémi Verschelde be22d7b013
Merge pull request #51396 from lawnjelly/portals_sprite3d
Portals - add support for Sprite3D
2021-08-08 17:47:32 +02:00
Rémi Verschelde 6149304c3a
Merge pull request #51394 from lawnjelly/portals_fix_log_crash
Portals - fix crash when logging link room names
2021-08-08 17:47:05 +02:00
Rémi Verschelde 52b3891b59
Merge pull request #51392 from lawnjelly/portals_autolink_internal
Portals - fix autolinking to internal rooms
2021-08-08 17:46:37 +02:00
lawnjelly fc3c01db0f Portals - add support for Sprite3D
Add support for Sprite3D and animated Sprite3D.
2021-08-08 15:43:24 +01:00
lawnjelly ef894c0966 Portals - fix crash when logging link room names
The checking for link room IDs was checking for less than size(), but was not correctly checking for -1,
and therefore reading outside the array range. This PR fixes this.
2021-08-08 15:00:39 +01:00
lawnjelly a339f6fc49 Portals - fix autolinking to internal rooms
Portal autolinking was previously agnostic to room priorities, which meant that portals would link to the first room they found (often outside rooms). This PR fixes this by making the autolinking priority aware, and will preferentially link to internal rooms.
2021-08-08 14:37:04 +01:00
lawnjelly cfe806a929 Portals - Fix secondary PVS bug
Fixes a bug whereby it read from the primary PVS in the gameplay monitor, using the size from the secondary PVS. This would read out of bounds and crash.

Removed debug code to update the gameplay monitor from the preview camera - this is no longer required.

Temporarily revert to the simple PVS generation method, because I've noticed a bug in the complex version, and the simple version is safer while I fix this.
2021-08-08 14:02:38 +01:00
Raul Santos 102ec1042b Fix Path3D initial forward calculation 2021-08-07 12:40:14 +02:00
lawnjelly 770d9f8220 Portals - add gizmo handles for editing portals and rooms
Gizmo handles are added for much more user friendly editing of portals and room bounds.
2021-08-06 07:53:22 +01:00
Rémi Verschelde 28b5f07355
Merge pull request #51277 from lawnjelly/portals_debug_collision_shapes 2021-08-05 16:39:03 +02:00
lawnjelly 258831c12e Portals - fix showing debug collision shapes
Set the portal_mode to GLOBAL on creation.
2021-08-05 13:28:11 +01:00
lawnjelly f4c5092027 Portals - rooms_set_active needs Editor check
Calling rooms_set_active with TOOLS_ENABLED from a running project resulted in a crash because the Spatial Editor is not available. Wrapped it in an is_editor_hint.
2021-08-05 13:14:00 +01:00
Haoyu Qiu 87e49183bc Fix various i18n failures 2021-08-03 23:36:43 +08:00
Raul Santos d46d66020e
Fix forward calculation in PathFollow3D for the position at the end of the curve
(cherry picked from commit e23f6a5bba)
2021-08-03 10:18:04 +02:00
Rémi Verschelde 73c6ab0215
Merge pull request #51152 from lawnjelly/portals_improve_ui 2021-08-02 14:40:18 +02:00
lawnjelly 2eae35693e Portals - change import naming convention to postfix
In response to user demand, the naming convention for importing levels from blender etc is changed from prefixes `Room_` and `Portal_` to postfixes `-room`, `-roomgroup`, `-portal`.
2021-08-02 11:04:02 +01:00
lawnjelly 8c4c6a93b0 Portals - Remove node naming restrictions
The use of special prefixes is only actually required during the import phase - the first conversion of rooms, roomgroups, and portals from Spatials and MeshInstances (based on the workflow of importing from blender).

Once converted to the native Godot nodes there is no longer a need for the naming requirements.

This PR removes the requirements except for the import. Manual portal linking after the initial conversion is now done exclusively using the `linked_room` nodepath property of the Portal.
2021-08-01 20:04:58 +01:00
lawnjelly 776623d56b Portals - Improve UI and add shortcuts
This PR makes the 'convert rooms' button permanently on the toolbar and accessible whichever node is selected, so you can convert rooms without having to select the RoomManager first.

It also adds a togglable item 'view portal culling' to the 'View' menu which is a simple way of setting the RoomManager 'active' setting without the RoomManager being the selected node.

Both of these have keyboard shortcuts, which should make it much faster to reconvert rooms and edit.

In addition there the string in the 'Perspective' Listbox is modified to show [portals active] when portal culling is operational, for visual feedback. This is updated when you change modes, and when the rooms are invalidated.
2021-08-01 19:54:16 +01:00