-
Notifications
You must be signed in to change notification settings - Fork 1
/
Anim.cs
41 lines (36 loc) · 1007 Bytes
/
Anim.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mogre;
using MogreNewt;
namespace Gra
{
public class Anim
{
public string StateName;
public AnimationState State;
public bool Loop;
Entity Entity;
public AnimBlendGroup AffectedGroup;
public Anim(string stateName, bool loop)
{
StateName = stateName;
Loop = loop;
}
public void GetAnimationState(Entity entity)
{
Entity = entity;
State = Entity.GetAnimationState(StateName);
State.Loop = Loop;
State.Weight = 0;
}
public void AddBlendMask()
{
if (State.HasBlendMask == false)
State.CreateBlendMask(Entity.Skeleton.NumBones, 0);
foreach (string maskEntry in AffectedGroup.BlendMask)
State.SetBlendMaskEntry(Entity.Skeleton.GetBone(maskEntry).Handle, 1);
}
}
}