1111
1212namespace Lockstep
1313{
14- [ System . Serializable ]
1514public 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 ]
2221internal Vector2d _rotation = Vector2d . up ;
2322[ SerializeField , FixedNumber ]
@@ -36,9 +35,6 @@ private bool ForwardNeedsSet {
3635set { _forwardNeedsSet = value ; }
3736}
3837
39-
40-
41-
4238private Vector2d _forward ;
4339
4440public Vector2d Forward {
@@ -133,7 +129,7 @@ public Vector2d Velocity {
133129public bool SetPositionBuffer { get ; private set ; }
134130//ND
135131
136-
132+
137133public bool RotationChangedBuffer { get ; private set ; }
138134//D
139135private bool SetRotationBuffer { get ; set ; }
@@ -145,30 +141,29 @@ public Vector2d Velocity {
145141
146142private bool Setted { get ; set ; }
147143
148-
144+
149145public 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{
156151if ( Children == null )
157- Children = new FastBucket < LSBody_ > ( ) ;
152+ Children = new FastBucket < LSBody > ( ) ;
158153Children . Add ( child ) ;
159154}
160155
161- private void RemoveChild ( LSBody_ child )
156+ private void RemoveChild ( LSBody child )
162157{
163158Children . Remove ( child ) ;
164159}
165160
166- private FastBucket < LSBody_ > Children ;
161+ private FastBucket < LSBody > Children ;
167162public Vector2d [ ] RealPoints ;
168163public Vector2d [ ] Edges ;
169164public Vector2d [ ] EdgeNorms ;
170165
171-
166+
172167public long XMin { get ; private set ; }
173168
174169public long XMax { get ; private set ; }
@@ -186,7 +181,7 @@ private void RemoveChild (LSBody_ child)
186181
187182public long HeightMax { get ; private set ; }
188183
189- public delegate void CollisionFunction ( LSBody_ other ) ;
184+ public delegate void CollisionFunction ( LSBody other ) ;
190185
191186private Dictionary < int , CollisionPair > _collisionPairs ;
192187private 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{
208203if ( isColliding ) {
209204if ( isChanged ) {
@@ -212,7 +207,7 @@ internal void NotifyContact (LSBody_ other, bool isColliding, bool isChanged)
212207}
213208if ( onContact != null )
214209onContact ( other ) ;
215-
210+
216211} else {
217212if ( isChanged ) {
218213if ( 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" ) ]
239234protected ColliderType _shape = ColliderType . None ;
240235
241236public ColliderType Shape { get { return _shape ; } }
242237
243- [ SerializeField ]
238+ [ SerializeField , FormerlySerializedAs ( "IsTrigger" ) ]
244239private bool _isTrigger ;
245240
246241public bool IsTrigger { get { return _isTrigger ; } }
247242
248- [ SerializeField ]
243+ [ SerializeField , FormerlySerializedAs ( "Layer" ) ]
249244private int _layer ;
250245
251246public int Layer { get { return _layer ; } }
252247
253- [ SerializeField , FixedNumber ]
248+ [ SerializeField , FixedNumber , FormerlySerializedAs ( "HalfWidth" ) ]
254249private long _halfWidth = FixedMath . Half ;
255250
256251public long HalfWidth { get { return _halfWidth ; } }
257252
258- [ SerializeField , FixedNumber ]
253+ [ SerializeField , FixedNumber , FormerlySerializedAs ( "HalfHeight" ) ]
259254public long _halfHeight = FixedMath . Half ;
260255
261256public long HalfHeight { get { return _halfHeight ; } }
262257
263- [ SerializeField , FixedNumber ]
258+ [ SerializeField , FixedNumber , FormerlySerializedAs ( "Radius" ) ]
264259protected long _radius = FixedMath . Half ;
265260
266261public long Radius { get { return _radius ; } }
@@ -270,40 +265,27 @@ internal void NotifyContact (LSBody_ other, bool isColliding, bool isChanged)
270265
271266public bool Immovable { get ; private set ; }
272267
273- [ SerializeField ]
268+ [ SerializeField , FormerlySerializedAs ( "_priority" ) ]
274269private int _basePriority ;
275270
276271public int BasePriority { get { return _basePriority ; } }
277272
278- [ SerializeField ]
273+ [ SerializeField , FormerlySerializedAs ( "Vertices" ) ]
279274private Vector2d [ ] _vertices ;
280275
281276public Vector2d [ ] Vertices { get { return _vertices ; } }
282277
283278[ SerializeField , FixedNumber ]
284279private 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 ]
290285private Transform _positionalTransform ;
291286
292287public 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-
307289private bool _canSetVisualPosition ;
308290
309291public 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+
318307private bool _canSetVisualRotation ;
319308
320309public bool CanSetVisualRotation {
@@ -332,11 +321,113 @@ public Vector3d Position3d {
332321}
333322}
334323
324+ #endregion
325+
335326private 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}
0 commit comments