Replace xform.WorldPosition with xformSystem method for Setting/Getting (#30029)

* GET WORLD POSITON, ROTATION

* Missing parentheses

* ui system depndency

* the issue

* Unused

* Let the function do the transform

---------

Co-authored-by: plykiya <plykiya@protonmail.com>

(cherry picked from commit a87efd7d0157a0c4074e639b1da923f5c335f663)
This commit is contained in:
Plykiya
2024-08-06 14:02:01 +03:00
committed by Spatison
parent a81887ce45
commit aaeda1b538
31 changed files with 83 additions and 55 deletions

View File

@@ -22,6 +22,7 @@ public sealed class ContainmentFieldGeneratorSystem : EntitySystem
[Dependency] private readonly PhysicsSystem _physics = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedPointLightSystem _light = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
[Dependency] private readonly TagSystem _tags = default!;
public override void Initialize()
@@ -234,7 +235,7 @@ public sealed class ContainmentFieldGeneratorSystem : EntitySystem
if (!gen1XForm.Anchored)
return false;
var genWorldPosRot = gen1XForm.GetWorldPositionRotation();
var genWorldPosRot = _transformSystem.GetWorldPositionRotation(gen1XForm);
var dirRad = dir.ToAngle() + genWorldPosRot.WorldRotation; //needs to be like this for the raycast to work properly
var ray = new CollisionRay(genWorldPosRot.WorldPosition, dirRad.ToVec(), component.CollisionMask);