BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
BrawlLib.SSBB.ResourceNodes.MDL0BoneNode Class Reference
Inheritance diagram for BrawlLib.SSBB.ResourceNodes.MDL0BoneNode:
BrawlLib.SSBB.ResourceNodes.MDL0EntryNode BrawlLib.Modeling.IBoneNode BrawlLib.SSBB.ResourceNodes.ResourceNode BrawlLib.Modeling.IMatrixNode

Public Member Functions

MDL0BoneNode Clone ()
 
override void OnMoved ()
 
override bool OnInitialize ()
 
override int OnCalculateSize (bool force)
 
override void RemoveChild (ResourceNode child)
 
void CalculateOffsets ()
 
void CalcFlags ()
 
override void OnRebuild (VoidPtr address, int length, bool force)
 
void RecalcBindState (bool updateMesh, bool moveMeshWithBone, bool updateAssetLists=true)
 
void RecalcFrameState (ModelPanelViewport v=null)
 
void ApplyBillboard (GLCamera camera)
 
void DrawBox (bool drawChildren, bool bindBox)
 
Box GetBox ()
 
List< MDL0BoneNodeChildTree (List< MDL0BoneNode > list)
 
override byte[] MD5 ()
 Find the MD5 checksum of this node's data. Basically, don't check string offset and instead hash the name itself More...
 
void Render (bool targetModel, ModelPanelViewport viewport, Vector3 parentPos=new Vector3())
 
- Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.MDL0EntryNode
override void SignalPropertyChange ()
 
- Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
void OnRenamed ()
 
List< ResourceNodeGetChildrenRecursive ()
 Used primarily to get bone lists. Kept for all resource nodes for utility. More...
 
virtual void SignalPropertyChange ()
 
virtual void Dispose ()
 
void SelectChildAtIndex (int index)
 
void UpdateProperties ()
 
void UpdateCurrentControl ()
 
virtual bool MoveUp ()
 
virtual bool MoveDown ()
 
virtual void OnMoved ()
 
virtual void DoMoveDown ()
 
virtual void DoMoveDown (bool select)
 
virtual void DoMoveUp ()
 
virtual void DoMoveUp (bool select)
 
virtual bool AddUp ()
 
virtual bool AddDown ()
 
virtual bool ToParent ()
 
void Populate (int levels=-1)
 
virtual void OnPopulate ()
 
void Initialize (ResourceNode parent, FileMap source)
 
void Initialize (ResourceNode parent, VoidPtr address, int length)
 
void Initialize (ResourceNode parent, DataSource origSource)
 
virtual void Initialize (ResourceNode parent, DataSource origSource, DataSource uncompSource)
 
virtual bool OnInitialize ()
 
virtual void Restore ()
 
virtual void Remove ()
 
virtual void RemoveChild (ResourceNode child)
 
virtual void AddChild (ResourceNode child)
 
virtual void AddChild (ResourceNode child, bool change)
 
virtual void InsertChild (ResourceNode child, int index)
 
virtual void InsertChild (ResourceNode child, bool change, int index)
 
void SetSizeInternal (int size)
 
virtual void Replace (string fileName)
 
virtual void Replace (ResourceNode node)
 
virtual void Replace (string fileName, FileMapProtect prot, FileOptions options)
 
virtual void ReplaceRaw (VoidPtr address, int length)
 
virtual void ReplaceRaw (FileMap map)
 
virtual void Export (string outPath)
 
void Export (FileStream outStream)
 
virtual void ExportUncompressed (string outPath)
 
void ExportUncompressed (FileStream outStream)
 
virtual void Rebuild ()
 
virtual void Rebuild (bool force)
 
virtual void Rebuild (VoidPtr address, int length, bool force)
 
virtual void OnRebuild (VoidPtr address, int length, bool force)
 
virtual int CalculateSize (bool force)
 
virtual int OnCalculateSize (bool force)
 
void Merge ()
 
void Merge (bool forceBuild)
 
ResourceNode FindChildByType (string path, bool searchChildren, params ResourceType[] types)
 
ResourceNode FindChildByType (string path, bool searchChildren, StringComparison compare, params ResourceType[] types)
 
ResourceNode FindChild (string path)
 
ResourceNode FindChild (string path, bool searchChildren)
 
ResourceNode FindChild (string path, StringComparison compare)
 
ResourceNode FindChild (string path, bool searchChildren, StringComparison compare)
 
ResourceNode[] FindChildrenByClassType (string path, Type type)
 
ResourceNode[] FindChildrenByType (string path, ResourceType type)
 
ResourceNode[] FindChildrenByTypeInGroup (string path, ResourceType type, byte group)
 
ResourceNode[] FindChildrenByName (string name)
 
unsafe string FindName (string name)
 
ResourceNode FindEmbeddedIndex (int index)
 
virtual unsafe byte[] MD5 ()
 Find the MD5 checksum of this node's data. If this node doesn't have any data (BRESGroupNode, for example), this method will return null. More...
 
string MD5Str ()
 Get the result of the MD5() function as a string of hexadecimal digits. If MD5() returns null, this method will return an empty string. More...
 
ResourceNode PrevSibling ()
 
ResourceNode NextSibling ()
 
override string ToString ()
 
virtual void SortChildren ()
 
void Render (bool targetModel, ModelPanelViewport viewport, Vector3 position=new Vector3())
 
void RecalcBindState (bool updateMesh, bool moveMeshWithBone, bool updateAssetLists=true)
 
void RecalcFrameState (ModelPanelViewport v=null)
 

Static Public Member Functions

static GLDisplayList CreateNodeOrb ()
 
static void DrawNodeOrients (float alpha=1.0f)
 
- Static Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
static ResourceNode[] FindAllSubNodes (ResourceNode root)
 
static ResourceNode FindNode (ResourceNode root, string path, bool searchChildren, StringComparison compare)
 

Public Attributes

bool _locked
 
Box _extents
 
BoneFlags _boneFlags = (BoneFlags) 0x11F
 
BillboardFlags _billboardFlags
 
MDL0BoneNode _bbRefNode
 
List< MDL0ObjectNode_singleBindObjects = new List<MDL0ObjectNode>()
 
List< DrawCall_visDrawCalls = new List<DrawCall>()
 
FrameState _bindState = FrameState.Neutral
 
Matrix _bindMatrix = Matrix.Identity
 
Matrix _inverseBindMatrix = Matrix.Identity
 
FrameState _frameState = FrameState.Neutral
 
Matrix _frameMatrix = Matrix.Identity
 
Matrix _inverseFrameMatrix = Matrix.Identity
 
int _nodeIndex
 
int _weightCount
 
Vector3 _overrideLocalTranslate
 
Color _boneColor = Color.Transparent
 
Color _nodeColor = Color.Transparent
 
bool _render = true
 
- Public Attributes inherited from BrawlLib.SSBB.ResourceNodes.MDL0EntryNode
int _entryIndex
 
- Public Attributes inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
Form _mainForm
 
string _name
 
string _origPath
 
ResourceNode _parent
 
List< ResourceNode_children = new List<ResourceNode>()
 
int _calcSize
 
EventHandler UpdateControl
 
MoveEventHandler MovedDown
 
ResourceEventHandler Renamed
 
ResourceEventHandler PropertyChanged
 
ResourceEventHandler Replaced
 
ResourceEventHandler Restored
 
ResourceChildEventHandler ChildRemoved
 
bool _isPopulating
 
bool _replaced
 

Static Public Attributes

static Color DefaultLineColor = Color.FromArgb(255, 0, 0, 128)
 
static Color DefaultLineDeselectedColor = Color.FromArgb(115, 128, 0, 0)
 
static Color DefaultNodeColor = Color.FromArgb(0, 128, 0)
 
const float _nodeRadius = 0.20f
 

Properties

override ResourceType ResourceFileType [get]
 
override bool AllowDuplicateNames [get]
 
override bool RetainChildrenOnReplace [get]
 
MDL0BoneNode OverrideBone [get, set]
 
IModel IModel [get]
 
FrameState FrameState [get, set]
 
FrameState BindState [get, set]
 
Color BoneColor [get, set]
 
Color NodeColor [get, set]
 
int WeightCount [get, set]
 
bool Locked [get, set]
 
Matrix BindMatrix [get, set]
 
Matrix InverseBindMatrix [get, set]
 
Matrix Matrix [get]
 
Matrix InverseMatrix [get]
 
int NodeIndex [get]
 
bool IsPrimaryNode [get]
 
List< BoneWeightWeights [get]
 
List< IMatrixNodeUserUsers [get, set]
 
string[] VisibilityDrawCalls [get]
 
MDL0ObjectNode[] SingleBindObjects [get]
 
bool Visible [get, set]
 
bool SegScaleCompApply [get, set]
 
bool SegScaleCompParent [get, set]
 
bool ClassicScale [get, set]
 
int BoneIndex [get, set]
 
BillboardFlags BillboardSetting [get, set]
 
string BillboardRefBone [get, set]
 
MDL0BoneNode BBRefNode [get, set]
 
Vector3 Scale [get, set]
 
Vector3 Rotation [get, set]
 
Vector3 Translation [get, set]
 
Vector3 BoxMin [get, set]
 
Vector3 BoxMax [get, set]
 
BoneFlags Flags [get, set]
 
UserDataCollection UserEntries [get, set]
 
List< InfluenceLinkedInfluences [get]
 
bool IsRendering [get, set]
 
- Properties inherited from BrawlLib.SSBB.ResourceNodes.MDL0EntryNode
MDL0Node Model [get]
 
BRRESNode BRESNode [get]
 
- Properties inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
string FilePath [get]
 
string FileName [get]
 
string DirectoryName [get]
 
ResourceNode RootNode [get]
 
DataSource OriginalSource [get]
 
DataSource UncompressedSource [get]
 
DataSource WorkingSource [get]
 
DataSource WorkingUncompressed [get]
 
virtual bool HasChildren [get]
 
virtual ResourceType ResourceFileType [get]
 
string NodeType [get]
 
virtual string TreePathAbsolute [get]
 
virtual string TreePath [get]
 
virtual int Level [get]
 
virtual int MaxNameLength [get]
 
virtual bool AllowDuplicateNames [get]
 
virtual bool AllowNullNames [get]
 
virtual string Name [get, set]
 
ResourceNode Parent [get, set]
 
List< ResourceNodeChildren [get]
 
int Index [get]
 
int HexIndex [get]
 
bool IsCompressed [get]
 
bool HasChanged [get, set]
 
bool IsBranch [get]
 
bool HasMerged [get]
 
virtual bool AllowSaving [get, set]
 
virtual bool IsDirty [get, set]
 
virtual uint UncompressedSize [get]
 
virtual Type[] AllowedChildTypes [get]
 
virtual string Compression [get, set]
 
virtual bool RetainChildrenOnReplace [get]
 
virtual bool supportsCompression [get]
 
static MD5CryptoServiceProvider MD5Provider [get]
 
- Properties inherited from BrawlLib.Modeling.IBoneNode
string Name [get, set]
 
bool Locked [get, set]
 
Matrix BindMatrix [get]
 
Matrix InverseBindMatrix [get]
 
int WeightCount [get, set]
 
FrameState BindState [get, set]
 
FrameState FrameState [get, set]
 
Color NodeColor [get, set]
 
Color BoneColor [get, set]
 
int BoneIndex [get]
 
IModel IModel [get]
 
List< InfluenceLinkedInfluences [get]
 
bool IsRendering [get, set]
 
- Properties inherited from BrawlLib.Modeling.IMatrixNode
List< IMatrixNodeUserUsers [get, set]
 
int NodeIndex [get]
 
Matrix Matrix [get]
 
Matrix InverseMatrix [get]
 
bool IsPrimaryNode [get]
 
List< BoneWeightWeights [get]
 

Additional Inherited Members

- Protected Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
void ForceReplacedEvent ()
 
virtual void MergeInternal ()
 
- Events inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
SelectEventHandler SelectChild
 
EventHandler UpdateProps
 
MoveEventHandler MovedUp
 
ResourceEventHandler Disposing
 
ResourceChildEventHandler ChildAdded
 
ResourceChildInsertEventHandler ChildInserted
 

Member Function Documentation

◆ ApplyBillboard()

void BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.ApplyBillboard ( GLCamera  camera)
inline
1120 {
1122 {
1123 return;
1124 }
1125
1126 Vector3 camPoint = camera.GetPoint();
1127 Vector3 camRot = camera._rotation;
1128
1129 FrameState worldState = _frameMatrix.Derive();
1130
1131 Matrix m = Matrix.Identity, mInv = Matrix.Identity;
1132
1133 Vector3 rot = ((int) BillboardSetting & 1) == 0
1134 ? //If perspective
1135 worldState.Translate.LookatAngles(camPoint) * Maths._rad2degf
1136 : //Point at camera position
1137 camRot; //Set parallel to the camera
1138
1139 switch (BillboardSetting)
1140 {
1141 case BillboardFlags.Standard:
1142 case BillboardFlags.StandardPerspective:
1143
1144 //Is affected by parent rotation
1145 m = Matrix.RotationMatrix(worldState.Rotate);
1146 mInv = Matrix.ReverseRotationMatrix(worldState.Rotate);
1147
1148 //No restrictions to apply
1149 break;
1150
1151 case BillboardFlags.Rotation:
1152 case BillboardFlags.RotationPerspective:
1153
1154 //Is not affected by parent rotation
1157
1158 //TODO: apply restrictions?
1159 break;
1160
1161 case BillboardFlags.Y:
1162 case BillboardFlags.YPerspective:
1163
1164 //Is affected by parent rotation
1165 m = Matrix.RotationMatrix(worldState.Rotate);
1166 mInv = Matrix.ReverseRotationMatrix(worldState.Rotate);
1167
1168 //Only Y is allowed to rotate automatically
1169 rot._x = 0;
1170 rot._z = 0;
1171
1172 break;
1173
1174 default: //Not a valid billboard type
1175 return;
1176 }
1177
1178 worldState.Rotate = rot;
1179
1180 _frameMatrix = worldState._transform * m;
1181 _inverseFrameMatrix = worldState._iTransform * mInv;
1182 }
Vector3 GetPoint()
Definition: GLCamera.cs:139
Vector3 _rotation
Definition: GLCamera.cs:14
Matrix _inverseFrameMatrix
Definition: MDL0BoneNode.cs:58
FrameState _frameState
Definition: MDL0BoneNode.cs:57
Matrix _frameMatrix
Definition: MDL0BoneNode.cs:58
BillboardFlags BillboardSetting
Definition: MDL0BoneNode.cs:296
BillboardFlags
Definition: MDL0.cs:639
Definition: Matrix.cs:14
static Matrix RotationMatrix(Vector3 angles)
Definition: Matrix.cs:465
static Matrix ReverseRotationMatrix(Vector3 angles)
Definition: Matrix.cs:495
static readonly Matrix Identity
Definition: Matrix.cs:15
FrameState Derive()
Definition: Matrix.cs:1010
Definition: Vector3.cs:40
Vector3 LookatAngles()
Definition: Vector3.cs:527
Definition: FrameState.cs:10
Vector3 Translate
Definition: FrameState.cs:37
Vector3 Rotate
Definition: FrameState.cs:47

◆ CalcFlags()

void BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.CalcFlags ( )
inline
726 {
727 _boneFlags = BoneFlags.Visible;
728
729 if (Scale._x == Scale._y && Scale._y == Scale._z)
730 {
731 _boneFlags |= BoneFlags.ScaleEqual;
732 }
733
734 if (Users.Count > 0)
735 {
736 _boneFlags |= BoneFlags.HasGeometry;
737 }
738
739 if (Scale == new Vector3(1))
740 {
741 _boneFlags |= BoneFlags.FixedScale;
742 }
743
744 if (Rotation == new Vector3(0))
745 {
746 _boneFlags |= BoneFlags.FixedRotation;
747 }
748
749 if (Translation == new Vector3(0))
750 {
751 _boneFlags |= BoneFlags.FixedTranslation;
752 }
753
754 if (Parent is MDL0BoneNode)
755 {
756 if (BindMatrix == ((MDL0BoneNode) Parent).BindMatrix &&
757 InverseBindMatrix == ((MDL0BoneNode) Parent).InverseBindMatrix)
758 {
759 _boneFlags |= BoneFlags.NoTransform;
760 }
761 }
763 {
764 _boneFlags |= BoneFlags.NoTransform;
765 }
766 }
Vector3 Rotation
Definition: MDL0BoneNode.cs:463
Matrix BindMatrix
Definition: MDL0BoneNode.cs:112
List< IMatrixNodeUser > Users
Definition: MDL0BoneNode.cs:150
Matrix InverseBindMatrix
Definition: MDL0BoneNode.cs:125
BoneFlags _boneFlags
Definition: MDL0BoneNode.cs:48
Vector3 Translation
Definition: MDL0BoneNode.cs:508
Vector3 Scale
Definition: MDL0BoneNode.cs:409
ResourceNode Parent
Definition: ResourceNode.cs:245
BoneFlags
Definition: MDL0.cs:623
float _y
Definition: Vector3.cs:41
float _z
Definition: Vector3.cs:41
float _x
Definition: Vector3.cs:41

◆ CalculateOffsets()

void BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.CalculateOffsets ( )
inline
698 {
700
701 //Set first child
702 header->_firstChildOffset =
703 _children.Count > 0 ? (int) Children[0].WorkingUncompressed.Address - (int) header : 0;
704
705 if (Parent != null)
706 {
707 int index = Index;
708
709 //Parent
710 header->_parentOffset =
711 Parent is MDL0BoneNode ? (int) Parent.WorkingUncompressed.Address - (int) header : 0;
712
713 //Previous sibling
714 header->_prevOffset = index == 0
715 ? 0
716 : (int) Parent._children[index - 1].WorkingUncompressed.Address - (int) header;
717
718 //Next sibling
719 header->_nextOffset = index == Parent._children.Count - 1
720 ? 0
721 : (int) Parent._children[index + 1].WorkingUncompressed.Address - (int) header;
722 }
723 }
List< ResourceNode > _children
Definition: ResourceNode.cs:143
int Index
Definition: ResourceNode.cs:301
List< ResourceNode > Children
Definition: ResourceNode.cs:262
DataSource WorkingUncompressed
Definition: ResourceNode.cs:183
VoidPtr Address
Definition: ResourceNode.cs:31
Definition: MDL0.cs:651
bint _firstChildOffset
Definition: MDL0.cs:668
bint _nextOffset
Definition: MDL0.cs:669
bint _parentOffset
Definition: MDL0.cs:667
bint _prevOffset
Definition: MDL0.cs:670

◆ ChildTree()

List< MDL0BoneNode > BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.ChildTree ( List< MDL0BoneNode list)
inline
1240 {
1241 list.Add(this);
1242 foreach (MDL0BoneNode c in _children)
1243 {
1244 c.ChildTree(list);
1245 }
1246
1247 return list;
1248 }

◆ Clone()

MDL0BoneNode BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.Clone ( )
inline
33 {
34 MDL0BoneNode b = new MDL0BoneNode
35 {
36 _name = _name,
41 };
42 return b;
43 }
FrameState FrameState
Definition: MDL0BoneNode.cs:68
FrameState _bindState
Definition: MDL0BoneNode.cs:55
Box _extents
Definition: MDL0BoneNode.cs:47
BillboardFlags _billboardFlags
Definition: MDL0BoneNode.cs:49
string _name
Definition: ResourceNode.cs:139
Vector3 _translate
Definition: FrameState.cs:14
Vector3 _rotate
Definition: FrameState.cs:13
Vector3 _scale
Definition: FrameState.cs:12

◆ CreateNodeOrb()

