Commit Graph
152 Commits
Author SHA1 Message Date
Vera Aguilera Puerto ba2fbd99a8 Revert "Fix broadphase RemoveBody issue (#2318)"
Caused severe issues, such as firelocks not having collision and some funny exceptions.
This reverts commit fd1a1d326c.
2021-12-11 20:59:44 +01:00
Vera Aguilera Puerto 4fc46ac814 Transform DetachParentToNull sets map to nullspace before raising the event. 2021-12-11 15:32:10 +01:00
metalgearslothandGitHub fd1a1d326c Fix broadphase RemoveBody issue (#2318) 2021-12-11 14:08:57 +01:00
Paul RitterandGitHub e84604f7e3 Fixes pvs culling & make budgets more granular (#2322) 2021-12-11 12:11:16 +01:00
Vera Aguilera Puerto 9133879bd3 Remove more IoCManager IEntityManager resolves
Also adds convenience "Deleted" method to IEntityManager
2021-12-08 10:53:24 +01:00
Wrexbe 4df03f859b Fix release building 2021-12-07 09:50:07 -08:00
metalgearsloth 8377acb672 more cast memes 2021-12-07 22:14:44 +11:00
metalgearsloth 84c14a4657 Remove redundant IComponent casts 2021-12-07 21:53:44 +11:00
DrSmugleaf 163deff564 Fix 3000 errors 2021-12-05 18:13:33 +01:00
20kdc 8aa6fb478b Susser Todd: Robust.Shared, Error Pass 2 "It Now Compiles" 2021-12-03 19:36:16 +00:00
20kdc 5e7d617736 Susser Todd: Robust.Shared, Error Pass 1 2021-12-03 18:40:55 +00:00
Vera Aguilera Puerto 5eda1b326d Inline OwnerUid 2021-12-03 16:30:34 +01:00
Vera Aguilera Puerto 7a06db60cf Inline UID 2021-12-03 15:53:10 +01:00
Vera Aguilera Puerto 94e6886a85 Inline Transform 2021-12-03 14:20:35 +01:00
Vera Aguilera Puerto e93ae73e50 Inline TryGetComponent completely, for real 2021-12-03 14:17:01 +01:00
Vera Aguilera Puerto b44a1cde88 Inline HasComponent entirely 2021-12-03 12:23:18 +01:00
Vera Aguilera Puerto 86d05dfa1e Inline GetComponent 2021-12-03 11:55:25 +01:00
Vera Aguilera Puerto f782e76671 Inline EntityManager 2021-12-03 11:11:52 +01:00
44649eea1c pvs refactor (#2247)
Co-authored-by: Paul <ritter.paul1+git@googlemail.com>
2021-11-30 15:07:08 +01:00
metalgearslothandGitHub 20aec0a8f9 Add method to get worldpos and worldrot at the same time (#2226)
* Add method to get worldpos and worldrot at the same time

Somewhat of a gain because it halves the number of GetComponent<TransformComponent> + _parent.IsValid() calls

* Remove redundant methods

* Also inverse

* Test

* Import

* Add benchmark

* Delete benchmark
2021-11-26 01:47:51 -08:00
Vera Aguilera Puerto 079e099a3b Makes many things use OwnerUid instead of Owner.Uid 2021-11-09 15:11:02 +01:00
Vera Aguilera Puerto 9b215098e4 Remove ITransformComponent. 2021-11-08 12:49:55 +01:00
Vera Aguilera Puerto 8e8bfbe0cc Obsolete ITransformComponent 2021-11-08 12:28:49 +01:00
Vera Aguilera Puerto 58638c9109 Make TransformComponent public, IEntity keeps a reference to TransformComponent. 2021-11-08 12:21:34 +01:00
Vera Aguilera PuertoandGitHub 2f2a397ecf Fix TransformComponent access modifiers (#2207)
Part 1 of ITransformComponent removal.
2021-11-08 12:18:53 +01:00
metalgearslothandGitHub 225446920a Make transform delete entity if parent invalid (#2193) 2021-11-02 17:54:48 +01:00
metalgearslothandGitHub aa339eb504 Add component that toggles collision on anchoring (#2113) 2021-10-09 18:27:31 +02:00
metalgearsloth 9305b261bb Decrease angular sleep tolerance 2021-10-08 14:15:54 +11:00
metalgearslothandGitHub ebaba35e8b Aggressively sleep physics bodies (#2078)
* Aggressively sleep physics bodies

* Fix tests

* Also buff angular damping
2021-09-29 20:06:56 +10:00
Vera Aguilera PuertoandGitHub fbcdd63988 Gets rid of most ComponentManager usages. (#2076)
- Obsoletes more `ComponentManager` fields/properties.
2021-09-28 13:36:18 +02:00
Vera Aguilera Puerto 15778d3af4 Fix some warnings regarding IComponentManager. 2021-09-28 12:41:49 +02:00
metalgearslothandGitHub 68576ace72 Accurate grid bounds (#2027)
* Fright night

* Shitty bounds working

* No more fixture leak

* Optimise TryFindGridAt

Should be O(1) now instead of the previous O(n) for number of fixtures

* ambush

* Merge stuffies

* Merge to master

* Fixes I guess

* Fix client sync

* Fix grid deserialization

* Jank test

* Fix deferral shitfuckery

* Optimise and remove

* Fixes

* Just werk dam u

* Optimisations

* Bunch of fixes

* FINALLY IT'S DONE

* Fixes

* Fix

* Comment
2021-09-20 21:07:31 +10:00
VisneandGitHub a5be8e723e Remove some unused obsolete stuff (#2049) 2021-09-20 10:59:50 +02:00
metalgearsloth 42a137d106 Raise anchoring broadcasted 2021-09-17 00:06:02 +10:00
metalgearsloth b91fa6ba75 Reduce position approx tolerance 2021-09-16 14:03:33 +10:00
metalgearslothandGitHub 699615df97 Remove Snapus Gridus (#2014) 2021-09-12 16:34:51 +10:00
metalgearslothandGitHub 766f6dc93d EntityLookup flags for PVS optimisations (#1983)
* The real lookup flags

* Don't get anchored entities for PVS query

* Finish that implementation

* Immediate anchoring changes

* Woops some anchoring slippy

* Address review
2021-08-29 14:03:45 +10:00
e5013d9e3f Add support for struct directed events, add by-ref directed/broadcast events. (#1931)
* Add support for struct directed events.
- Turn transform events into readonly structs

* TransformComponent events have readonly fields.

* Reduce boxing allocations, add DirectedRegistration readonly struct.

* Use typeof in a few places instead of GetType

* Add overloads to allow passing directed events by ref.

* Raise transform events by ref.

* Fix occluder AnchorStateChangedEvent subscription

* Fix broadphase subscriptions

* Fix bug oops

* Fix transform system raising moveevents by value

* Don't reflect the test entity systems.

* Directed EventBus uses ref everywhere, internally
Deduplicates a bunch of code. Whoo!

* Add broadcast by-ref events

* Fix by-ref events bug using Unsafe, add new tests for sorted by-ref events.

* Port broadcast events to by-ref.

* Speed, more correctness, reduce generics bloat.

* Clean up subscription code some.

* Remove bad test.

Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2021-08-21 11:37:02 +02:00
metalgearsloth 1a547b946c Fix anchoring parent changes
Problem was coordinates were updated first and then it was clearing the snapgrid cell.
2021-08-20 14:14:17 +10:00
d58e380dd9 MapManager now uses accurate bounds for grids (#1918)
* MapManager now uses accurate bounds for grids

Instead of using the old WorldBounds (which was dirty for multiple reasons) it goes through physics instead using the actual fixtures attached to the grid.

* Fix nuke

* Test time

* AABB tests

* feex

* how is this failing aaa

* feex tests

* slightly better

Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2021-08-06 22:25:14 +10:00
Vera Aguilera Puerto f9f55b6862 Transform sets GridId before raising EntParentChangedMessage event. 2021-08-01 13:35:58 +02:00
Vera Aguilera Puerto 83a5560850 Transform EntMapIdChangedMessage is raised directed. 2021-08-01 12:20:45 +02:00
metalgearslothandGitHub 7bac32d18e Don't use DeferMoveEvent if the position is NaN (#1896)
The issue is that currently moving around means any non-anchored entities have their positions updated to / from NaN. As you can imagine this is a performance nightmare for anything subscribing to it, especially considering it leads to the broadphase getting desynced for physics.

Realistically we need one of the alternatives Acruid has laid out because flooding the eventbus with NaNs will kill performance.
2021-07-28 00:28:07 +10:00
AcruidandGitHub dadd7b4cc3 Remove Static Component NetIds (#1842)
* ComponentNames are not sent over the network when components are created.

* Removed ComponentStates array from EntityState, now the state is stored directly inside the CompChange struct.

* Remove the unnecessary NetID property from ComponentState.

* Remove Component.NetworkSynchronizeExistence.

* Change GetNetComponents to return both the component and the component NetId.

* Remove public usages of the Component.NetID property.

* Adds the NetIDAttribute that can be applied to components.

* Removed Component.NetID.

* Revert changes to GetComponentState and how prediction works.

* Adds component netID automatic generation.

* Modifies ClientConsoleHost so that commands can be called before Initialize().

* Completely remove static NetIds.

* Renamed NetIDAttribute to NetworkedComponentAttribute.

* Fixing unit tests.
2021-07-12 10:23:13 +02:00
Pieter-Jan Briers 07dafeb6cd Can now rotate anchored entities 2021-07-02 01:16:25 +02:00
AcruidandGitHub 713f702064 Engine Entity Anchoring (#1829)
* Added unit tests for the new anchor system design.

* Amend ME!

* SnapGridComponent now anchors the entity when added or removed.
TransformComponent.Anchored properly replicates it's state to clients.

* Converted all SnapGridPositionChangedEvent subscriptions to AnchorStateChangedEvent.
Removed SnapGridPositionChangedEvent.
Obsoleted SnapGridComponent.

* Allows setting Transform.Anchored in prototypes.

* Changing tile to empty under anchored ents unanchors them.

* More unit testing.

* Migrated transform gamestate tests to RobustServerSimulation.

* Fixed nasty off-by-one error when sending a full server state.

* Adds lifetime stages to Component.

* More test fixing.

* Review changes.
2021-06-19 17:26:18 -07:00
AcruidandGitHub 40586a8f0e Removes all engine component events. (#1832) 2021-06-18 10:44:21 +02:00
20kdcandGitHub ed2be48864 Fix Coordinates setter destroying local position during a parent change by migrating parent changes to it (#1763)
This fixes computer boards going missing. (Seriously.)
2021-05-22 11:36:18 +02:00
a6dae8e30a GridId caching (#1678)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2021-05-17 11:43:22 +02:00
Pieter-Jan Briers 720f1b1d05 Fix a bunch of compiler warnings. 2021-05-12 00:16:12 +02:00