4524 Commits

Author SHA1 Message Date
Kawe Mazidjatari
29e57e1605 Recast: allow modifying brush types of existing primitive volumes 2024-09-22 15:26:50 +02:00
Kawe Mazidjatari
feaca14e8a Recast: left panel UX improvements
Make it slightly larger (20 units) and make the sliders wider as well.
2024-09-22 14:28:34 +02:00
Kawe Mazidjatari
5f3abdb656 Recast: select primitive volume by volume hit index
As of commit 2a2b05c42ada643eb3a535b497d0da7e16ebef41, the primitive volume index is sent to the click handler. Use this instead of relying on a point being inside a shape which is unreliable.
2024-09-22 14:13:39 +02:00
Kawe Mazidjatari
2a2b05c42a Recast: sent intersected primitive volume index to click handler
Click handler should be notified about the primitive volume that the ray collided with, which will make selecting objects in the world a lot more reliable and easier.
2024-09-22 14:11:44 +02:00
Kawe Mazidjatari
9e46c8be75 Recast: implement primitive shape volume editor
Allows for selecting already created volumes and modifying or deleting them.
2024-09-22 12:27:45 +02:00
Kawe Mazidjatari
da66a7b9c1 Recast: implement shape volume highlighting in renderer
Highlight shape volume by index, will be used by the shape volume tool for editing.
2024-09-22 01:23:37 +02:00
Kawe Mazidjatari
e9e1a96310 Recast: make sure shape editor and shape instance max vert count is always the same
Use the same constant for class ShapeVolumeTool and struct ShapeVolume, since we do plan on increasing this in the future. Having multiple constants can cause hard to find problems when tweaking this.
2024-09-22 00:40:12 +02:00
Kawe Mazidjatari
be27f75442 Recast: rename shape volume tool source files
Source files were named after the convex polygon volume shape, but the tool can now handle more primitive shapes. Renamed to avoid future confusion.
2024-09-22 00:33:48 +02:00
Kawe Mazidjatari
3eb505e169 Recast: update default render offsets
Render recast geometry at its original location, render detour geometry 4 units from its original z-axis to avoid clipping. The previous values were too extreme and caused the cursor to visibly clip in recast geometry.
2024-09-21 22:32:13 +02:00
Kawe Mazidjatari
01f1361e26 Recast: implement masking in raycast algorithm
Allow caller to filter out what to collide with. For the editor cursor, we want to test on everything (including triggers). For the traverse link algorithm, we only want to test on clip brushes or world geometry as traversing through a trigger volume is valid.
2024-09-21 22:09:32 +02:00
Kawe Mazidjatari
f82c3fcc35 Recast: rework raycast algorithm and fix several bugs
* Only run rcGetChunksOverlappingSegment when we do intersection queries on world geometry (major optimization).
* Always find the closest intersection if caller provided tmin, and skip out if caller didn't while our ray intersected with something (major optimization for larger levels with a high number of primitive volumes).
* Reduce max overlapping chunk indices to 512, this was increased to 4096 during the initial coordinate system conversion but this was not necessary and ultimately bloated the stack.
2024-09-21 21:43:12 +02:00
Kawe Mazidjatari
b37a77d547 Recast: enforce consistency in intersection code
Some code uses different timing bounds. Enforce consistency between all code utilizing this.
2024-09-21 12:26:34 +02:00
Kawe Mazidjatari
eb6a3b37d2 Recast: implement intersection test for convex hulls
Similar to the intersection test for cylindric volumes. The old convex hull intersection test in the raycast algorithm is inaccurate and also doesn't calculate the hit time, which prevents the editor from placing the cursor at the intersection. Raycast algorithm is pending a refactor and its convex hull isect test will be replaced with this.
2024-09-21 12:22:02 +02:00
Kawe Mazidjatari
3a51c4f8c9 Recast: take cylinder caps into account during intersection test
Cylinder caps were not accounted for and thus tmin/tmax were never set causing incorrect ray tracing results when intersecting with a cylinder cap.
2024-09-20 21:54:24 +02:00
Kawe Mazidjatari
c952f59920 Recast: add ability to delete cylinder and AABB volumes as well 2024-09-20 16:01:39 +02:00
Kawe Mazidjatari
32f470f2ed Recast: add functions for checking if point is in cylinder and AABB 2024-09-20 16:00:23 +02:00
Kawe Mazidjatari
162f5fb3c7 Recast: fix convex volume deletion (XZY -> XYZ)
Missed coordinate system conversion change.
2024-09-20 15:07:44 +02:00
Kawe Mazidjatari
290f78f8c8 Recast: fully implement cylindric and AABB shape volumes
Cylindric and AABB volumes can now also be used to mark out area's on the NavMesh. The raycast tests now also take the new shapes into account. User can now also add shapes through the ShapeVolumeTool (previously ConvexVolumeTool). The geomset format has changed slightly:
- identifier 'o' now maps to off-mesh links (previously 'c').
- identifier 'p' now maps to convex polygon volumes (previously 'v').
- identifier 'c' maps to cylinder volumes.
- identifier 'b' maps to box volumes.
2024-09-20 15:03:30 +02:00
Kawe Mazidjatari
0722def4d8 Recast: deduplicate AABB intersection test in CrowdTool 2024-09-20 14:58:22 +02:00
Kawe Mazidjatari
4640a81d09 Recast: add cylindric and AABB intersection functions
'rdIntersectSegmentCylinder' is a new function that will be used for intersection tests on cylindric clip volumes.
'rdIntersectSegmentAABB' was already present in the library, but used and reimplemented across multiple source files (pending deduplication).
2024-09-20 14:55:45 +02:00
Kawe Mazidjatari
f98b3b9bff Recast: fix order of cylinder vertex drawing (XZY -> XYZ)
Face normals were flipped after the coordinate system change. This patch solves the issue.
2024-09-20 11:43:55 +02:00
Kawe Mazidjatari
98756f1a0b Recast: reorder function
Was in between area markers, move it above.
2024-09-20 00:30:52 +02:00
Kawe Mazidjatari
11e83769b5 Recast: also assign flags to compact height field in rcMarkCylinderArea
This function is currently not in use, but will be used.
2024-09-20 00:18:23 +02:00
Kawe Mazidjatari
d0c4c0497d Recast: allow ability to mark AABB box area on NavMesh
Very useful utility when automating the creation of geometry bounding boxes to be used to mark and flag certain polygons on the navmesh (e.g. a door or hazard area through bounding boxes from a mesh or box-shaped trigger).
2024-09-20 00:10:03 +02:00
Kawe Mazidjatari
4083318f83 Recast: separate box creation code from renderer
Allow usage in external code.
2024-09-20 00:07:00 +02:00
Kawe Mazidjatari
8758550602 Recast: make tile size correct for larger navmeshes
Should be 60, which results in 960x960 tile dimensions for _large and _extra_large navmeshes (identical to r2 _large navmeshes).
2024-09-19 16:59:56 +02:00
Kawe Mazidjatari
4a9bfbe79a Recast: vastly improve reliability of land-side off-mesh link tile query
Instead of a box query, just take the position in the tile grid the land-side off-mesh vert is on. This vastly improves the query reliability for off-mesh links with a larger radius to the point it never fails if it is in a valid location. The box query isn't needed here as the off-mesh vert has to be on a tile, else the polygon box query will fail (unless its bounding box does happen to overlap with the point, but in this case the off-mesh connection is placed improperly causing the only factor to have its link established being luck).
2024-09-19 15:44:23 +02:00
Kawe Mazidjatari
2ed18dc6e0 Recast: clean up editor class
Reorder and remove non-existent method declarations.
2024-09-19 13:52:10 +02:00
Kawe Mazidjatari
ee59793118 Recast: default to layered partitioner
Watershed results in bad geometry around stairs or slopes near complex geometry. Layered partitioning results in much better results in these cases.
2024-09-19 13:51:28 +02:00
Kawe Mazidjatari
3cd61a499d Tier1: constify ConVar_ParseFlagString 2024-09-19 00:12:27 +02:00
Kawe Mazidjatari
b2d0db40ef Recast: properly flag off-mesh connection polygons
MSET 7 or higher needs proper off-mesh connection flags.
2024-09-19 00:11:49 +02:00
Kawe Mazidjatari
30570981e1 Recast: move poly flags and area enums to Detour NavMesh header
Also needs to be used in building and query code, moved to Detour NavMesh header.
2024-09-19 00:02:37 +02:00
Kawe Mazidjatari
d5fa52499c Recast: combine off-mesh link basing and land connection logic
Combine the 2 to avoid an extra loop. Also break out of tile grid loop as soon as a link has been established to save even more processing time.
2024-09-18 17:28:10 +02:00
Kawe Mazidjatari
8eaa349dbc Recast: assign dtOffMeshConnection::userId
Was never assigned properly.
2024-09-18 17:24:08 +02:00
Kawe Mazidjatari
b042327629 Recast: fix incorrect dtOffMeshConnection::userId offset
Field offset was incorrect for MSET 7 or higher.
2024-09-18 17:23:00 +02:00
Kawe Mazidjatari
1a0b6efae5 Recast: properly set traverse type fields in off-mesh connections for MSET 7 or higher
The structure was incorrect prior to this patch for MSET 7 or higher.
2024-09-18 11:41:33 +02:00
Kawe Mazidjatari
3259b03fdd Server: name unknown field in CAI_TraverseNode
Confirmed to be the traverse type.
2024-09-18 01:50:19 +02:00
Kawe Mazidjatari
0b568488e3 RapidJSON: fix bug when parsing NaN, Inf with fraction or exponent parts
Merge Tencent/rapidjson@7c73dd7de7
2024-09-16 17:48:25 +02:00
Kawe Mazidjatari
a6d4a53021 Recast: make proper wrappers for radians and degrees conversion
Avoid bugs where radians gets converted to radians, or degrees to degrees.
2024-09-16 16:29:46 +02:00
Kawe Mazidjatari
10efa56c58 Engine: don't run NVIDIA Reflex if -gfx_disableLowLatency was specified
This command line argument should fully disable NVIDIA Reflex, AMD Anti-Lag 2 and PCL statistics.
2024-09-16 16:27:02 +02:00
Kawe Mazidjatari
0eb0d73ae1 Game: make AI utility class instance static
Static allocation instead of dynamic.
2024-09-16 14:15:15 +02:00
Kawe Mazidjatari
986fe4a93d Tier2: rename curl params field name
'cust' -> 'user'.
2024-09-16 13:58:33 +02:00
Kawe Mazidjatari
8f384e424d VScript: constify callback parameters 2024-09-16 13:52:13 +02:00
Kawe Mazidjatari
2afa6d6c64 VScript: log duration of code callbacks 2024-09-16 13:46:36 +02:00
Kawe Mazidjatari
531fa21af1 VScript: add structures for closure and function proto 2024-09-16 13:37:08 +02:00
Kawe Mazidjatari
5bfa34d016 ModSystem: properly purge and delete all mods on destruction 2024-09-16 12:14:14 +02:00
Kawe Mazidjatari
10161f5f9e ModSystem: constify
Make const where possible.
2024-09-16 12:13:39 +02:00
Kawe Mazidjatari
6509983350 ModSystem: implement ParseConVars properly
The implementation was commented as it was unfinished. The code now properly checks if the convar was already registered. The code now also deallocates the convar memory on shutdown.
2024-09-16 12:08:38 +02:00
Kawe Mazidjatari
dbdafd44e4 Recast: fix toggle for all polygon flags
1<<16 will overflow u16 by 1.
2024-09-16 11:49:21 +02:00
Kawe Mazidjatari
ebd89d934f NVIDIA: only run and shutdown PCL stats if it has been initialized 2024-09-15 12:45:26 +02:00