203 Commits

Author SHA1 Message Date
metalgearsloth
209eb5fea0 Fix 90% of grid rotation bugs (#2003)
* View box2rotated

* Changes

* Stash someday

* Sync

* Grid rotation in a commit

* SIMD comment

* Minor TryFindGridAt optimisation

* More fixes

* Optimise rays a tad

* Reduce code duplication

* Fix anchoring

* More fixes woopsie

* Eye matching parent

* Centre of mass stuffsies

* Remove TODO

* Add TODO

* Revert anchor crash

* Fix master merge-in whoopsie

* Fixes

* Woops

* Fixed viewport transform

* Re-fix rendering
2021-09-16 12:59:16 +10:00
Pieter-Jan Briers
52eb581b56 Fix some compiler warnings. 2021-09-15 15:55:27 +02:00
Pieter-Jan Briers
577b2b0f62 Remove OutputPath overrides for shared.
Pretty sure this will reduce recompilation when switching between debug and release in rider, so sounds like a good idea to me.
2021-08-30 01:38:28 +02:00
Pieter-Jan Briers
ef7ef3ca9f Replace usages of NET5_0 preprocessor with NET5_0_OR_GREATER 2021-08-22 11:08:05 +02:00
metalgearsloth
456ac03870 Add RevoluteJoint (#1953) 2021-08-18 17:48:52 +02:00
Visne
96a098a0c2 Fix outline when eye is rotated (#1929) 2021-08-06 09:53:14 +02:00
metalgearsloth
f780f04784 Deprecate PhysShapeGrid (#1862)
* Grid fixtures

* termp

* Fixes

* Test reversion reversion?

* Tests

* Fix Equals

* Slight box2i cleanup

* Better initializer

* Also add static grid assert
2021-07-14 18:47:17 +10:00
metalgearsloth
e0b1a7d64a Add Contains Vector2 method to Box2Rotated (#1851) 2021-07-11 22:49:59 +10:00
Galactic Chimp
14fa616723 #1224 removed obsolete FloatMath class (#1800) 2021-06-03 00:11:19 +02:00
Vera Aguilera Puerto
c6b74e998f Use System.Numerics in a few Box2 methods to speed them up (#1708) 2021-04-19 17:18:09 +02:00
Pieter-Jan Briers
4bc775c01c RSI loader improvements:
1. Stop using NJsonSchema, it didn't do anything useful.
2. Use System.Text.Json instead of Newtonsoft.Json.
3. General cleanup of the code, using arrays instead of lists, etc...
2021-03-08 11:18:19 +01:00
metalgearsloth
c17c8d7a11 Physics (#1605)
* Physics worlds

* Paul's a good boy

* Build working

* Ingame and not lagging to hell

* Why didn't you commit ahhhhh

* Hard collisions working

* Solver parity

* Decent broadphase work done

* BroadPhase outline done

* BroadPhase working

* waiting for pvs

* Fix static PVS AABB

* Stop static bodies from awakening

* Optimise a bunch of stuff

* Even more broadphase stuff

* I'm fucking stupid

* Optimise fixture updates

* Collision solver start

* Building

* A is for Argumentative

* Fix contact caching island flags

* Circle shapes actually workeded

* Damping

* DS2 consumables only

* Slightly more stable

* Even slightlier more stablier

* VV your heart out

* Initial joint support

* 90% of joints I just wanted to push as I'd scream if I lost progress

* JOINT PURGATORY

* Joints barely functional lmao

* Okay these joints slightly more functional

* Remove station FrictionJoint

* Also that

* Some Box2D ports

* Cleanup mass

* Edge shape

* Active contacts

* Fix active contacts

* Optimise active contacts even more

* Boxes be stacking

* I would die for smug oh my fucking god

* In which everything is fixed

* Distance joints working LETS GO

* Remove frequency on distancejoint

* Fix some stuff and break joints

* Crashing fixed mehbeh

* ICollideSpecial and more resilience

* auto-clear

* showbb vera

* Slap that TODO in there

* Fix restartround crash

* Random fixes

* Fix fixture networking

* Add intersection method for broadphase

* Fix contacts

* Licenses done

* Optimisations

* Fix wall clips

* Config caching for island

* allocations optimisations

* Optimise casts

* Optimise events queue for physics

* Contact manager optimisations

* Optimise controllers

* Sloth joint or something idk

* Controller graph

* Remove content cvar

* Random cleanup

* Finally remove VirtualController

* Manifold structs again

* Optimise this absolute retardation

* Optimise

* fix license

* Cleanup physics interface

* AHHHHHHHHHHHHH

* Fix collisions again

* snivybus

* Fix potential nasty manifold bug

* Tests go snivy

* Disable prediction for now

* Spans

* Fix ShapeTypes

* fixes

* ch ch changeesss

* Kinematic idea

* Prevent static bodies from waking

* Pass WorldAABB to MoveEvent

* Fix collisions

* manifold structs fucking WOOORRKKKINNGGG

* Better pushing

* Fix merge ickies

* Optimise MoveEvents

* Use event for collisions performance

* Fix content tests

* Do not research tests

* Fix most conflicts

* Paul's trying to kill me

* Maybe collisions work idk

* Make us whole again

* Smug is also trying to kill me

* nani

* shitty collisions

* Settling

* Do not research collisions

* SHIP IT

* Fix joints

* PVS moment

* Fix other assert

* Fix locker collisions

* serializable sleeptime

* Aether2D contacts

* Physics is no longer crashing (and burning)

* Add to the TODO list

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
2021-03-08 03:19:01 +11:00
Pieter-Jan Briers
d751c0b3ab Revert "Physics (#1602)"
This reverts commit fefcc7cba3.
2021-02-28 18:45:18 +01:00
metalgearsloth
fefcc7cba3 Physics (#1602)
* Physics worlds

* Paul's a good boy

* Build working

* Ingame and not lagging to hell

* Why didn't you commit ahhhhh

* Hard collisions working

* Solver parity

* Decent broadphase work done

* BroadPhase outline done

* BroadPhase working

* waiting for pvs

* Fix static PVS AABB

* Stop static bodies from awakening

* Optimise a bunch of stuff

* Even more broadphase stuff

* I'm fucking stupid

* Optimise fixture updates

* Collision solver start

* Building

* A is for Argumentative

* Fix contact caching island flags

* Circle shapes actually workeded

* Damping

* DS2 consumables only

* Slightly more stable

* Even slightlier more stablier

* VV your heart out

* Initial joint support

* 90% of joints I just wanted to push as I'd scream if I lost progress

* JOINT PURGATORY

* Joints barely functional lmao

* Okay these joints slightly more functional

* Remove station FrictionJoint

* Also that

* Some Box2D ports

* Cleanup mass

* Edge shape

* Active contacts

* Fix active contacts

* Optimise active contacts even more

* Boxes be stacking

* I would die for smug oh my fucking god

* In which everything is fixed

* Distance joints working LETS GO

* Remove frequency on distancejoint

* Fix some stuff and break joints

* Crashing fixed mehbeh

* ICollideSpecial and more resilience

* auto-clear

* showbb vera

* Slap that TODO in there

* Fix restartround crash

* Random fixes

* Fix fixture networking

* Add intersection method for broadphase

* Fix contacts

* Licenses done

* Optimisations

* Fix wall clips

* Config caching for island

* allocations optimisations

* Optimise casts

* Optimise events queue for physics

* Contact manager optimisations

* Optimise controllers

* Sloth joint or something idk

* Controller graph

* Remove content cvar

* Random cleanup

* Finally remove VirtualController

* Manifold structs again

* Optimise this absolute retardation

* Optimise

* fix license

* Cleanup physics interface

* AHHHHHHHHHHHHH

* Fix collisions again

* snivybus

* Fix potential nasty manifold bug

* Tests go snivy

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
2021-03-01 03:09:36 +11:00
Pieter-Jan Briers
d5199ec459 Update NuGet packages. 2021-02-25 12:06:05 +01:00
Alex Evgrashin
393c15c44a Post shader will use real sprite bounding box (#1536)
Co-authored-by: Alex Evgrashin <evgrashin.adl@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2021-02-23 22:54:48 +01:00
Pieter-Jan Briers
17fe000a1e Fix math tests due to angle/direction changes. 2021-02-21 20:06:39 +01:00
Pieter-Jan Briers
fba415e765 Bit of work to make Direction.South == Angle.Zero.
This makes Direction no longer follow a cartesian trig circle but oh well. Also helper methods to work with this.

Math tests currently fail, pushing this so Acruid can see about fixing SpriteComponent.
2021-02-21 19:47:42 +01:00
Pieter-Jan Briers
583b7ebf38 WPF layout (#1581) 2021-02-21 12:28:13 +01:00
Acruid
de0bd1887f Sprite Rendering Bugfixes (#1551)
* Added documentation to Clyde on the sprite rendering calls.

* Added a rotation debug entity.

* Non-directional RSIs and raw textures are now rotated properly.

* Directional RSIs and Sprite Smoothing work.

* Remove the Directional flag usages.

* Supports layers with different numbers of directions.

* Fixes window rendering.
2021-02-20 11:06:08 -08:00
Vera Aguilera Puerto
dbe9a96dfa Reorganizes NumericsHelpers into different files using partial classes. (#1514) 2021-01-29 12:46:27 +01:00
Ygg01
ad8b0b3c83 Add bytes or sbytes to enum where available (#1430)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-12-08 12:46:30 +01:00
Paul Ritter
f157cdce02 Rotatable bounding boxes (#1360)
Co-authored-by: Paul <ritter.paul1+git@googlemail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-12-07 17:01:57 +01:00
Pieter-Jan Briers
6296171b63 Move some shared engine properties to a new msbuild file. 2020-11-28 18:05:16 +01:00
Pieter-Jan Briers
3767a7d285 Make [UI]Box2[i] unions with their primary corners as fields.
This uses .NET 5's new Unsafe.SkipInit() function and a lot of FieldOffset.

The result of this is that you can now take a `ref` to the primary corners of the boxes, as well as better codegen in some cases.
2020-11-26 02:00:05 +01:00
DrSmugleaf
b8e5b47e7a Use 'new' expression in places where the type is evident for the engine (#1415)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-11-26 00:16:55 +01:00
Víctor Aguilera Puerto
26d1a04bbf Fix missing returns on certain AdvSimd paths causing incorrect results. 2020-11-25 13:31:49 +01:00
Víctor Aguilera Puerto
088b2da90a Fix AdvSimd Min for NumericsHelpers 2020-11-25 11:20:54 +01:00
Víctor Aguilera Puerto
6b780c55fd Numerics Helpers: SIMD accelerated array math methods (#1380)
* Numerics helpers

* Comments

* Reuse naive methods for remainders.

* Do naive operation if array length is under 4.

* NumericsHelpers takes in Span, can store elsewhere

* Make some spans read-only

* Enabled static property to disable/enable hardware accelerated paths.

* AVX support.

* welp

* .

* environment variable to disable simd

* Adds ARM support (AdvSimd)

* Fix AVX horizontal sum

* Add unit tests

* NET 5.0 moment

* RemoteExecutor moment

* Add nuget.config to the UnitTesting project only

* Add "ROBUST" prefix to env vars

* Better naming for array length utils

* Revert "Add nuget.config to the UnitTesting project only"

This reverts commit 1d474ff33d.

* Ignore ARM tests, remove #if NET5_0
2020-11-25 10:47:38 +01:00
Paul Ritter
5f940fdec6 Removes some unused variables (#1420)
Co-authored-by: Paul <ritter.paul1+git@googlemail.com>
2020-11-24 00:51:35 +01:00
Pieter-Jan Briers
2ca5d30e9d C# 9.
Insert glasses joke here.
2020-11-24 00:50:38 +01:00
DrSmugleaf
cace2eb88c Update Color.DarkSeaGreen to match .NET 5's (#1412)
* Update Color.DarkSeaGreen to match .NET 5's

* Update doc
2020-11-20 13:56:24 +01:00
Pieter-Jan Briers
49d2ef96b9 Use [SkipLocalsInit] 2020-11-11 01:19:55 +01:00
Víctor Aguilera Puerto
96b5779078 Improve math helper for next multiple. 2020-11-02 18:14:09 +01:00
Víctor Aguilera Puerto
6299302025 Adds math helper to get the next closest multiple of a number given a value. (#1378) 2020-11-02 17:04:10 +01:00
Pieter-Jan Briers
6102ee80ec Make math types mutable. 2020-10-12 17:38:24 +02:00
DrSmugleaf
da76788751 Replace MapIndices to Vector2i (#1318) 2020-10-11 14:33:09 +02:00
Paul Ritter
56b85256bf Things needed for singulo (#1306)
* things

* direction loopup table

* spinbox lineedit isvalid wasn't using isvalid
spinbox disabled functions

* fixes placementmanager

* pjb fixes
2020-10-09 14:55:19 +02:00
Pieter-Jan Briers
4ce4fb9a9f A more true-to-Box2D DynamicTree.
It's fast.

Could still do with some bounds check elimination I guess.
2020-09-23 19:48:31 +02:00
nuke
17402b69f7 Add Color.ToHexNoAlpha (#1275) 2020-09-03 14:36:51 +02:00
Pieter-Jan Briers
79b3b51498 Fix bad #region. 2020-08-20 20:46:03 +02:00
Pieter-Jan Briers
cc8addd34e Adds integer clamps. 2020-08-20 20:45:52 +02:00
Pieter-Jan Briers
0958ce3e51 MathHelper make use of MathF better. 2020-08-20 20:41:22 +02:00
Visne
9d1bec9bb2 Merge FloatMath and MathHelper (#1234)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-08-20 19:21:07 +02:00
Víctor Aguilera Puerto
5819e5ee92 Adds GetCardinalDir extension 2020-08-15 03:18:51 +02:00
Pieter-Jan Briers
d4a47778ef Remove this parameter from FloatMath.Clamp.
That was a stupid idea.
2020-08-12 21:17:18 +02:00
Pieter-Jan Briers
b45ea725d7 Remove CannyFastMath. 2020-08-12 21:17:17 +02:00
Víctor Aguilera Puerto
5bb3bc7083 Remove CannyFastMath usage from Box2 and Box2i. 2020-08-12 21:02:13 +02:00
Víctor Aguilera Puerto
44bcbfa8e5 Misc changed needed for atmos (#1186)
* Add needed changes for atmos

* Get delays for RSI state

* Placement hijack can handle deletion on gridcoordinates

* Array serialization

* MapIndices to GridCoordinates

* CollidableComponent creates VirtualControllers using IDynamicTypeFactory

* Probability assert now prints chance

* Remove unused stuff, fix build

* Update documentation for map indices

* readability

* Removed unused using statements

* Remove ToAngle

* Fix messed up merge

* Fix MapIndices/GridCoordinates conversion

* Add "invalid" direction.

* Update Robust.Shared/Serialization/YamlObjectSerializer.cs

* Nullable fix

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2020-08-02 18:39:23 +02:00
Acruid
3fd1a2f3fb Fill out cases for the shape switch.
Circle-Box collisions!

Circle Collisions!

PhysShapeCircle!
2020-07-31 12:02:41 -07:00