-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
refactor: Discard internal use of FastList #2798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
7d72ba4
4d6c760
3d7a7c2
0f3e699
708d854
f6712c3
b2c29fd
abdbc3c
1e4e6d3
629bd14
1a55d68
6720edc
1ad0b75
e2d810a
fc544dc
11a9c12
c91fd25
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Runtime.InteropServices; | ||
| using Stride.Core.BuildEngine; | ||
| using Stride.Core.Collections; | ||
| using Stride.Core.Extensions; | ||
|
|
@@ -158,7 +159,7 @@ private unsafe object ExportAnimation(ICommandContext commandContext, ContentMan | |
| var animationKeys = animationKeysSet.ToList(); | ||
| animationKeys.Sort(); | ||
|
|
||
| var animationOperations = new FastList<AnimationOperation>(); | ||
| var animationOperations = new List<AnimationOperation>(); | ||
|
|
||
| var combinedAnimationClip = new AnimationClip(); | ||
|
|
||
|
|
@@ -241,11 +242,12 @@ private unsafe object ExportAnimation(ICommandContext commandContext, ContentMan | |
| { | ||
| // Translate node with parent 0 using PivotPosition | ||
| var keyFrames = ((AnimationCurve<Vector3>)curve).KeyFrames; | ||
| var keyFramesSpan = CollectionsMarshal.AsSpan(keyFrames); | ||
| for (int i = 0; i < keyFrames.Count; ++i) | ||
| { | ||
| if (parentNodeIndex == 0) | ||
| keyFrames.Items[i].Value -= PivotPosition; | ||
| keyFrames.Items[i].Value *= ScaleImport; | ||
| keyFramesSpan[i].Value -= PivotPosition; | ||
| keyFramesSpan[i].Value *= ScaleImport; | ||
| } | ||
|
Comment on lines
244
to
251
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
| animationClip.AddCurve($"[ModelComponent.Key].Skeleton.NodeTransformations[{skeletonMapping.SourceToTarget[nodeIndex]}]." + channelName, curve); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,20 +3,21 @@ | |
|
|
||
| using System; | ||
| using Stride.Core.Mathematics; | ||
| using System.Runtime.InteropServices; | ||
|
|
||
| namespace Stride.Animations | ||
| { | ||
| public class AnimationCurveEvaluatorDirectFloatGroup : AnimationCurveEvaluatorDirectBlittableGroupBase<float> | ||
| { | ||
| protected unsafe override void ProcessChannel(ref Channel channel, CompressedTimeSpan newTime, IntPtr location) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW, I Adjusted the location with unsafe and unsafe |
||
| protected override unsafe void ProcessChannel(ref Channel channel, CompressedTimeSpan newTime, IntPtr location) | ||
| { | ||
| SetTime(ref channel, newTime); | ||
|
|
||
| var currentTime = channel.CurrentTime; | ||
| var currentIndex = channel.CurrentIndex; | ||
|
|
||
| var keyFrames = channel.Curve.KeyFrames; | ||
| var keyFramesItems = keyFrames.Items; | ||
| var keyFramesItems = CollectionsMarshal.AsSpan(keyFrames); | ||
| var keyFramesCount = keyFrames.Count; | ||
|
|
||
| // Extract data | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I delete this, because the method is 0 used , and if deleted , the scripts will easier to maintain , if not it will cause misunderstandings to others
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dispatcher is public, users could be calling this method in their project, so we should leave it for for now and remove it once we remove
FastList<T>