static GLDisplayList BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.CreateNodeOrb ( )
inlinestatic
1438 {
1440 GLDisplayList orb = new GLDisplayList();
1441
1442 orb.Begin();
1443 GL.PushMatrix();
1444
1446 circle.Call();
1447 GL.Rotate(90.0f, 0.0f, 1.0f, 0.0f);
1448 circle.Call();
1449 GL.Rotate(90.0f, 1.0f, 0.0f, 0.0f);
1450 circle.Call();
1451
1452 GL.PopMatrix();
1453 orb.End();
1454 return orb;
1455 }
Definition: GLDisplayList.cs:8
void Call()
Definition: GLDisplayList.cs:32
void Begin()
Definition: GLDisplayList.cs:17
void End()
Definition: GLDisplayList.cs:27
Definition: TKContext.cs:15
static GLDisplayList GetRingList()
Definition: TKContext.cs:382
const float _nodeRadius
Definition: MDL0BoneNode.cs:1290

◆ DrawBox()

void BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.DrawBox ( bool  drawChildren,
bool  bindBox 
)
inline
1185 {
1186 Box box = bindBox ? _extents : GetBox();
1187
1188 if (bindBox)
1189 {
1190 GL.MatrixMode(MatrixMode.Modelview);
1191 GL.PushMatrix();
1192 fixed (Matrix* m = &_frameMatrix)
1193 {
1194 GL.MultMatrix((float*) m);
1195 }
1196 }
1197
1199
1200 if (bindBox)
1201 {
1202 GL.PopMatrix();
1203 }
1204
1205 if (drawChildren)
1206 {
1207 foreach (MDL0BoneNode b in Children)
1208 {
1209 b.DrawBox(true, bindBox);
1210 }
1211 }
1212 }
static void DrawWireframeBox(Box value)
Definition: TKContext.cs:230
Box GetBox()
Definition: MDL0BoneNode.cs:1214
Definition: Box.cs:6

◆ DrawNodeOrients()

static void BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.DrawNodeOrients ( float  alpha = 1.0f)
inlinestatic
1458 {
1459 GL.Begin(BeginMode.Lines);
1460
1461 GL.Color4(1.0f, 0.0f, 0.0f, alpha);
1462 GL.Vertex3(0.0f, 0.0f, 0.0f);
1463 GL.Vertex3(_nodeRadius * 2, 0.0f, 0.0f);
1464
1465 GL.Color4(0.0f, 1.0f, 0.0f, alpha);
1466 GL.Vertex3(0.0f, 0.0f, 0.0f);
1467 GL.Vertex3(0.0f, _nodeRadius * 2, 0.0f);
1468
1469 GL.Color4(0.0f, 0.0f, 1.0f, alpha);
1470 GL.Vertex3(0.0f, 0.0f, 0.0f);
1471 GL.Vertex3(0.0f, 0.0f, _nodeRadius * 2);
1472
1473 GL.End();
1474 }

◆ GetBox()

Box BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.GetBox ( )
inline
1215 {
1216 if (_visDrawCalls.Count == 0)
1217 {
1218 return new Box();
1219 }
1220
1221 Box box = Box.ExpandableVolume;
1222 foreach (DrawCall o in _visDrawCalls)
1223 {
1224 box.ExpandVolume(o._parentObject.GetBox());
1225 }
1226
1227 return box;
1228 }
List< DrawCall > _visDrawCalls
Definition: MDL0BoneNode.cs:53
static readonly Box ExpandableVolume
Definition: Box.cs:7
void ExpandVolume(Vector3 value)
Definition: Box.cs:29

◆ MD5()

override byte[] BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.MD5 ( )
inlinevirtual

Find the MD5 checksum of this node's data. Basically, don't check string offset and instead hash the name itself

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

1255 {
1257 {
1258 // skip fix. This should probably never happen but whatever
1259 return base.MD5();
1260 }
1261
1262 int size = WorkingUncompressed.Length + Name.UTF8Length();
1263 byte[] data = new byte[size];
1264 fixed (byte* ptr = data)
1265 {
1266 // Write the initial data
1268 // Write the name string
1269 ((VoidPtr) ptr).WriteUTF8String(Name, false, (uint)WorkingUncompressed.Length);
1270 }
1271 // 0 out the name offset
1272 data[0x8] = data[0x9] = data[0xA] = data[0xB] = 0;
1273
1274 return MD5Provider.ComputeHash(data);
1275 }
Definition: Memory.cs:8
static void Move(VoidPtr dst, VoidPtr src, uint size)
Definition: Memory.cs:9
static MD5CryptoServiceProvider MD5Provider
Definition: ResourceNode.cs:1659
string Name
Definition: IBoneNode.cs:11
Definition: VoidPtr.cs:9
int Length
Definition: ResourceNode.cs:32

◆ OnCalculateSize()

override int BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.OnCalculateSize ( bool  force)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

687 {
688 return 0xD0 + _userEntries.GetSize();
689 }
int GetSize()
Definition: UserData.cs:123

◆ OnInitialize()

override bool BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.OnInitialize ( )
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

630 {
631 MDL0Bone* header = Header;
632
634
635 //Conditional name assignment
636 if (_name == null && header->_stringOffset != 0)
637 {
638 _name = header->ResourceString;
639 }
640
641 //Assign fields
642 _boneFlags = (BoneFlags) (uint) header->_flags;
643 _billboardFlags = (BillboardFlags) (uint) header->_bbFlags;
644 _nodeIndex = header->_nodeId;
645 _entryIndex = header->_index;
646
647 //Bone cache isn't done parsing yet, so set billboard ref node later
648
650 {
651 Model._billboardBones.Add(this); //Update mesh in T-Pose
652 }
653
654 _bindState = _frameState = new FrameState(header->_scale, header->_rotation, header->_translation);
657
658 _extents = header->_extents;
659
660 (_userEntries = new UserDataCollection()).Read(header->UserDataAddress, WorkingUncompressed);
661
662 //We don't want to process children because not all have been parsed yet.
663 //Child assignments will be handled by the parent group.
664 return false;
665 }
Matrix _inverseBindMatrix
Definition: MDL0BoneNode.cs:56
Matrix _bindMatrix
Definition: MDL0BoneNode.cs:56
int _nodeIndex
Definition: MDL0BoneNode.cs:60
MDL0Node Model
Definition: MDL0GroupNode.cs:28
int _entryIndex
Definition: MDL0GroupNode.cs:22
List< MDL0BoneNode > _billboardBones
Definition: MDL0Node.cs:49
void SetSizeInternal(int size)
Definition: ResourceNode.cs:799
UserData * UserDataAddress
Definition: MDL0.cs:690
buint _bbFlags
Definition: MDL0.cs:659
string ResourceString
Definition: MDL0.cs:702
bint _stringOffset
Definition: MDL0.cs:654
BVec3 _scale
Definition: MDL0.cs:662
BBox _extents
Definition: MDL0.cs:665
bint _index
Definition: MDL0.cs:655
buint _flags
Definition: MDL0.cs:658
BVec3 _translation
Definition: MDL0.cs:664
bMatrix43 _transformInv
Definition: MDL0.cs:674
bint _headerLen
Definition: MDL0.cs:652
BVec3 _rotation
Definition: MDL0.cs:663
bMatrix43 _transform
Definition: MDL0.cs:673
bint _nodeId
Definition: MDL0.cs:657

