◆ Influence() [1/3]
BrawlLib.Wii.Models.Influence.Influence |
( |
| ) |
|
|
inline |
232 {
233 _weights = new List<BoneWeight>();
234 }
◆ Influence() [2/3]
BrawlLib.Wii.Models.Influence.Influence |
( |
List< BoneWeight > |
weights | ) |
|
|
inline |
237 {
238 _weights = weights;
239 foreach (BoneWeight b in _weights)
240 {
241 if (b.Bone != null && !b.Bone.LinkedInfluences.Contains(this))
242 {
243 b.Bone.LinkedInfluences.Add(this);
244 }
245 }
246 }
◆ Influence() [3/3]
BrawlLib.Wii.Models.Influence.Influence |
( |
IBoneNode |
bone | ) |
|
|
inline |
249 {
250 _weights = new List<BoneWeight> {new BoneWeight(bone)};
252 {
254 }
255 }
List< Influence > LinkedInfluences
Definition: IBoneNode.cs:22
◆ AddWeight()
void BrawlLib.Wii.Models.Influence.AddWeight |
( |
BoneWeight |
weight | ) |
|
|
inline |
120 {
121 _weights.Add(weight);
122 if (weight.Bone != null && !weight.Bone.LinkedInfluences.Contains(this))
123 {
124 weight.Bone.LinkedInfluences.Add(this);
125 }
126 }
◆ CalcMatrix()
void BrawlLib.Wii.Models.Influence.CalcMatrix |
( |
| ) |
|
|
inline |
272 {
274 {
277 }
278 else if (_weights.Count == 1 &&
Bone !=
null)
279 {
282 }
283 else
284 {
286 }
287 }
IBoneNode Bone
Definition: InfluenceManager.cs:229
bool IsWeighted
Definition: InfluenceManager.cs:228
Matrix Matrix
Definition: IMatrixNode.cs:12
Matrix InverseMatrix
Definition: IMatrixNode.cs:13
static Matrix InfluenceMatrix(List< BoneWeight > weights)
Definition: Matrix.cs:383
static Matrix ReverseInfluenceMatrix(List< BoneWeight > weights)
Definition: Matrix.cs:397
static readonly Matrix Identity
Definition: Matrix.cs:15
◆ Clone()
Influence BrawlLib.Wii.Models.Influence.Clone |
( |
| ) |
|
|
inline |
193 {
195 foreach (BoneWeight b in _weights)
196 {
197 i.AddWeight(new BoneWeight(b.Bone, b.Weight) {Locked = b.Locked});
198 }
199
200 return i;
201 }
Influence()
Definition: InfluenceManager.cs:231
◆ Compare()
290 {
291 if (i1._weights.Count < i2._weights.Count)
292 {
293 return -1;
294 }
295
296 if (i1._weights.Count > i2._weights.Count)
297 {
298 return 1;
299 }
300
301 if (i1.Users.Count > i2.Users.Count)
302 {
303 return -1;
304 }
305
306 if (i1.Users.Count < i2.Users.Count)
307 {
308 return 1;
309 }
310
311 return 0;
312 }
◆ Equals() [1/2]
bool BrawlLib.Wii.Models.Influence.Equals |
( |
Influence |
inf | ) |
|
|
inline |
330 {
331 bool found;
332
333 if (ReferenceEquals(this, inf))
334 {
335 return true;
336 }
337
338 if (ReferenceEquals(inf, null))
339 {
340 return false;
341 }
342
343 if (_weights.Count != inf._weights.Count)
344 {
345 return false;
346 }
347
348 foreach (BoneWeight w1 in _weights)
349 {
350 found = false;
351 foreach (BoneWeight w2 in inf._weights)
352 {
353 if (w1 == w2)
354 {
355 found = true;
356 break;
357 }
358 }
359
360 if (!found)
361 {
362 return false;
363 }
364 }
365
366 return true;
367 }
◆ Equals() [2/2]
override bool BrawlLib.Wii.Models.Influence.Equals |
( |
object |
obj | ) |
|
|
inline |
320 {
322 {
324 }
325
326 return false;
327 }
override bool Equals(object obj)
Definition: InfluenceManager.cs:319
◆ GetHashCode()
override int BrawlLib.Wii.Models.Influence.GetHashCode |
( |
| ) |
|
|
inline |
315 {
316 return base.GetHashCode();
317 }
◆ Normalize()
void BrawlLib.Wii.Models.Influence.Normalize |
( |
| ) |
|
|
inline |
163 {
164
165 float denom = 0.0f, num = 1.0f;
166
167 foreach (BoneWeight b
in Weights)
168 {
169 if (b.Locked)
170 {
171 num -= b.Weight;
172 }
173 else
174 {
175 denom += b.Weight;
176 }
177 }
178
179
180 if (denom != 0.0f && num != 0.0f)
181 {
182 foreach (BoneWeight b
in Weights)
183 {
184 if (!b.Locked)
185 {
186 b.Weight = (float) Math.Round(b.Weight / denom * num, 7);
187 }
188 }
189 }
190 }
List< BoneWeight > Weights
Don't modify this array!
Definition: InfluenceManager.cs:111
◆ operator!=()
375 {
376 return !i1.Equals(i2);
377 }
◆ operator==()
370 {
371 return i1.Equals(i2);
372 }
◆ RemoveWeight()
void BrawlLib.Wii.Models.Influence.RemoveWeight |
( |
BoneWeight |
weight | ) |
|
|
inline |
129 {
130 if (_weights.Contains(weight))
131 {
132 _weights.Remove(weight);
133 if (weight.Bone != null && weight.Bone.LinkedInfluences.Contains(this))
134 {
135 weight.Bone.LinkedInfluences.Remove(this);
136 }
137 }
138 }
◆ SetWeights()
void BrawlLib.Wii.Models.Influence.SetWeights |
( |
List< BoneWeight > |
newWeights | ) |
|
|
inline |
141 {
142 foreach (BoneWeight b in _weights)
143 {
144 if (b.Bone != null && b.Bone.LinkedInfluences.Contains(this))
145 {
146 b.Bone.LinkedInfluences.Remove(this);
147 }
148 }
149
150 _weights = newWeights;
151 foreach (BoneWeight b in _weights)
152 {
153 if (b.Bone != null && !b.Bone.LinkedInfluences.Contains(this))
154 {
155 b.Bone.LinkedInfluences.Add(this);
156 }
157 }
158 }
◆ ToString()
override string BrawlLib.Wii.Models.Influence.ToString |
( |
| ) |
|
|
inline |
◆ Bone
◆ InverseMatrix
Matrix BrawlLib.Wii.Models.Influence.InverseMatrix |
|
get |
Implements BrawlLib.Modeling.IMatrixNode.
208 {
209 get
210 {
211 if (_invMatrix == null)
212 {
213 try
214 {
216 }
217 catch
218 {
220 }
221 }
222
223 return (
Matrix) _invMatrix;
224 }
225 }
Matrix Invert()
Definition: Matrix.cs:1474
◆ IsPrimaryNode
bool BrawlLib.Wii.Models.Influence.IsPrimaryNode |
|
get |
◆ IsWeighted
bool BrawlLib.Wii.Models.Influence.IsWeighted |
|
get |
◆ Matrix
Matrix BrawlLib.Wii.Models.Influence.Matrix |
|
get |
◆ NodeIndex
int BrawlLib.Wii.Models.Influence.NodeIndex |
|
get |
◆ Users
◆ Weights
List<BoneWeight> BrawlLib.Wii.Models.Influence.Weights |
|
get |
The documentation for this class was generated from the following file:
- BrawlLib/Wii/Models/InfluenceManager.cs