Skip to content

Commit fc6bcc4

Browse files
committed
Add legacy fixes
1 parent 0a2ae70 commit fc6bcc4

File tree

6 files changed

+135
-53
lines changed

6 files changed

+135
-53
lines changed

Core/Game/Abilities/Essential/Turn.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ public class Turn : Ability
1010
private Vector2d
1111
_turnRate = Vector2d.CreateRotation (FixedMath.One / 8);
1212
#endregion
13-
private LSBody_ Agent.Body;
1413
private bool targetReached;
1514
private Vector2d targetRotation;
1615
private long turnSin;

Core/Simulation/Physics/Core/Editor/EditorLSBody.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace Lockstep.Integration
77
{
88
[CustomEditor(typeof(UnityLSBody), true),UnityEditor.CanEditMultipleObjects]
9-
public class EditorLSBody : Editor
9+
public class EditorLSBody_ : Editor
1010
{
1111

1212
SerializedProperty Shape;

Core/Simulation/Physics/Core/LSBody.cs

100644100755
Lines changed: 131 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111

1212
namespace Lockstep
1313
{
14-
[System.Serializable]
1514
public partial class LSBody : MonoBehaviour
1615
{
1716
#region Core deterministic variables
1817

1918
[SerializeField] //For inspector debugging
20-
internal Vector2d _position;
19+
internal Vector2d _position;
2120
[SerializeField]
2221
internal Vector2d _rotation = Vector2d.up;
2322
[SerializeField, FixedNumber]
@@ -36,9 +35,6 @@ private bool ForwardNeedsSet {
3635
set { _forwardNeedsSet = value; }
3736
}
3837

39-
40-
41-
4238
private Vector2d _forward;
4339

4440
public Vector2d Forward {
@@ -133,7 +129,7 @@ public Vector2d Velocity {
133129
public bool SetPositionBuffer { get; private set; }
134130
//ND
135131

136-
132+
137133
public bool RotationChangedBuffer { get; private set; }
138134
//D
139135
private bool SetRotationBuffer { get; set; }
@@ -145,30 +141,29 @@ public Vector2d Velocity {
145141

146142
private bool Setted { get; set; }
147143

148-
144+
149145
public long VelocityFastMagnitude { get; private set; }
150146

151147

152-
public bool Active {get; private set;}
153148

154-
private void AddChild (LSBody_ child)
149+
private void AddChild (LSBody child)
155150
{
156151
if (Children == null)
157-
Children = new FastBucket<LSBody_> ();
152+
Children = new FastBucket<LSBody> ();
158153
Children.Add (child);
159154
}
160155

161-
private void RemoveChild (LSBody_ child)
156+
private void RemoveChild (LSBody child)
162157
{
163158
Children.Remove (child);
164159
}
165160

166-
private FastBucket<LSBody_> Children;
161+
private FastBucket<LSBody> Children;
167162
public Vector2d[] RealPoints;
168163
public Vector2d[] Edges;
169164
public Vector2d[] EdgeNorms;
170165

171-
166+
172167
public long XMin { get; private set; }
173168

174169
public long XMax { get; private set; }
@@ -186,7 +181,7 @@ private void RemoveChild (LSBody_ child)
186181

187182
public long HeightMax { get; private set; }
188183

189-
public delegate void CollisionFunction (LSBody_ other);
184+
public delegate void CollisionFunction (LSBody other);
190185

191186
private Dictionary<int,CollisionPair> _collisionPairs;
192187
private HashSet<int> _collisionPairHolders;
@@ -203,7 +198,7 @@ internal HashSet<int> CollisionPairHolders {
203198
}
204199
}
205200

206-
internal void NotifyContact (LSBody_ other, bool isColliding, bool isChanged)
201+
internal void NotifyContact (LSBody other, bool isColliding, bool isChanged)
207202
{
208203
if (isColliding) {
209204
if (isChanged) {
@@ -212,7 +207,7 @@ internal void NotifyContact (LSBody_ other, bool isColliding, bool isChanged)
212207
}
213208
if (onContact != null)
214209
onContact (other);
215-
210+
216211
} else {
217212
if (isChanged) {
218213
if (onContactExit != null)
@@ -235,32 +230,32 @@ internal void NotifyContact (LSBody_ other, bool isColliding, bool isChanged)
235230

236231
#region Serialized
237232

238-
[SerializeField]
233+
[SerializeField, FormerlySerializedAs ("Shape")]
239234
protected ColliderType _shape = ColliderType.None;
240235

241236
public ColliderType Shape { get { return _shape; } }
242237

243-
[SerializeField]
238+
[SerializeField, FormerlySerializedAs ("IsTrigger")]
244239
private bool _isTrigger;
245240

246241
public bool IsTrigger { get { return _isTrigger; } }
247242

248-
[SerializeField]
243+
[SerializeField, FormerlySerializedAs ("Layer")]
249244
private int _layer;
250245

251246
public int Layer { get { return _layer; } }
252247

253-
[SerializeField,FixedNumber]
248+
[SerializeField,FixedNumber, FormerlySerializedAs ("HalfWidth")]
254249
private long _halfWidth = FixedMath.Half;
255250

256251
public long HalfWidth { get { return _halfWidth; } }
257252

258-
[SerializeField,FixedNumber]
253+
[SerializeField,FixedNumber, FormerlySerializedAs ("HalfHeight")]
259254
public long _halfHeight = FixedMath.Half;
260255

261256
public long HalfHeight { get { return _halfHeight; } }
262257

263-
[SerializeField,FixedNumber]
258+
[SerializeField,FixedNumber, FormerlySerializedAs ("Radius")]
264259
protected long _radius = FixedMath.Half;
265260

266261
public long Radius { get { return _radius; } }
@@ -270,40 +265,27 @@ internal void NotifyContact (LSBody_ other, bool isColliding, bool isChanged)
270265

271266
public bool Immovable { get; private set; }
272267

273-
[SerializeField]
268+
[SerializeField, FormerlySerializedAs ("_priority")]
274269
private int _basePriority;
275270

276271
public int BasePriority { get { return _basePriority; } }
277272

278-
[SerializeField]
273+
[SerializeField, FormerlySerializedAs ("Vertices")]
279274
private Vector2d[] _vertices;
280275

281276
public Vector2d[] Vertices { get { return _vertices; } }
282277

283278
[SerializeField, FixedNumber]
284279
private long _height = FixedMath.One;
285280

286-
public long Height { get {return _height;} }
287-
281+
[Lockstep (true)]
282+
public long Height { get {return _height;}}
288283

289284
[SerializeField]
290285
private Transform _positionalTransform;
291286

292287
public Transform PositionalTransform { get ; set; }
293288

294-
295-
[SerializeField]
296-
private Transform _rotationalTransform;
297-
298-
public Vector3 _rotationOffset;
299-
300-
public Transform RotationalTransform { get; set; }
301-
302-
303-
#endregion
304-
305-
#region Runtime Values
306-
307289
private bool _canSetVisualPosition;
308290

309291
public bool CanSetVisualPosition {
@@ -315,6 +297,13 @@ public bool CanSetVisualPosition {
315297
}
316298
}
317299

300+
[SerializeField]
301+
private Transform _rotationalTransform;
302+
303+
public Vector3 _rotationOffset;
304+
305+
public Transform RotationalTransform { get; set; }
306+
318307
private bool _canSetVisualRotation;
319308

320309
public bool CanSetVisualRotation {
@@ -332,11 +321,113 @@ public Vector3d Position3d {
332321
}
333322
}
334323

324+
#endregion
325+
335326
private Vector2d[] RotatedPoints;
336327

328+
public void Setup (LSAgent agent)
329+
{
337330

338-
#endregion
331+
}
332+
333+
private bool OutMoreThanSet { get; set; }
334+
335+
public bool OutMoreThan { get; private set; }
336+
337+
public void GeneratePoints ()
338+
{
339+
340+
}
341+
342+
public void GenerateBounds ()
343+
{
344+
345+
}
346+
347+
public void Initialize (Vector3d StartPosition, Vector2d StartRotation, bool isDynamic = true)
348+
{
349+
350+
}
351+
352+
void CheckVariables ()
353+
{
354+
355+
}
356+
357+
public void BuildPoints ()
358+
{
359+
360+
}
361+
362+
public void BuildBounds ()
363+
{
364+
365+
}
366+
367+
368+
public void Simulate ()
369+
{}
370+
371+
372+
public void BuildChangedValues ()
373+
{
374+
375+
}
376+
377+
public void SetVisuals ()
378+
{
379+
380+
}
381+
382+
private void DoSetVisualPosition (Vector3 pos)
383+
{
384+
385+
}
386+
387+
private void DoSetVisualRotation (Vector2d rot)
388+
{
389+
390+
}
391+
392+
public void SetExtrapolatedVisuals ()
393+
{
394+
395+
}
396+
397+
Vector3 lastVisualPos;
398+
Quaternion lastVisualRot;
399+
Quaternion visualRot = Quaternion.identity;
400+
401+
public void Visualize ()
402+
{
403+
}
404+
405+
public void LerpOverReset ()
406+
{
407+
408+
}
409+
410+
411+
412+
413+
414+
415+
void Reset ()
416+
{
417+
418+
}
419+
420+
void OnDrawGizmos ()
421+
{
422+
}
339423

340424
}
341425

426+
public enum ColliderType : byte
427+
{
428+
None,
429+
Circle,
430+
AABox,
431+
Polygon
432+
}
342433
}

Core/Simulation/Physics/Core/LSBody.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Core/Simulation/Physics/Core/LSBody_.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,11 +857,12 @@ public long SquareSize {
857857

858858
}
859859

860+
/*
860861
public enum ColliderType : byte
861862
{
862863
None,
863864
Circle,
864865
AABox,
865866
Polygon
866-
}
867+
}*/
867868
}

Core/Simulation/Physics/Core/Legacy.meta

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)