◆ OnMoved()

override void BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.OnMoved ( )
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

610 {
613 }
override void SignalPropertyChange()
Definition: MDL0GroupNode.cs:66
ModelLinker _linker
Definition: MDL0Node.cs:45
void RegenerateBoneCache(bool remake=false)
Definition: ModelLinker.cs:185

◆ OnRebuild()

override void BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.OnRebuild ( VoidPtr  address,
int  length,
bool  force 
)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

769 {
770 MDL0Bone* header = (MDL0Bone*) address;
771
772 if (Users.Count > 0 || SingleBindObjects.Length > 0)
773 {
774 _boneFlags |= BoneFlags.HasGeometry;
775 }
776 else
777 {
778 _boneFlags &= ~BoneFlags.HasGeometry;
779 }
780
781 header->_headerLen = length;
782 header->_index = _entryIndex;
783 header->_nodeId = _nodeIndex;
784 header->_flags = (uint) _boneFlags;
785 header->_bbFlags = (uint) _billboardFlags;
786 header->_bbIndex = _bbRefNode == null ? 0 : (uint) _bbRefNode._entryIndex;
787 header->_scale = _bindState._scale;
788 header->_rotation = _bindState._rotate;
790 header->_extents = _extents;
791 header->_transform = _bindMatrix;
793
794 if (_userEntries.Count > 0)
795 {
796 header->_userDataOffset = 0xD0;
797 _userEntries.Write(address + 0xD0);
798 }
799 else
800 {
801 header->_userDataOffset = 0;
802 }
803 }
MDL0BoneNode _bbRefNode
Definition: MDL0BoneNode.cs:50
MDL0ObjectNode[] SingleBindObjects
Definition: MDL0BoneNode.cs:170
void Write(VoidPtr userDataAddr)
Definition: UserData.cs:145
buint _bbIndex
Definition: MDL0.cs:660
bint _userDataOffset
Definition: MDL0.cs:671

◆ RecalcBindState()

void BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.RecalcBindState ( bool  updateMesh,
bool  moveMeshWithBone,
bool  updateAssetLists = true 
)
inline

Implements BrawlLib.Modeling.IBoneNode.

889 {
890 if (!updateMesh)
891 {
892 RecursiveRecalcBindState(true, false);
893 }
894 else
895 {
896 //Get all objects that are influenced by these bones
897 List<MDL0ObjectNode> changed = new List<MDL0ObjectNode>();
898 if (moveMeshWithBone || updateAssetLists)
899 {
900 RecursiveGetInfluencedObjects(ref changed);
901 }
902
903 if (!moveMeshWithBone) //Need to stop vertices rigged to one bone from moving
904 {
905 RecursiveRecalcBindState(false, false);
906 }
907 else //Need to move vertices rigged to influences to the new position
908 {
909 //Note: vertex position precision goes down over time for influences
910 //Try not to call this too much, or manual vertex fixes will be needed
911
912 Model.ApplyCHR(null, 0);
913 foreach (MDL0ObjectNode o in changed)
914 {
915 if (o._manager != null)
916 {
917 Vector3* pData = (Vector3*) o._manager._faceData[1].Address;
918 if (o.MatrixNode != null)
919 {
920 if (o.MatrixNode is Influence)
921 {
922 Influence inf = (Influence) o.MatrixNode;
923 foreach (Vertex3 v in o._manager._vertices)
924 {
925 v._position *= inf.Matrix;
926 foreach (int i in v.FaceDataIndices)
927 {
928 pData[i] *= inf.Matrix.GetRotationMatrix();
929 }
930 }
931 }
932 }
933 else
934 {
935 foreach (Vertex3 v in o._manager._vertices)
936 {
937 if (v.MatrixNode is Influence)
938 {
940 v._position *= inf.Matrix;
941 foreach (int i in v.FaceDataIndices)
942 {
943 pData[i] *= inf.Matrix.GetRotationMatrix();
944 }
945 }
946 }
947 }
948 }
949 }
950
951 RecursiveRecalcBindState(true, false);
952 foreach (Influence inf in Model._influences._influences)
953 {
954 inf.CalcMatrix();
955 }
956
957 foreach (MDL0ObjectNode o in changed)
958 {
959 if (o._manager != null)
960 {
961 Vector3* pData = (Vector3*) o._manager._faceData[1].Address;
962 if (o.MatrixNode != null)
963 {
964 if (o.MatrixNode is Influence)
965 {
966 Influence inf = (Influence) o.MatrixNode;
967 foreach (Vertex3 v in o._manager._vertices)
968 {
969 v._position *= inf.InverseMatrix;
970 foreach (int i in v.FaceDataIndices)
971 {
972 pData[i] *= inf.InverseMatrix.GetRotationMatrix();
973 }
974 }
975 }
976 }
977 else
978 {
979 foreach (Vertex3 v in o._manager._vertices)
980 {
981 if (v.MatrixNode is Influence)
982 {
984 v._position *= inf.InverseMatrix;
985 foreach (int i in v.FaceDataIndices)
986 {
987 pData[i] *= inf.InverseMatrix.GetRotationMatrix();
988 }
989 }
990 }
991 }
992 }
993 }
994 }
995
996 //Update the external arrays with the new unweighted vertices and normals
997 if (updateAssetLists)
998 {
999 foreach (MDL0ObjectNode o in changed)
1000 {
1001 o.SetEditedAssets(false, true, true);
1002 }
1003 }
1004 }
1005 }
Definition: Vertex.cs:13
Vector3 _position
Definition: Vertex.cs:14
List< int > FaceDataIndices
Definition: Vertex.cs:31
IMatrixNode MatrixNode
Definition: Vertex.cs:195
InfluenceManager _influences
Definition: MDL0Node.cs:50
void ApplyCHR(CHR0Node node, float index)
Definition: MDL0Node.cs:3215
Definition: InfluenceManager.cs:96
Matrix Matrix
Definition: InfluenceManager.cs:204
void CalcMatrix()
Definition: InfluenceManager.cs:271
Matrix InverseMatrix
Definition: InfluenceManager.cs:208
Matrix GetRotationMatrix()
Definition: Matrix.cs:825
VoidPtr Address
Definition: Vector3.cs:701

◆ RecalcFrameState()

void BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.RecalcFrameState ( ModelPanelViewport  v = null)
inline

