@@ -778,13 +778,13 @@ public override void Write(MetaNodeWriter writer)
778
778
}
779
779
}
780
780
781
- [ TC ( typeof ( EXP ) ) ] public class Rsc6BoundCurvedGeometry : Rsc6BoundGeometry
781
+ [ TC ( typeof ( EXP ) ) ] public class Rsc6BoundCurvedGeometry : Rsc6BoundGeometry //rage::phBoundCurvedGeometry
782
782
{
783
783
//Represents a physics bound with generalized vertex locations and polygons, including curved polygons and curved edges
784
784
785
785
public override ulong BlockLength => base . BlockLength + 32 ;
786
- public Rsc6Ptr < Rsc6BoundCurvedFace > CurvedFaces { get ; set ; } //m_CurvedFaces, phCurvedFace
787
- public Rsc6Ptr < Rsc6BoundCurvedEdge > CurvedEdges { get ; set ; } //m_CurvedEdges, phCurvedEdge
786
+ public Rsc6RawLst < Rsc6BoundCurvedFace > CurvedFaces { get ; set ; } //m_CurvedFaces, phCurvedFace
787
+ public Rsc6RawLst < Rsc6BoundCurvedEdge > CurvedEdges { get ; set ; } //m_CurvedEdges, phCurvedEdge
788
788
public Rsc6RawArr < byte > CurvedFaceMatIndexList { get ; set ; } //m_CurvedFaceMatIndexLists, list of index numbers into this bound's list of material ids, one for each polygon
789
789
public int NumCurvedFaces { get ; set ; } //m_NumCurvedFaces
790
790
public int NumCurvedEdges { get ; set ; } //m_NumCurvedEdges
@@ -799,22 +799,25 @@ public Rsc6BoundCurvedGeometry(Rsc6BoundsType type = Rsc6BoundsType.CurvedGeomet
799
799
public override void Read ( Rsc6DataReader reader )
800
800
{
801
801
base . Read ( reader ) ; //phBoundGeometry
802
- CurvedFaces = reader . ReadPtr < Rsc6BoundCurvedFace > ( ) ;
803
- CurvedEdges = reader . ReadPtr < Rsc6BoundCurvedEdge > ( ) ;
802
+ CurvedFaces = reader . ReadRawLstPtr < Rsc6BoundCurvedFace > ( ) ;
803
+ CurvedEdges = reader . ReadRawLstPtr < Rsc6BoundCurvedEdge > ( ) ;
804
804
CurvedFaceMatIndexList = reader . ReadRawArrPtr < byte > ( ) ;
805
805
NumCurvedFaces = reader . ReadInt32 ( ) ;
806
806
NumCurvedEdges = reader . ReadInt32 ( ) ;
807
807
Unknown_14h = reader . ReadUInt32 ( ) ;
808
808
Unknown_18h = reader . ReadUInt32 ( ) ;
809
809
Unknown_1Ch = reader . ReadUInt32 ( ) ;
810
+
811
+ CurvedFaces = reader . ReadRawLstItems ( CurvedFaces , ( uint ) NumCurvedFaces ) ;
812
+ CurvedEdges = reader . ReadRawLstItems ( CurvedEdges , ( uint ) NumCurvedEdges ) ;
810
813
CurvedFaceMatIndexList = reader . ReadRawArrItems ( CurvedFaceMatIndexList , 6 ) ;
811
814
}
812
815
813
816
public override void Write ( Rsc6DataWriter writer )
814
817
{
815
818
base . Write ( writer ) ; //phBoundGeometry
816
- writer . WritePtr ( CurvedFaces ) ;
817
- writer . WritePtr ( CurvedEdges ) ;
819
+ writer . WriteRawLst ( CurvedFaces ) ;
820
+ writer . WriteRawLst ( CurvedEdges ) ;
818
821
writer . WriteRawArr ( CurvedFaceMatIndexList ) ;
819
822
writer . WriteInt32 ( NumCurvedFaces ) ;
820
823
writer . WriteInt32 ( NumCurvedEdges ) ;
@@ -826,32 +829,29 @@ public override void Write(Rsc6DataWriter writer)
826
829
public override void Read ( MetaNodeReader reader )
827
830
{
828
831
base . Read ( reader ) ;
829
- CurvedFaces = new ( reader . ReadNode < Rsc6BoundCurvedFace > ( "CurvedFaces" ) ) ;
830
- CurvedEdges = new ( reader . ReadNode < Rsc6BoundCurvedEdge > ( "CurvedEdges" ) ) ;
832
+ CurvedFaces = new ( reader . ReadNodeArray < Rsc6BoundCurvedFace > ( "CurvedFaces" ) ) ;
833
+ CurvedEdges = new ( reader . ReadNodeArray < Rsc6BoundCurvedEdge > ( "CurvedEdges" ) ) ;
831
834
CurvedFaceMatIndexList = new ( reader . ReadByteArray ( "CurvedFaceMatIndexList" ) ) ;
832
- NumCurvedFaces = reader . ReadInt32 ( "NumCurvedFaces" ) ;
833
- NumCurvedEdges = reader . ReadInt32 ( "NumCurvedEdges" ) ;
835
+ NumCurvedFaces = CurvedFaces . Items ? . Length ?? 0 ;
836
+ NumCurvedEdges = CurvedEdges . Items ? . Length ?? 0 ;
834
837
}
835
838
836
839
public override void Write ( MetaNodeWriter writer )
837
840
{
838
841
base . Write ( writer ) ;
839
- writer . WriteNode ( "CurvedFaces" , CurvedFaces . Item ) ;
840
- writer . WriteNode ( "CurvedEdges" , CurvedEdges . Item ) ;
842
+ writer . WriteNodeArray ( "CurvedFaces" , CurvedFaces . Items ) ;
843
+ writer . WriteNodeArray ( "CurvedEdges" , CurvedEdges . Items ) ;
841
844
writer . WriteByteArray ( "CurvedFaceMatIndexList" , CurvedFaceMatIndexList . Items ) ;
842
- writer . WriteInt32 ( "NumCurvedFaces" , NumCurvedFaces ) ;
843
- writer . WriteInt32 ( "NumCurvedEdges" , NumCurvedEdges ) ;
844
845
}
845
846
}
846
847
847
- [ TC ( typeof ( EXP ) ) ] public class Rsc6BoundCurvedFace : IRsc6Block , MetaNode
848
+ [ TC ( typeof ( EXP ) ) ] public class Rsc6BoundCurvedFace : IRsc6Block , MetaNode //phCurvedFace
848
849
{
849
850
//Curved face for a curved geometry bound
850
851
851
852
public ulong FilePosition { get ; set ; }
852
853
public ulong BlockLength => 96 ;
853
854
public bool IsPhysical => false ;
854
-
855
855
public Rsc6BoundPolyTriangle Polygons { get ; set ; }
856
856
public Vector4 CurvatureCenter { get ; set ; } //m_CurvatureCenter, the center of curvature of the face
857
857
public Vector4 UnitNormal { get ; set ; } //m_UnitNormal, the unit-length normal vector
@@ -876,8 +876,8 @@ public void Read(Rsc6DataReader reader)
876
876
OuterRadius = reader . ReadSingle ( ) ;
877
877
InnerRadius = reader . ReadSingle ( ) ;
878
878
MinCosine = reader . ReadSingle ( ) ;
879
- CurvedEdgeIndices = reader . ReadArray < ushort > ( 4 ) ;
880
- CurvedEdgePolyIndices = reader . ReadArray < ushort > ( 4 ) ;
879
+ CurvedEdgeIndices = reader . ReadUInt16Arr ( 4 ) ;
880
+ CurvedEdgePolyIndices = reader . ReadUInt16Arr ( 4 ) ;
881
881
NumCurvedEdges = reader . ReadInt32 ( ) ;
882
882
FourthVertex = reader . ReadUInt16 ( ) ;
883
883
IsCircularFace = reader . ReadBoolean ( ) ;
@@ -895,8 +895,8 @@ public void Write(Rsc6DataWriter writer)
895
895
writer . WriteSingle ( OuterRadius ) ;
896
896
writer . WriteSingle ( InnerRadius ) ;
897
897
writer . WriteSingle ( MinCosine ) ;
898
- writer . WriteArray ( CurvedEdgeIndices ) ;
899
- writer . WriteArray ( CurvedEdgePolyIndices ) ;
898
+ writer . WriteUInt16Array ( CurvedEdgeIndices ) ;
899
+ writer . WriteUInt16Array ( CurvedEdgePolyIndices ) ;
900
900
writer . WriteInt32 ( NumCurvedEdges ) ;
901
901
writer . WriteUInt16 ( FourthVertex ) ;
902
902
writer . WriteBoolean ( IsCircularFace ) ;
@@ -916,6 +916,7 @@ public void Read(MetaNodeReader reader)
916
916
MinCosine = reader . ReadSingle ( "MinCosine" ) ;
917
917
CurvedEdgeIndices = reader . ReadUInt16Array ( "CurvedEdgeIndices" ) ;
918
918
CurvedEdgePolyIndices = reader . ReadUInt16Array ( "CurvedEdgePolyIndices" ) ;
919
+ NumCurvedEdges = reader . ReadInt32 ( "NumCurvedEdges" ) ;
919
920
FourthVertex = reader . ReadUInt16 ( "FourthVertex" ) ;
920
921
IsCircularFace = reader . ReadBool ( "IsCircularFace" ) ;
921
922
}
@@ -936,7 +937,7 @@ public void Write(MetaNodeWriter writer)
936
937
}
937
938
}
938
939
939
- [ TC ( typeof ( EXP ) ) ] public class Rsc6BoundCurvedEdge : IRsc6Block , MetaNode
940
+ [ TC ( typeof ( EXP ) ) ] public class Rsc6BoundCurvedEdge : IRsc6Block , MetaNode //phCurvedEdge
940
941
{
941
942
public ulong FilePosition { get ; set ; }
942
943
public ulong BlockLength => 48 ;
@@ -953,7 +954,7 @@ public void Read(Rsc6DataReader reader)
953
954
CurvatureCenter = reader . ReadVector4 ( ) ;
954
955
PlaneNormal = reader . ReadVector4 ( ) ;
955
956
Radius = reader . ReadSingle ( ) ;
956
- VertexIndices = reader . ReadArray < int > ( 2 ) ;
957
+ VertexIndices = reader . ReadInt32Arr ( 2 ) ;
957
958
Unknown_2Ch = reader . ReadUInt32 ( ) ;
958
959
}
959
960
0 commit comments