BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Properties | List of all members
BrawlLib.Modeling.PrimitiveGroup Class Reference

Public Member Functions

void RegroupNodes ()
 
unsafe void SetNodeIds (VoidPtr primAddr)
 
bool TryAdd (PrimitiveClass p)
 
override string ToString ()
 

Public Attributes

List< ushort > _nodes = new List<ushort>()
 
List< PointTriangle_triangles = new List<PointTriangle>()
 
List< PointTriangleStrip_tristrips = new List<PointTriangleStrip>()
 
List< PointLine_lines = new List<PointLine>()
 
List< PointLineStrip_linestrips = new List<PointLineStrip>()
 
List< FPoint_points = new List<FPoint>()
 
List< PrimitiveHeader_headers = new List<PrimitiveHeader>()
 
List< List< Facepoint > > _facePoints = new List<List<Facepoint>>()
 
uint _offset
 
List< NodeOffset_nodeOffsets = new List<NodeOffset>()
 

Properties

PrimitiveHeader TriangleHeader [get]
 
PrimitiveHeader LineHeader [get]
 

Member Function Documentation

◆ RegroupNodes()

void BrawlLib.Modeling.PrimitiveGroup.RegroupNodes ( )
inline
105 {
106 _nodes.Clear();
107 for (int i = 0; i < _headers.Count; i++)
108 {
109 //Re-assign node ids, just in case the nodes were moved
110 foreach (Facepoint point in _facePoints[i])
111 {
112 if (!_nodes.Contains(point.NodeID))
113 {
114 _nodes.Add(point.NodeID);
115 }
116 }
117 }
118 }
List< List< Facepoint > > _facePoints
Definition: Face.cs:134
List< ushort > _nodes
Definition: Face.cs:102
List< PrimitiveHeader > _headers
Definition: Face.cs:133

◆ SetNodeIds()

unsafe void BrawlLib.Modeling.PrimitiveGroup.SetNodeIds ( VoidPtr  primAddr)
inline
145 {
146 byte* grpAddr = (byte*) (primAddr + _offset);
147 for (int i = 0; i < _nodeOffsets.Count; i++)
148 {
149 *(bushort*) (grpAddr + _nodeOffsets[i]._offset) = (ushort) _nodeOffsets[i]._node.NodeIndex;
150 }
151 }
uint _offset
Definition: Face.cs:137
List< NodeOffset > _nodeOffsets
Definition: Face.cs:140
Definition: BigEndianTypes.cs:192

◆ ToString()

override string BrawlLib.Modeling.PrimitiveGroup.ToString ( )
inline
373 {
374 return $"Nodes: {_nodes.Count} - Primitives: {_headers.Count}";
375 }

◆ TryAdd()

bool BrawlLib.Modeling.PrimitiveGroup.TryAdd ( PrimitiveClass  p)
inline
220 {
221 if (p is PointTriangleStrip)
222 {
223 return TryAdd(p as PointTriangleStrip);
224 }
225
226 if (p is PointTriangle)
227 {
228 return TryAdd(p as PointTriangle);
229 }
230
231 if (p is PointLineStrip)
232 {
233 return TryAdd(p as PointLineStrip);
234 }
235
236 if (p is PointLine)
237 {
238 return TryAdd(p as PointLine);
239 }
240
241 if (p is FPoint)
242 {
243 return TryAdd(p as FPoint);
244 }
245
246 return false;
247 }
bool TryAdd(PrimitiveClass p)
Definition: Face.cs:219

Member Data Documentation

◆ _facePoints

List<List<Facepoint> > BrawlLib.Modeling.PrimitiveGroup._facePoints = new List<List<Facepoint>>()

◆ _headers

List<PrimitiveHeader> BrawlLib.Modeling.PrimitiveGroup._headers = new List<PrimitiveHeader>()

◆ _lines

List<PointLine> BrawlLib.Modeling.PrimitiveGroup._lines = new List<PointLine>()

◆ _linestrips

List<PointLineStrip> BrawlLib.Modeling.PrimitiveGroup._linestrips = new List<PointLineStrip>()

◆ _nodeOffsets

List<NodeOffset> BrawlLib.Modeling.PrimitiveGroup._nodeOffsets = new List<NodeOffset>()

◆ _nodes

List<ushort> BrawlLib.Modeling.PrimitiveGroup._nodes = new List<ushort>()

◆ _offset

uint BrawlLib.Modeling.PrimitiveGroup._offset

◆ _points

List<FPoint> BrawlLib.Modeling.PrimitiveGroup._points = new List<FPoint>()

◆ _triangles

List<PointTriangle> BrawlLib.Modeling.PrimitiveGroup._triangles = new List<PointTriangle>()

◆ _tristrips

List<PointTriangleStrip> BrawlLib.Modeling.PrimitiveGroup._tristrips = new List<PointTriangleStrip>()

Property Documentation

◆ LineHeader

PrimitiveHeader BrawlLib.Modeling.PrimitiveGroup.LineHeader
get

◆ TriangleHeader

PrimitiveHeader BrawlLib.Modeling.PrimitiveGroup.TriangleHeader
get

The documentation for this class was generated from the following file: