Beispiel #1
0
        public static void Reserve(ref ArrayMemory memory, ref Binary binary)
        {
            var numJoints = binary.numJoints;

            memory.Reserve <AffineTransform>(2 * numJoints);
            memory.Reserve <TransformTransition>(numJoints);
        }
        internal static void Reserve(ref ArrayMemory memory, ref Binary binary)
        {
            float sampleRate  = binary.SampleRate;
            float timeHorizon = binary.TimeHorizon;

            int trajectoryLength =
                DurationToFrames(timeHorizon * 2.0f, sampleRate);

            memory.Reserve <AffineTransform>(trajectoryLength);
            memory.Reserve <AccumulatedTransform>(trajectoryLength * 2);
        }
            Memory(int numTransforms, Allocator allocator)
            {
                int transformSize = 0;

                unsafe
                {
                    transformSize = UnsafeUtility.SizeOf <AffineTransform>();
                }

                memory = ArrayMemory.Create();
                memory.Reserve <AffineTransform>(numTransforms);
                memory.Allocate(allocator);

                buffer = Create(ref memory, numTransforms);
            }