Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
AnimationOperation.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 
5 using SiliconStudio.Paradox.DataModel;
6 
7 namespace SiliconStudio.Paradox.Engine
8 {
9  /// <summary>
10  /// A single animation operation (push or blend).
11  /// </summary>
12  public struct AnimationOperation
13  {
15 
16  // Blend parameters
18  public float BlendFactor;
19 
20  // Push parameters
22  public TimeSpan Time;
23 
24  /// <summary>
25  /// Creates a new animation push operation.
26  /// </summary>
27  /// <param name="evaluator">The evaluator.</param>
28  /// <returns></returns>
30  {
31  return new AnimationOperation { Type = AnimationOperationType.Push, Evaluator = evaluator, Time = TimeSpan.Zero };
32  }
33 
34  /// <summary>
35  /// Creates a new animation push operation.
36  /// </summary>
37  /// <param name="evaluator">The evaluator.</param>
38  /// <param name="time">The time.</param>
39  /// <returns></returns>
40  public static AnimationOperation NewPush(AnimationClipEvaluator evaluator, TimeSpan time)
41  {
42  return new AnimationOperation { Type = AnimationOperationType.Push, Evaluator = evaluator, Time = time };
43  }
44 
45  /// <summary>
46  /// Creates a new animation pop operation.
47  /// </summary>
48  /// <param name="evaluator">The evaluator.</param>
49  /// <param name="time">The time.</param>
50  /// <returns></returns>
51  public static AnimationOperation NewPop(AnimationClipEvaluator evaluator, TimeSpan time)
52  {
53  return new AnimationOperation { Type = AnimationOperationType.Pop, Evaluator = evaluator, Time = time };
54  }
55 
56  /// <summary>
57  /// Creates a new animation blend operation.
58  /// </summary>
59  /// <param name="operation">The blend operation.</param>
60  /// <param name="blendFactor">The blend factor.</param>
61  /// <returns></returns>
62  public static AnimationOperation NewBlend(AnimationBlendOperation operation, float blendFactor)
63  {
64  return new AnimationOperation { Type = AnimationOperationType.Blend, BlendOperation = operation, BlendFactor = blendFactor };
65  }
66  }
67 }
static AnimationOperation NewBlend(AnimationBlendOperation operation, float blendFactor)
Creates a new animation blend operation.
AnimationBlendOperation
Describes the type of animation blend operation.
static AnimationOperation NewPush(AnimationClipEvaluator evaluator)
Creates a new animation push operation.
A single animation operation (push or blend).
static AnimationOperation NewPop(AnimationClipEvaluator evaluator, TimeSpan time)
Creates a new animation pop operation.
static AnimationOperation NewPush(AnimationClipEvaluator evaluator, TimeSpan time)
Creates a new animation push operation.
Blend
Blend option. A blend option identifies the data source and an optional pre-blend operation...
Definition: Blend.cs:14
Evaluates AnimationClip to a AnimationClipResult at a given time.