Commit Graph

203 Commits

Author SHA1 Message Date
Víctor Aguilera Puerto
578ae1cf9e Add percentage of intersection to Box2 (#1169) 2020-07-07 18:13:51 +02:00
Tyler Young
9cbdd1058c Use CannyFastMath & Update Some Packages (#1130)
update a bunch of packages and use JetBrains.Annotations as private asset as needed

mark some hot math methods agg inline to benefit from loop opts

use FMA for interp

use canny min/max/clamp

make Quaternion NormalizeAngle fixed time and faster

clean up YamlDotNet references
2020-06-18 02:25:36 +02:00
Pieter-Jan Briers
3459e5fd0b Remove explicit x64 platform target to fix ARM64 builds. 2020-06-08 23:36:08 +02:00
ComicIronic
dec76c9ad9 Fix lasers changing DrawingHandleWorld transform (#1103) 2020-06-06 14:26:33 +02:00
Pieter-Jan Briers
24eab7ef3a Fix YAML ColorSerializer, optimize Color.ToHex() 2020-05-23 02:38:36 +02:00
Pieter-Jan Briers
8b90bdf875 Tuple and deconstruct helpers for Vector4 & Color. 2020-04-09 16:46:33 +02:00
Pieter-Jan Briers
6200ba01e6 CMYK helpers on Color. 2020-04-09 16:46:14 +02:00
Acruid
a947a38f3c View Rotation (#1016)
* Adds a derived class from Nunit's Is test constraint class.
The game camera can now be rotated.

* Added the new `bind` command to the console, used to bind a key to a keybind.
Added two new keybinds for rotating the View camera left and right.
Added more info to the ""Component does not exist for state" exception.
Added Reduced() and FlipPositive() public functions to Angle.

* Fix a copy/paste bug.

* Adds missing code to bind/unbind CameraRotateLeft.
Camera snapping now actually uses the CameraSnapTolerance constant.
2020-03-25 02:22:18 +01:00
Pieter-Jan Briers
32bafb66a8 Shadows & FOV. (#992)
* Work on shadow casting.

* Shadowcasting depth works, code cleanup

* Adds #include support to SWSL parser.

* Move lighting shader to swsl.

Also more shader parser fixes.

* Move PI constant to correct file.

* Got functional FOV, working on wall bleed.

* Hey, it kinda works.

* Occluder component now lives in shared.

* Optimizations.

* Fix light map color format.

I set it to something else while testing perf.

* Front face cull final FOV pass.

* Fix holes in occlusion geometry due to disabled occluders.

* Starting work on better wall handling.

* Some comments.

* Improve font-face-culled FOV pass.

* Improve various light biasing things.

* VSM, smooth shadows.

Also unused VSM blurring because it didn't work but committing it like this will forever keep it in Git somewhere.

* FOV smoothing, looks kinda awful.

* Base wall bleed blur strength on camera size.

* The part where I give up.

* Comments. Many comments.

* Allow eyes to disable FOV.

* Improve OccluderComponent on the client.

* Update for occluder component changes.

* Maybe do this properly...
2020-02-23 17:18:58 +01:00
Tyler Young
755675eaab Introduce DynamicTree, Separate Ray from CollisionRay (#951)
* separates Rays from CollisionRays, removing collision masking from Ray

* Entity, ClientEntityManager and EntityManager classes occasionally need to UpdateEntityTree

Entity intersection queries now use a DynamicTree

DynamicTree now correctly reports Count and separately NodeCount

DynamicTree now has optionally precise queries

DynamicTree no longer incorrectly Adds on AddOrUpdate if Update is not necessary

Entity startup now starts Transform, then Collidable, then remaining components

EntityManger's Entity dictionary is now a ConcurrentDictionary to support iteration under modification

DynamicTree freeing root leaf no longer results in invalid tree

SnapGridComponent has been extended to support additional area and directional queries

* added lots of calls to UpdateEntityTree, will need to scale back during review

fixed moved/changed AABB updates to DynamicTree, missed a ref

converted other methods in EntityManager to use the tree for spatial queries

* add unit tests for DynamicTree

make Capacity and EnsureCapacity public, setting Capacity will call EnsureCapacity

* fix brace style

* Box2 Grow -> Enlarged, Combine -> Union
2020-02-06 14:13:15 +01:00
Pieter-Jan Briers
9b8c122f03 Enable nullability for Robust.Shared.Maths 2020-01-22 23:56:13 +01:00
Pieter-Jan Briers
e7ccef53de Update NuGet dependencies. 2020-01-20 20:41:01 +01:00
Pieter-Jan Briers
132f15b32d Rendering optimizations. 2020-01-20 17:45:33 +01:00
Pieter-Jan Briers
5c77c1a8b8 Color.[Try]FromHex now takes ROS<char> and no longer allocates.
Also added a test to ensure it works.
2020-01-12 01:56:27 +01:00
Pieter-Jan Briers
3c08f56619 Sprite orientation improvements (#917)
* Fold animation delays into a single set for all directions.

* Update systems to use new RSI animations API.

* Fetching layer directions now done in sprite render.

* Allow overriding direction in SpriteView.
2019-12-24 01:15:44 +01:00
Pieter-Jan Briers
d075c82041 Switch to C# 8 2019-12-17 16:06:46 +01:00
DamianX
c67a1475f9 Added Color.TryFromHex (#900) 2019-11-22 19:50:58 +01:00
Pieter-Jan Briers
68db826e8e Add + (float, float, float, float) operators to UIBox2.
Extremely convenient to work with.
2019-10-18 01:05:35 +02:00
Pieter-Jan Briers
5252b1e99b Add some extra helpers to Box2. 2019-10-13 15:22:47 +02:00
Pieter-Jan Briers
9868f186f3 Remove some unecessary NuGet dependencies. (#871)
Also made the window icon work again.
2019-09-24 12:42:59 +02:00
Pieter-Jan Briers
5d5b897a9b Property animations track (#867)
* WiP property animations system

* Use better lerp for Angle property animations.

* Fix handling of offset in sprite component.

* Allow animating some sprite layer properties.

* Allow animating some Transform properties.

Obviously not advisable for server entities, but great for client side entities!

* Improve animation property interpolation handling.

Added a "previous" mode.
Made values that cannot be sanely interpolated fall back to this mode.

* Improve some animation docs.
2019-09-17 22:57:12 +02:00
Acruid
f2eb035ed8 Physics Shapes (#847)
* Adds a new IPhysicsShape object where you can define what collisions shape a PhysBody has.
AABB is now accessed through the PhysicsShape, so the BoundingBoxComponent is not required.

* Default PhysShape now copies the AABB of the BoundingBoxComponent.

* Fixed issue with serialization of PhysShapeAabbComp.

* Spatial queries now use ICollidableComponent instead of BoundingBoxComponent.
showbb now draws entities using the obsolete BoundingBoxComponent in Aqua.

* Renamed PhysShapeAabbComp to PhysShapeAabb.
Removed BoundingBoxComponent.

* Default CollidableComponent does not collide with anything now.

* Renamed ICollidable to IPhysBody.
Moved ICollidable to the Robust.Shared/Physics namespace.

* PhysShapes are now a collection of primitive shapes that contribute to the whole PhysBody.
ObjectSerializer.DataField can now deal with abstract types using YAML tags.

* Added LocalBounds property to ClickableComponent.
Added state to ClickableComponent.

* Added a Rectangle physics shape.

* ClickableComponent now actually checks that a click is inside its bounds.

* Reverted the addition of a try/catch around map loading. Any errors can propagate to the code trying to load the map again.
2019-09-03 22:06:50 +02:00
Pieter-Jan Briers
0a5f9d4b0b Fix parallax gen being broken on Windows. 2019-08-29 23:08:33 +02:00
Pieter-Jan Briers
eff7fa8408 Remove PrivateAssets rules from shared. 2019-08-27 23:11:01 +02:00
Pieter-Jan Briers
51989a8ccc Mark a bunch of packages as private assets.
This will prevent them being referenced in content, so stuff like OpenTK isn't "accessible" from Content.Client.
2019-08-27 22:51:31 +02:00
Pieter-Jan Briers
c16ef6ce77 Update all the NuGet packages. 2019-08-27 22:38:49 +02:00
DamianX
7dc32af73f DefaultColorsInverted ignores duplicates (#853) 2019-08-25 23:45:33 +02:00
DamianX
943b000950 Things for wires (#852)
* Things for wires

* Fixed things
2019-08-25 23:18:03 +02:00
DamianX
7f9f593989 Implemented RobustRandom (#845)
* Implemented RobustRandom

* Fixed RandomString
2019-08-16 21:43:59 +02:00
Pieter-Jan Briers
768fed2421 Optimize Matrix3 Vector2 transforms. 2019-08-11 01:01:40 +02:00
Pieter-Jan Briers
98c1e43fe6 Optimize that color lerp more because I wanted to mess with SIMD. 2019-08-11 00:21:05 +02:00
Pieter-Jan Briers
72c4d56639 Remove a bunch of oldcode from FloatMath.
Did we need to store 256 KiB worth of inaccurate sin/cos lookup? Nah.
2019-08-08 00:41:03 +02:00
Pieter-Jan Briers
e7bf2d0ac9 Use MathF for sqrt in vector types. 2019-08-07 23:16:05 +02:00
Pieter-Jan Briers
8d0012223e Optimize sRGB conversions on .NET Core. 2019-08-07 15:47:49 +02:00
Pieter-Jan Briers
78416ad157 Refactor Color.InterpolateBetween to be faster and make more sense. 2019-08-07 14:52:14 +02:00
Pieter-Jan Briers
fc4e3be40a Replace SS14 noise dependency with FastNoise. 2019-08-07 14:51:23 +02:00
Pieter-Jan Briers
57fb38c04d Improve Random.NextFloat() to be faster. 2019-08-07 14:50:48 +02:00
Pieter-Jan Briers
e62021cb92 Try to work around space-wizards/space-station-14#284 2019-08-03 15:07:43 +02:00
Pieter-Jan Briers
c0eca4f6c2 .NET Core support. 2019-08-02 02:07:03 +02:00
Pieter-Jan Briers
120cab811f Implement tuple -> vector conversions for double vectors. 2019-07-30 18:48:05 +02:00
Pieter-Jan Briers
da1baba550 Add cast from Vector2u to Vector2i. 2019-07-26 12:20:34 +02:00
Acruid
de68a62187 Box2Rotated & Vector2 Rotation (#827)
* Adds a function to rotate a vector by an Angle.
Adds the Box2Rotated struct for holding a rotated box.

* Use ApproxEqualityConstraint
2019-07-19 21:48:40 +02:00
Pieter-Jan Briers
09c36b57cd Shift half of Clyde around to implement better outline rendering. (#830)
* Attempted Clyde cleanup, didn't get far.

* Add negation operator to Vector2i.

* Add RenderOrder to ISpriteComponent.

* Post process shaders.

Adds "post process" shaders to sprite component.
These are executed on the WHOLE sprite component (every layer)
in one draw.

This is necessary to implement functional outlines.
2019-07-06 19:17:33 +02:00
Pieter-Jan Briers
00f6564351 Update some NuGet dependencies. 2019-05-29 01:45:31 +02:00
Pieter-Jan Briers
bb4a1eda8e Project file refactor (#819)
* Project file refactor

Move all the .csproj files to the new .NET Core style.
This doesn't make any difference for compiling for Framework,
but it does reduce a ton of useless boilerplate.

As an extension of this, killed a bunch of uncompiled & unmaintained .cs files.

Compiling for release (to profile) works now.
Removed AnyCPU targets from the solution file.

* Fix compiler warnings.
2019-05-28 00:16:01 +02:00
Pieter-Jan Briers
f954bcb3e8 Switch to .NET Framework 4.7.2 2019-05-11 16:09:55 +02:00
Pieter-Jan Briers
dec103ac1b Remove GameController.Mode
The difference between headless and Clyde is now handled by IoC.
2019-05-08 22:24:50 +02:00
Pieter-Jan Briers
6da21ab6c1 Clyde correct sRGB support.
This makes light stacking look less... awful.

Also minor cleanup.
2019-05-08 14:37:48 +02:00
Pieter-Jan Briers
e032557c08 Fix Angle.Equals(object). 2019-05-05 15:43:59 +02:00
Acruid
1b3cc8aba6 Grid Bounds (#800)
* Added centered unit box static field to Box2.

* MapGrid is more testable.

* Added some unit tests for MapGrid.
Fixed bug in MapChunk.GridTileToLocal().
MapGrid.UpdateAABB() actually expands properly now.

* Moved IMapChunk to Robust.Shared.Map.
Moved Chunk class out of MapManager class.

* Added unit tests for MapChunk.

* Bounds reduce by 1, so almost working.

* Now bound shrinking works :D

* Moved MapGrid out of MapManager.
Moved IMapGrid into the Shared/Map folder.
Replaced all calls to IMapGrid.ParentMap.Index with IMapGrid.ParentMapId.

* Added more MapGrid unit tests.
Fixed a bug in TryGetTileRef.
2019-04-29 12:43:20 +02:00