Implements BrawlLib.Modeling.IBoneNode.

1080 {
1081 if (_overrideBone != null)
1082 {
1083 _frameMatrix = _overrideBone._frameMatrix;
1085 }
1086 else
1087 {
1088 if (_overrideLocalTranslate != new Vector3())
1089 {
1092 }
1093
1094 if (_parent is MDL0BoneNode)
1095 {
1096 _frameMatrix = ((MDL0BoneNode) _parent)._frameMatrix * _frameState._transform;
1097 _inverseFrameMatrix = _frameState._iTransform * ((MDL0BoneNode) _parent)._inverseFrameMatrix;
1098 }
1099 else
1100 {
1103 }
1104 }
1105
1106 if (BillboardSetting != BillboardFlags.Off &&
1107 v != null &&
1109 {
1111 }
1112
1113 foreach (MDL0BoneNode bone in Children)
1114 {
1115 bone.RecalcFrameState(v);
1116 }
1117 }
bool ApplyBillboardBones
Definition: modelpanelviewport.cs:460
GLCamera Camera
Definition: GLViewport.cs:54
Vector3 _overrideLocalTranslate
Definition: MDL0BoneNode.cs:1077
void ApplyBillboard(GLCamera camera)
Definition: MDL0BoneNode.cs:1119
ResourceNode _parent
Definition: ResourceNode.cs:142
Matrix _transform
Definition: FrameState.cs:16
Vector3 Scale
Definition: FrameState.cs:57
Matrix _iTransform
Definition: FrameState.cs:16

◆ RemoveChild()

override void BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.RemoveChild ( ResourceNode  child)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

692 {
693 base.RemoveChild(child);
694 OnMoved();
695 }
override void OnMoved()
Definition: MDL0BoneNode.cs:609

◆ Render()

void BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.Render ( bool  targetModel,
ModelPanelViewport  viewport,
Vector3  parentPos = new Vector3() 
)
inline

Implements BrawlLib.Modeling.IBoneNode.

1339 {
1340 if (!_render)
1341 {
1342 return;
1343 }
1344
1345 //Draw name if selected
1346 if (_nodeColor != Color.Transparent && viewport != null)
1347 {
1348 Vector3 screenPos = viewport.Camera.Project(_frameMatrix.GetPoint());
1349 viewport.SettingsScreenText[Name] = new Vector3(screenPos._x, screenPos._y - 9.0f, screenPos._z);
1350 }
1351
1352 float alpha = targetModel ? 1.0f : 0.45f;
1353
1354 //Set bone line color
1355 if (_boneColor != Color.Transparent)
1356 {
1357 GL.Color4(_boneColor.R / 255.0f, _boneColor.G / 255.0f, _boneColor.B / 255.0f, alpha);
1358 }
1359 else
1360 {
1361 GL.Color4(targetModel ? DefaultLineColor : DefaultLineDeselectedColor);
1362 }
1363
1364 //Draw bone line
1365 Vector3 currentPos = _frameMatrix.GetPoint();
1366 GL.Begin(BeginMode.Lines);
1367 GL.Vertex3((float*) &parentPos);
1368 GL.Vertex3((float*) &currentPos);
1369 GL.End();
1370
1371 //Set bone orb color
1372 if (_nodeColor != Color.Transparent)
1373 {
1374 GL.Color4(_nodeColor.R / 255.0f, _nodeColor.G / 255.0f, _nodeColor.B / 255.0f, alpha);
1375 }
1376 else
1377 {
1378 GL.Color4(DefaultNodeColor.R / 255.0f, DefaultNodeColor.G / 255.0f, DefaultNodeColor.B / 255.0f, alpha);
1379 }
1380
1381 //Draw bone orb
1382 GL.PushMatrix();
1383
1384 bool ignoreBoneScale = true;
1385 bool scaleBones = viewport != null && viewport._renderAttrib._scaleBones;
1386 Matrix transform = _frameMatrix;
1387 if (ignoreBoneScale)
1388 {
1389 transform = Matrix.TranslationMatrix(currentPos) *
1391 Matrix.ScaleMatrix(new Vector3(1.0f));
1392 }
1393
1395 {
1396 GL.MultMatrix((float*) &transform);
1397
1398 if (!scaleBones)
1399 {
1400 GL.PointSize(1.0f / ModelEditorBase.OrbRadius(this, viewport.Camera) * 10.0f);
1401 }
1402 else
1403 {
1404 GL.PointSize(10.0f);
1405 }
1406
1407 GL.Enable(EnableCap.PointSmooth);
1408 GL.Begin(BeginMode.Points);
1409 GL.Vertex3(0, 0, 0);
1410 GL.End();
1411 }
1412 else
1413 {
1414 if (scaleBones)
1415 {
1416 transform.Scale(new Vector3(ModelEditorBase.OrbRadius(this, viewport.Camera)));
1417 }
1418
1419 GL.MultMatrix((float*) &transform);
1420
1421 //Orb
1422 TKContext.FindOrCreate("BoneNodeOrb", CreateNodeOrb).Call();
1423
1424 //Axes
1425 DrawNodeOrients(alpha);
1426 }
1427
1428 GL.PopMatrix();
1429
1430 //Render children
1431 foreach (MDL0BoneNode n in Children)
1432 {
1433 n.Render(targetModel, viewport, currentPos);
1434 }
1435 }
ModelRenderAttributes _renderAttrib
Definition: modelpanelviewport.cs:93
ScreenTextHandler SettingsScreenText
Definition: modelpanelviewport.cs:132
static float OrbRadius(IBoneNode b, GLViewport viewport, float radius=_orbRadius)
Definition: Properties.cs:500
bool _renderBonesAsPoints
Definition: IModel.cs:52
bool _scaleBones
Definition: IModel.cs:51
Vector3 Project(float x, float y, float z)
Projects a world point to screen coordinates.
Definition: GLCamera.cs:329
static Color DefaultNodeColor
Definition: MDL0BoneNode.cs:1285
static GLDisplayList CreateNodeOrb()
Definition: MDL0BoneNode.cs:1437
bool _render
Definition: MDL0BoneNode.cs:1336
static Color DefaultLineDeselectedColor
Definition: MDL0BoneNode.cs:1284
Color _boneColor
Definition: MDL0BoneNode.cs:1287
static Color DefaultLineColor
Definition: MDL0BoneNode.cs:1283
Color _nodeColor
Definition: MDL0BoneNode.cs:1288
static void DrawNodeOrients(float alpha=1.0f)
Definition: MDL0BoneNode.cs:1457
static Matrix TranslationMatrix(Vector3 v)
Definition: Matrix.cs:353
Vector3 GetPoint()
Definition: Matrix.cs:321
static Matrix ScaleMatrix(Vector3 scale)
Definition: Matrix.cs:337

Member Data Documentation

◆ _bbRefNode

MDL0BoneNode BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._bbRefNode

◆ _billboardFlags

BillboardFlags BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._billboardFlags

◆ _bindMatrix

Matrix BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._bindMatrix = Matrix.Identity

◆ _bindState

FrameState BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._bindState = FrameState.Neutral

◆ _boneColor

Color BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._boneColor = Color.Transparent

◆ _boneFlags

BoneFlags BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._boneFlags = (BoneFlags) 0x11F

◆ _extents

Box BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._extents

◆ _frameMatrix

Matrix BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._frameMatrix = Matrix.Identity

◆ _frameState

FrameState BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._frameState = FrameState.Neutral

◆ _inverseBindMatrix

Matrix BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._inverseBindMatrix = Matrix.Identity

◆ _inverseFrameMatrix

Matrix BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._inverseFrameMatrix = Matrix.Identity

◆ _locked

bool BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._locked

◆ _nodeColor

Color BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._nodeColor = Color.Transparent

◆ _nodeIndex

int BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._nodeIndex

◆ _nodeRadius

const float BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._nodeRadius = 0.20f
static

◆ _overrideLocalTranslate

Vector3 BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._overrideLocalTranslate

◆ _render

bool BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._render = true

◆ _singleBindObjects

List<MDL0ObjectNode> BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._singleBindObjects = new List<MDL0ObjectNode>()

◆ _visDrawCalls

List<DrawCall> BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._visDrawCalls = new List<DrawCall>()

◆ _weightCount

int BrawlLib.SSBB.ResourceNodes.MDL0BoneNode._weightCount

◆ DefaultLineColor

Color BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.DefaultLineColor = Color.FromArgb(255, 0, 0, 128)
static

◆ DefaultLineDeselectedColor

Color BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.DefaultLineDeselectedColor = Color.FromArgb(115, 128, 0, 0)
static

◆ DefaultNodeColor

Color BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.DefaultNodeColor = Color.FromArgb(0, 128, 0)
static

Property Documentation

◆ AllowDuplicateNames

override bool BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.AllowDuplicateNames
get

◆ BBRefNode

MDL0BoneNode BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.BBRefNode
getset
387 {
388 get => _bbRefNode;
389 set
390 {
391 _bbRefNode = value;
392
393 if (_bbRefNode != null)
394 {
395 _boneFlags |= BoneFlags.HasBillboardParent;
396 }
397 else
398 {
399 _boneFlags &= ~BoneFlags.HasBillboardParent;
400 }
401
403 }
404 }

◆ BillboardRefBone

string BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.BillboardRefBone
getset
376 {
377 get => _bbRefNode == null ? string.Empty : _bbRefNode.Name;
378 set
379 {
380 BBRefNode = string.IsNullOrEmpty(value) ? null : Model.FindBone(value);
382 }
383 }
MDL0BoneNode BBRefNode
Definition: MDL0BoneNode.cs:387
MDL0BoneNode FindBone(string name)
Definition: MDL0Node.cs:752

◆ BillboardSetting

BillboardFlags BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.BillboardSetting
getset
296 {
297 get => _billboardFlags;
298 set
299 {
300 if (_billboardFlags == value)
301 {
302 return;
303 }
304
305 MDL0Node model = Model;
306 if (_billboardFlags != BillboardFlags.Off && model._billboardBones.Contains(this))
307 {
308 model._billboardBones.Remove(this);
309 }
310
311 if ((_billboardFlags = value) != BillboardFlags.Off && !model._billboardBones.Contains(this))
312 {
313 model._billboardBones.Add(this);
314 }
315
316 OnBillboardModeChanged();
318 }
319 }

◆ BindMatrix

Matrix BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.BindMatrix
getset

Implements BrawlLib.Modeling.IBoneNode.

112 {
113 get => _bindMatrix;
114 set
115 {
116 _bindMatrix = value;
118 }
119 }

◆ BindState

FrameState BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.BindState
getset

Implements BrawlLib.Modeling.IBoneNode.

75 {
76 get => _bindState;
77 set => _bindState = value;
78 }

◆ BoneColor

Color BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.BoneColor
getset

Implements BrawlLib.Modeling.IBoneNode.

82 {
83 get => _boneColor;
84 set => _boneColor = value;
85 }

◆ BoneIndex

int BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.BoneIndex
getset

Implements BrawlLib.Modeling.IBoneNode.

252 {
253 get => _entryIndex;
254 set
255 {
256 if (_entryIndex == value)
257 {
258 return;
259 }
260
261 bool down = value < _entryIndex;
262
263 _entryIndex = value;
264
265 MDL0Node model = Model;
266 if (model?._linker?.BoneCache != null)
267 {
268 if (down)
269 {
270 foreach (MDL0BoneNode b in model._linker.BoneCache)
271 {
272 if (b._entryIndex >= _entryIndex && b != this)
273 {
274 b._entryIndex++;
275 }
276 }
277 }
278
281 }
282
284 }
285 }
void UpdateProperties()
Definition: ResourceNode.cs:477

◆ BoxMax

Vector3 BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.BoxMax
getset
565 {
566 get => _extents.Max;
567 set
568 {
569 _extents.Max = value;
571 }
572 }
Vector3 Max
Definition: Box.cs:18

◆ BoxMin

Vector3 BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.BoxMin
getset
553 {
554 get => _extents.Min;
555 set
556 {
557 _extents.Min = value;
559 }
560 }
Vector3 Min
Definition: Box.cs:12

◆ ClassicScale

bool BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.ClassicScale
getset
232 {
233 get => !_boneFlags.HasFlag(BoneFlags.ClassicScaleOff);
234 set
235 {
236 if (!value)
237 {
238 _boneFlags |= BoneFlags.ClassicScaleOff;
239 }
240 else
241 {
242 _boneFlags &= ~BoneFlags.ClassicScaleOff;
243 }
244
246 }
247 }

◆ Flags

BoneFlags BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.Flags
getset
576 {
577 get => _boneFlags;
578 set
579 {
580 _boneFlags = value;
582 }
583 }

◆ FrameState

FrameState BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.FrameState
getset

Implements BrawlLib.Modeling.IBoneNode.

68 {
69 get => _frameState;
70 set => _frameState = value;
71 }

◆ IModel

IModel BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.IModel
get

◆ InverseBindMatrix

Matrix BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.InverseBindMatrix
getset

Implements BrawlLib.Modeling.IBoneNode.

125 {
126 get => _inverseBindMatrix;
127 set
128 {
129 _inverseBindMatrix = value;
131 }
132 }

◆ InverseMatrix

Matrix BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.InverseMatrix
get

◆ IsPrimaryNode

bool BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.IsPrimaryNode
get

◆ IsRendering

bool BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.IsRendering
getset

Implements BrawlLib.Modeling.IBoneNode.

1331 {
1332 get => _render;
1333 set => _render = value;
1334 }

◆ LinkedInfluences

List<Influence> BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.LinkedInfluences
get

◆ Locked

bool BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.Locked
getset

Implements BrawlLib.Modeling.IBoneNode.

103 {
104 get => _locked;
105 set => _locked = value;
106 }
bool _locked
Definition: MDL0BoneNode.cs:45

◆ Matrix

Matrix BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.Matrix
get

◆ NodeColor

Color BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.NodeColor
getset

Implements BrawlLib.Modeling.IBoneNode.

89 {
90 get => _nodeColor;
91 set => _nodeColor = value;
92 }

◆ NodeIndex

int BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.NodeIndex
get

◆ OverrideBone

MDL0BoneNode BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.OverrideBone
getset
27 {
28 get => _overrideBone;
29 set => _overrideBone = value;
30 }

◆ ResourceFileType

override ResourceType BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.ResourceFileType
get

◆ RetainChildrenOnReplace

override bool BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.RetainChildrenOnReplace
get

◆ Rotation

Vector3 BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.Rotation
getset
463 {
464 get => _bindState._rotate;
465 set
466 {
467 _bindState.Rotate = value;
468
469 if (value == new Vector3())
470 {
471 _boneFlags |= BoneFlags.FixedRotation;
472 }
473 else
474 {
475 _boneFlags &= ~BoneFlags.FixedRotation;
476 }
477
478 //RecalcBindState();
479
480 if (Parent is MDL0BoneNode)
481 {
482 if (BindMatrix == ((MDL0BoneNode) Parent).BindMatrix &&
483 InverseBindMatrix == ((MDL0BoneNode) Parent).InverseBindMatrix)
484 {
485 _boneFlags |= BoneFlags.NoTransform;
486 }
487 else
488 {
489 _boneFlags &= ~BoneFlags.NoTransform;
490 }
491 }
493 {
494 _boneFlags |= BoneFlags.NoTransform;
495 }
496 else
497 {
498 _boneFlags &= ~BoneFlags.NoTransform;
499 }
500
502 }
503 }

◆ Scale

Vector3 BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.Scale
getset
409 {
410 get => _bindState._scale;
411 set
412 {
413 _bindState.Scale = value;
414
415 if (value == new Vector3(1))
416 {
417 _boneFlags |= BoneFlags.FixedScale;
418 }
419 else
420 {
421 _boneFlags &= ~BoneFlags.FixedScale;
422 }
423
424 if (value._x == value._y && value._y == value._z)
425 {
426 _boneFlags |= BoneFlags.ScaleEqual;
427 }
428 else
429 {
430 _boneFlags &= ~BoneFlags.ScaleEqual;
431 }
432
433 //RecalcBindState();
434
435 if (Parent is MDL0BoneNode)
436 {
437 if (BindMatrix == ((MDL0BoneNode) Parent).BindMatrix &&
438 InverseBindMatrix == ((MDL0BoneNode) Parent).InverseBindMatrix)
439 {
440 _boneFlags |= BoneFlags.NoTransform;
441 }
442 else
443 {
444 _boneFlags &= ~BoneFlags.NoTransform;
445 }
446 }
448 {
449 _boneFlags |= BoneFlags.NoTransform;
450 }
451 else
452 {
453 _boneFlags &= ~BoneFlags.NoTransform;
454 }
455
457 }
458 }

◆ SegScaleCompApply

bool BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.SegScaleCompApply
getset
194 {
195 get => _boneFlags.HasFlag(BoneFlags.SegScaleCompApply);
196 set
197 {
198 if (value)
199 {
200 _boneFlags |= BoneFlags.SegScaleCompApply;
201 }
202 else
203 {
204 _boneFlags &= ~BoneFlags.SegScaleCompApply;
205 }
206
208 }
209 }

◆ SegScaleCompParent

bool BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.SegScaleCompParent
getset
213 {
214 get => _boneFlags.HasFlag(BoneFlags.SegScaleCompParent);
215 set
216 {
217 if (value)
218 {
219 _boneFlags |= BoneFlags.SegScaleCompParent;
220 }
221 else
222 {
223 _boneFlags &= ~BoneFlags.SegScaleCompParent;
224 }
225
227 }
228 }

◆ SingleBindObjects

MDL0ObjectNode [] BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.SingleBindObjects
get

◆ Translation

Vector3 BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.Translation
getset
508 {
509 get => _bindState._translate;
510 set
511 {
512 _bindState.Translate = value;
513
514 if (value == new Vector3())
515 {
516 _boneFlags |= BoneFlags.FixedTranslation;
517 }
518 else
519 {
520 _boneFlags &= ~BoneFlags.FixedTranslation;
521 }
522
523 //RecalcBindState();
524
525 if (Parent is MDL0BoneNode)
526 {
527 if (BindMatrix == ((MDL0BoneNode) Parent).BindMatrix &&
528 InverseBindMatrix == ((MDL0BoneNode) Parent).InverseBindMatrix)
529 {
530 _boneFlags |= BoneFlags.NoTransform;
531 }
532 else
533 {
534 _boneFlags &= ~BoneFlags.NoTransform;
535 }
536 }
538 {
539 _boneFlags |= BoneFlags.NoTransform;
540 }
541 else
542 {
543 _boneFlags &= ~BoneFlags.NoTransform;
544 }
545
547 }
548 }

◆ UserEntries

UserDataCollection BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.UserEntries
getset
596 {
597 get => _userEntries;
598 set
599 {
600 _userEntries = value;
602 }
603 }

◆ Users

List<IMatrixNodeUser> BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.Users
getset

Implements BrawlLib.Modeling.IMatrixNode.

150 {
151 get => _users;
152 set => _users = value;
153 }

◆ VisibilityDrawCalls

string [] BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.VisibilityDrawCalls
get

◆ Visible

bool BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.Visible
getset
175 {
176 get => _boneFlags.HasFlag(BoneFlags.Visible);
177 set
178 {
179 if (value)
180 {
181 _boneFlags |= BoneFlags.Visible;
182 }
183 else
184 {
185 _boneFlags &= ~BoneFlags.Visible;
186 }
187
189 }
190 }

◆ WeightCount

int BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.WeightCount
getset

Implements BrawlLib.Modeling.IBoneNode.

96 {
97 get => _weightCount;
98 set => _weightCount = value;
99 }
int _weightCount
Definition: MDL0BoneNode.cs:60

◆ Weights

List<BoneWeight> BrawlLib.SSBB.ResourceNodes.MDL0BoneNode.Weights
get

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