Commit Graph

5 Commits (ba76d304dc8f425473f176e631312b1421b761ec)

Author SHA1 Message Date
Ken Pruiksma b455b915a8
Making terrain query resolution a single float instead of a Vector2 (#7186)
* Making terrain query resolution a single float instead of a Vector2

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Keeping the concept of different x/y step sizes in region queries since that may be useful and is separate from query resolution. Also keeping the concept of different x/y step sizes in physics since that's independent of the terrain gem.

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Formatting cleanups

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* A few more minor cleanups

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Added support to convert serialized Vector2 query resolution to a single float.

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Switch ray intersection check back to using separate values for x and y resolution

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Fixing new unit tests added to use float query resolution.

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Updating automated test

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>
4 years ago
bosnichd f34d3a822e
Add a ray cast API to the terrain system, implement it, and use it so entities can be placed on top of terrain. (#6895)
* Add a ray cast API to the terrain system, implement it, and use it so entities can be placed on top of terrain.

Still to do:
- Unit tests
- Profiling/benchmarks
- Optimization (if needed, may not be now after updating to use the iterative approach, but one option could be to use SIMD to ray cast against both triangles at once)

Signed-off-by: bosnichd <bosnichd@amazon.com>

* Fix typos.

Signed-off-by: bosnichd <bosnichd@amazon.com>

* Added a FindNearestIntersectionIterative to use in place of the first-pass FindnearestIntersectionRecursive attempt.

Signed-off-by: bosnichd <bosnichd@amazon.com>

* Remove some functions that are no longer being used.

Signed-off-by: bosnichd <bosnichd@amazon.com>

* Remove a unicode character from a comment to fix the validation build.

Signed-off-by: bosnichd <bosnichd@amazon.com>

* Remove another unicode character from a comment to fix the validation build.

Signed-off-by: bosnichd <bosnichd@amazon.com>

* Update to bail out as soon as t > 1.0f

Signed-off-by: bosnichd <bosnichd@amazon.com>
4 years ago
amzn-sj 7bba4172ec Add a GetNumSamplesFromRegion function which returns the number of samples given a region and step size. Update Terrain Feature Processor to use this function to get the number of samples instead of computing num samples independently.
Signed-off-by: amzn-sj <srikkant@amazon.com>
4 years ago
amzn-sj 5dc442fcb0
[Terrain] First pass of the ProcessList and ProcessRegion APIs for retrieving surface data (#6729)
* [Terrain] First pass of the ProcessList and ProcessRegion APIs for retrieving surface data

Signed-off-by: amzn-sj <srikkant@amazon.com>

* Add a couple of more tests. The expected values were plugged in based on the values generated by the brute force approach.

Signed-off-by: amzn-sj <srikkant@amazon.com>

* Move some declarations out of loops since they can be reused.

Signed-off-by: amzn-sj <srikkant@amazon.com>

* Update all the per position callbacks to pass SurfacePoint refs. Construct only one SurfacePoint object outside the loop which can be reused.

Signed-off-by: amzn-sj <srikkant@amazon.com>

* Update tests to use the new per position callbacks

Signed-off-by: amzn-sj <srikkant@amazon.com>

* Add ProcessRegion functions to the terrain benchmark.

Signed-off-by: amzn-sj <srikkant@amazon.com>

* Change C style static casts to aznumeric_cast. Add maybe_unused to unused params in benchmarks.

Signed-off-by: amzn-sj <srikkant@amazon.com>

* Update the ProcessList API functions to use array_view instead of a vector. This includes some additional changes to satisfy build dependencies.

Signed-off-by: amzn-sj <srikkant@amazon.com>

* Add ProcessList API functions to benchmarks

Signed-off-by: amzn-sj <srikkant@amazon.com>

* Update the ProcessList API functions to take Vector2 as input positions

Signed-off-by: amzn-sj <srikkant@amazon.com>

* Revert changes to AtomCore library split. Add partial implementation of span(mostly just copied over from array_view) to AzCore std containers.

Signed-off-by: amzn-sj <srikkant@amazon.com>

* Adding some const/non-const overloads that were missing in span

Signed-off-by: amzn-sj <srikkant@amazon.com>

* Move input position list generation to a function

Signed-off-by: amzn-sj <srikkant@amazon.com>

* Bring back Vector3 version of ProcessList functions. Rename Vector2 version to follow similar pattern as the Get functions.

Signed-off-by: amzn-sj <srikkant@amazon.com>

* Split span.h into .h/.inl files

Signed-off-by: amzn-sj <srikkant@amazon.com>

* Add [mayby_unused] for unused parameters to fix build errors

Signed-off-by: amzn-sj <srikkant@amazon.com>
4 years ago
John Jones-Steele 2259cb3dc0
Moved TerrainDataRquestBus to AzFrameworkTestShared (#5835)
* Moved TerrainDataRquestBus to AzFrameworkTestShared

Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>

* Changes from PR

Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>
4 years ago