Skip to content

Commit

Permalink
Adding Sequence methods (#673)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmriggs authored and LtRipley36706 committed Mar 6, 2018
1 parent 41c04c3 commit a5bb9f2
Show file tree
Hide file tree
Showing 9 changed files with 329 additions and 65 deletions.
10 changes: 4 additions & 6 deletions Source/ACE.Server/Physics/Animation/AFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using ACE.Server.Physics.Extensions;

namespace ACE.Server.Physics.Animation
{
{
public class AFrame
{
public Vector3 Origin;
Expand Down Expand Up @@ -101,12 +101,10 @@ public void Rotate(Quaternion rotation)
Orientation = Quaternion.Multiply(rotation, Orientation);
}

public static AFrame Subtract(AFrame a, AFrame b)
public void Subtract(AFrame frame)
{
var frame = new AFrame();
frame.Origin = a.Origin - Vector3.Transform(b.Origin, a.Orientation);
frame.Orientation = Quaternion.Multiply(a.Orientation, b.Orientation);
return frame;
Origin -= Vector3.Transform(frame.Origin, frame.Orientation);
Orientation = Quaternion.Multiply(Orientation, frame.Orientation);
}

public bool close_rotation(AFrame a, AFrame b)
Expand Down
10 changes: 9 additions & 1 deletion Source/ACE.Server/Physics/Animation/AnimHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@

namespace ACE.Server.Physics.Animation
{
public enum AnimHookDir
{
Unknown = -2,
Backward = -1,
Both = 0,
Forward = 1,
}

public class AnimHook
{
public AnimHook NextHook;
public int Direction;
public AnimHookDir Direction;

public bool Execute(PhysicsObj obj)
{
Expand Down
6 changes: 3 additions & 3 deletions Source/ACE.Server/Physics/Animation/AnimSequenceNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ public AnimSequenceNode(AnimData animData)
set_animation_id(animData.AnimId);
}

public Animation GetNext()
public AnimSequenceNode GetNext()
{
return null;
}

public Animation GetPev()
public AnimSequenceNode GetPev()
{
return null;
}
Expand Down Expand Up @@ -86,7 +86,7 @@ public float get_starting_frame()
return HighFrame + 1 - PhysicsGlobals.EPSILON;
}

public bool has_anim(int appraisalProfile)
public bool has_anim(int appraisalProfile = 0)
{
return Anim != null;
}
Expand Down
4 changes: 1 addition & 3 deletions Source/ACE.Server/Physics/Animation/ObjectInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,8 @@ public TransitionState ValidateWalkable(Sphere checkPos, Plane contactPlane, boo
{
collision.SetCollisionNormal(contactPlane.Normal);
collision.CollidedWithEnvironment = true;
return TransitionState.Adjusted;
}
else
return TransitionState.Adjusted;
return TransitionState.Adjusted;
}
}
}
Expand Down
Loading

0 comments on commit a5bb9f2

Please sign in to comment.