public void InitializePose(Pose.CGfxSkeletonPose pose)
 {
     OutPose            = pose.Clone();
     mMeshSpaceBasePose = pose.Clone();
     AdditiveNode?.InitializePose(pose);
     BaseNode?.InitializePose(pose);
 }
Example #2
0
        // This class sets the parents of all of the nodes as it traverses the AST.
        // Technically that step could be skipped to increase compile times
        // (though I saw almost no increase in time after making the change)
        // it allows for some extra optimizations while compiling.

        // In addition, to makes sure all of the code is correct
        // e.g. break and continue are used within loops.

        // It also determines which variables need to be captured for use
        // within a lambda.

        // Todo: Have Resolver determine if a script returns on all branches.
        //       If not, add a ReturnNode at the end of any ScriptNode so
        //       the compiler doesn't have to.
        //       This should also allow for some dead code eleminatation,
        //       which will help with output size to some degree.

        public void Visit(AdditiveNode additive)
        {
            additive.Left.Parent  = additive;
            additive.Right.Parent = additive;
            additive.Left.Accept(this);
            additive.Right.Accept(this);
        }
 public void InitializePose(Pose.CGfxSkeletonPose pose)
 {
     OutPose  = pose.Clone();
     mAddPose = pose.Clone();
     mRefPose = pose.Clone();
     AdditiveNode?.InitializePose(pose);
     RefNode?.InitializePose(pose);
 }
 public void Evaluate(float timeInSecond)
 {
     if (RefNode == null || AdditiveNode == null)
     {
         Bricks.Animation.Runtime.CGfxAnimationRuntime.ZeroPose(OutPose);
         return;
     }
     RefNode.Evaluate(timeInSecond);
     AdditiveNode.Evaluate(timeInSecond);
     Bricks.Animation.Runtime.CGfxAnimationRuntime.CopyPoseAndConvertRotationToMeshSpace(mAddPose, AdditiveNode.OutPose);
     Bricks.Animation.Runtime.CGfxAnimationRuntime.CopyPoseAndConvertRotationToMeshSpace(mRefPose, RefNode.OutPose);
     Bricks.Animation.Runtime.CGfxAnimationRuntime.MinusPose(OutPose, mRefPose, mAddPose);
 }
 public void Evaluate(float timeInSecond)
 {
     BaseNode?.Evaluate(timeInSecond);
     AdditiveNode?.Evaluate(timeInSecond);
     if (AdditiveNode == null && BaseNode != null)
     {
         Bricks.Animation.Runtime.CGfxAnimationRuntime.CopyPose(OutPose, BaseNode.OutPose);
         return;
     }
     if (AdditiveNode != null && BaseNode == null)
     {
         Bricks.Animation.Runtime.CGfxAnimationRuntime.CopyPose(OutPose, AdditiveNode.OutPose);
     }
     Bricks.Animation.Runtime.CGfxAnimationRuntime.CopyPoseAndConvertRotationToMeshSpace(mMeshSpaceBasePose, BaseNode.OutPose);
     if (EvaluateAlpha != null)
     {
         Bricks.Animation.Runtime.CGfxAnimationRuntime.AddPose(OutPose, mMeshSpaceBasePose, AdditiveNode.OutPose, EvaluateAlpha.Invoke());
     }
     else
     {
         Bricks.Animation.Runtime.CGfxAnimationRuntime.AddPose(OutPose, mMeshSpaceBasePose, AdditiveNode.OutPose, 1);
     }
     Bricks.Animation.Runtime.CGfxAnimationRuntime.ConvertRotationToLocalSpace(OutPose);
 }
 public void Notifying(GamePlay.Component.GComponent component)
 {
     BaseNode?.Notifying(component);
     AdditiveNode?.Notifying(component);
 }
 public AdditiveCompiler(AdditiveNode node)
 {
     this.node = node;
 }