1- namespace GBX . NET . Engines . Plug ;
1+ using GBX . NET . Components ;
2+
3+ namespace GBX . NET . Engines . Plug ;
24
35public partial class CPlugDynaObjectModel : IVersionable
46{
57 private bool isStatic ;
68 private bool dynamizeOnSpawn ;
79 private CPlugSolid2Model ? mesh ;
8- private CPlugSurface ? dynaShape ;
10+ private GbxRefTableFile ? meshFile ;
11+ private CPlugSurface ? dynaShape ;
12+ private GbxRefTableFile ? dynaShapeFile ;
913 private CPlugSurface ? staticShape ;
14+ private GbxRefTableFile ? staticShapeFile ;
1015 private float breakSpeedKmh ;
1116 private float mass ;
1217 private float lightAliveDurationScMin ;
@@ -21,17 +26,24 @@ public partial class CPlugDynaObjectModel : IVersionable
2126 private int u08 ;
2227 private int u09 ;
2328 private CPlugAnimLocSimple ? locAnim ;
24- private int u10 ;
29+ private GbxRefTableFile ? locAnimFile ;
30+ private int u10 ;
2531 private bool locAnimIsPhysical ;
2632 private CPlugDynaWaterModel ? waterModel ;
2733
2834 public int Version { get ; set ; }
2935
3036 public bool IsStatic { get => isStatic ; set => isStatic = value ; }
3137 public bool DynamizeOnSpawn { get => dynamizeOnSpawn ; set => dynamizeOnSpawn = value ; }
32- public CPlugSolid2Model ? Mesh { get => mesh ; set => mesh = value ; }
33- public CPlugSurface ? DynaShape { get => dynaShape ; set => dynaShape = value ; }
34- public CPlugSurface ? StaticShape { get => staticShape ; set => staticShape = value ; }
38+ public CPlugSolid2Model ? Mesh { get => meshFile ? . GetNode ( ref mesh ) ?? mesh ; set => mesh = value ; }
39+ public GbxRefTableFile ? MeshFile { get => meshFile ; set => meshFile = value ; }
40+ public CPlugSolid2Model ? GetMesh ( GbxReadSettings settings = default , bool exceptions = false ) => meshFile ? . GetNode ( ref mesh , settings , exceptions ) ?? mesh ;
41+ public CPlugSurface ? DynaShape { get => dynaShapeFile ? . GetNode ( ref dynaShape ) ?? dynaShape ; set => dynaShape = value ; }
42+ public GbxRefTableFile ? DynaShapeFile { get => dynaShapeFile ; set => dynaShapeFile = value ; }
43+ public CPlugSurface ? GetDynaShape ( GbxReadSettings settings = default , bool exceptions = false ) => dynaShapeFile ? . GetNode ( ref dynaShape , settings , exceptions ) ?? dynaShape ;
44+ public CPlugSurface ? StaticShape { get => staticShapeFile ? . GetNode ( ref staticShape ) ?? staticShape ; set => staticShape = value ; }
45+ public GbxRefTableFile ? StaticShapeFile { get => staticShapeFile ; set => staticShapeFile = value ; }
46+ public CPlugSurface ? GetStaticShape ( GbxReadSettings settings = default , bool exceptions = false ) => staticShapeFile ? . GetNode ( ref staticShape , settings , exceptions ) ?? staticShape ;
3547 public float BreakSpeedKmh { get => breakSpeedKmh ; set => breakSpeedKmh = value ; }
3648 public float Mass { get => mass ; set => mass = value ; }
3749 public float LightAliveDurationScMin { get => lightAliveDurationScMin ; set => lightAliveDurationScMin = value ; }
@@ -45,8 +57,10 @@ public partial class CPlugDynaObjectModel : IVersionable
4557 public byte U07 { get => u07 ; set => u07 = value ; }
4658 public int U08 { get => u08 ; set => u08 = value ; }
4759 public int U09 { get => u09 ; set => u09 = value ; }
48- public CPlugAnimLocSimple ? LocAnim { get => locAnim ; set => locAnim = value ; }
49- public int U10 { get => u10 ; set => u10 = value ; }
60+ public CPlugAnimLocSimple ? LocAnim { get => locAnimFile ? . GetNode ( ref locAnim ) ?? locAnim ; set => locAnim = value ; }
61+ public GbxRefTableFile ? LocAnimFile { get => locAnimFile ; set => locAnimFile = value ; }
62+ public CPlugAnimLocSimple ? GetLocAnim ( GbxReadSettings settings = default , bool exceptions = false ) => locAnimFile ? . GetNode ( ref locAnim , settings , exceptions ) ?? locAnim ;
63+ public int U10 { get => u10 ; set => u10 = value ; }
5064 public bool LocAnimIsPhysical { get => locAnimIsPhysical ; set => locAnimIsPhysical = value ; }
5165 public CPlugDynaWaterModel ? WaterModel { get => waterModel ; set => waterModel = value ; }
5266
@@ -55,9 +69,9 @@ public override void ReadWrite(GbxReaderWriter rw)
5569 rw . VersionInt32 ( this ) ;
5670 rw . Boolean ( ref isStatic ) ;
5771 rw . Boolean ( ref dynamizeOnSpawn ) ;
58- rw . NodeRef < CPlugSolid2Model > ( ref mesh ) ;
59- rw . NodeRef < CPlugSurface > ( ref dynaShape ) ;
60- rw . NodeRef < CPlugSurface > ( ref staticShape ) ;
72+ rw . NodeRef < CPlugSolid2Model > ( ref mesh , ref meshFile ) ;
73+ rw . NodeRef < CPlugSurface > ( ref dynaShape , ref dynaShapeFile ) ;
74+ rw . NodeRef < CPlugSurface > ( ref staticShape , ref staticShapeFile ) ;
6175 rw . Single ( ref breakSpeedKmh ) ;
6276 rw . Single ( ref mass ) ;
6377 rw . Single ( ref lightAliveDurationScMin ) ;
@@ -71,7 +85,7 @@ public override void ReadWrite(GbxReaderWriter rw)
7185 rw . Byte ( ref u07 ) ;
7286 rw . Int32 ( ref u08 ) ;
7387 rw . Int32 ( ref u09 ) ;
74- rw . NodeRef ( ref locAnim ) ;
88+ rw . NodeRef ( ref locAnim , ref locAnimFile ) ;
7589 rw . Int32 ( ref u10 ) ;
7690 rw . Boolean ( ref locAnimIsPhysical ) ;
7791 rw . NodeRef < CPlugDynaWaterModel > ( ref waterModel ) ;
0 commit comments