| 42 | #endif |
| 43 | |
| 44 | Animation::InfoData Animation::GetInfo() const |
| 45 | { |
| 46 | ScopeLock lock(Locker); |
| 47 | InfoData info; |
| 48 | info.MemoryUsage = sizeof(Animation); |
| 49 | if (IsLoaded()) |
| 50 | { |
| 51 | info.Length = Data.GetLength(); |
| 52 | info.FramesCount = (int32)Data.Duration; |
| 53 | info.ChannelsCount = Data.Channels.Count(); |
| 54 | info.KeyframesCount = Data.GetKeyframesCount(); |
| 55 | info.MemoryUsage += Data.Channels.Capacity() * sizeof(NodeAnimationData); |
| 56 | for (auto& e : Data.Channels) |
| 57 | { |
| 58 | info.MemoryUsage += (e.NodeName.Length() + 1) * sizeof(Char); |
| 59 | info.MemoryUsage += e.Position.GetKeyframes().Capacity() * sizeof(LinearCurveKeyframe<Float3>); |
| 60 | info.MemoryUsage += e.Rotation.GetKeyframes().Capacity() * sizeof(LinearCurveKeyframe<Quaternion>); |
| 61 | info.MemoryUsage += e.Scale.GetKeyframes().Capacity() * sizeof(LinearCurveKeyframe<Float3>); |
| 62 | } |
| 63 | } |
| 64 | else |
| 65 | { |
| 66 | info.Length = 0.0f; |
| 67 | info.FramesCount = 0; |
| 68 | info.ChannelsCount = 0; |
| 69 | info.KeyframesCount = 0; |
| 70 | } |
| 71 | info.MemoryUsage += Events.Capacity() * sizeof(Pair<String, StepCurve<AnimEventData>>); |
| 72 | info.MemoryUsage += NestedAnims.Capacity() * sizeof(Pair<String, NestedAnimData>); |
| 73 | for (auto& e : Events) |
| 74 | info.MemoryUsage += e.Second.GetKeyframes().Capacity() * sizeof(StepCurve<AnimEventData>); |
| 75 | return info; |
| 76 | } |
| 77 | |
| 78 | #if USE_EDITOR |
| 79 |
no test coverage detected