Skip to content
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

Adding PhysicsObj Set* methods #652

Merged
merged 3 commits into from
Feb 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Source/ACE.Server/Physics/Animation/AFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@ public void set_heading(float degrees)
{

}

public double get_heading()
{
return -1;
}
}
}
15 changes: 15 additions & 0 deletions Source/ACE.Server/Physics/Animation/MovementManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,20 @@ public void SetWeenieObject(WeenieObject wobj)
{

}

public MotionInterp get_minterp()
{
return null;
}

public static MovementManager Create(PhysicsObj obj, WeenieObject wobj)
{
return null;
}

public void EnterDefaultState()
{

}
}
}
5 changes: 5 additions & 0 deletions Source/ACE.Server/Physics/Animation/ObjectInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,10 @@ public class ObjectInfo
public int Ethereal;
public int StepDown;
public int TargetID;

public void Init(PhysicsObj obj, ObjectInfoState state)
{

}
}
}
5 changes: 5 additions & 0 deletions Source/ACE.Server/Physics/Animation/PositionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ public class PositionManager
public StickyManager StickyManager;
public ConstraintManager ConstraintManager;
public PhysicsObj PhysicsObj;

public int GetStickyObjectID()
{
return -1;
}
}
}
5 changes: 5 additions & 0 deletions Source/ACE.Server/Physics/Animation/Sequence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,10 @@ public AnimFrame GetCurrAnimFrame()
{
return null;
}

public int GetCurrFrameNumber()
{
return -1;
}
}
}
2 changes: 1 addition & 1 deletion Source/ACE.Server/Physics/Animation/Setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class Setup
public int NumSphere;
public Sphere Sphere;
public int HasPhysicsBSP;
public int AllowFreeHeading;
public bool AllowFreeHeading;
public float Height;
public float Radius;
public float StepDownHeight;
Expand Down
35 changes: 35 additions & 0 deletions Source/ACE.Server/Physics/Animation/Transition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ public Transition()
NewCellPtr = new ObjCell();
}

public static Transition MakeTransition()
{
return null;
}

public void InitObject(PhysicsObj obj, ObjectInfoState objectState)
{
ObjectInfo.Init(obj, objectState);
}

public void CacheLocalSpaceSphere(Position pos, float scaleZ)
{

Expand All @@ -39,5 +49,30 @@ public bool StepUp(Vector3 collisionNormal)
{
return true;
}

public void InitSphere(int numSphere, Sphere sphere, float scale)
{
SpherePath.InitSphere(numSphere, new List<Sphere>() { sphere }, scale);
}

public void CleanupTransition()
{

}

public void InitContactPlane(int cellID, Plane contactPlane, bool isWater)
{

}

public void InitLastKnownContactPlane(int cellID, Plane contactPlane, bool isWater)
{

}

public void InitSlidingNormal(Vector3 normal)
{

}
}
}
2 changes: 1 addition & 1 deletion Source/ACE.Server/Physics/Collision/CollisionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class CollisionInfo
public int ContactPlaneCellID;
public int LastKnownContactPlaneCellID;
public bool ContactPlaneIsWater;
public int SlidingNormalValid;
public bool SlidingNormalValid;
public Vector3 SlidingNormal;
public bool CollisionNormalValid;
public Vector3 CollisionNormal;
Expand Down
5 changes: 5 additions & 0 deletions Source/ACE.Server/Physics/Common/LandDefs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@ public static Vector3 GetBlockOffset(int cellFrom, int cellTo)

return new Vector3(shift21Diff * 24, shift16Diff * 24, 0);
}

public static int gid_to_lcoord(int cellID, int x, int y)
{
return -1;
}
}
}
4 changes: 4 additions & 0 deletions Source/ACE.Server/Physics/Common/ObjectMaint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ namespace ACE.Server.Physics.Common
{
public class ObjectMaint
{
public void GotoLostCell(int cellID)
{

}
}
}
15 changes: 15 additions & 0 deletions Source/ACE.Server/Physics/Common/Position.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,20 @@ public Vector3 LocalToGlobalVec(Vector3 v)
{
return v;
}

public double Distance(Position pos)
{
return -1;
}

public double CylinderDistance(float curRadius, float curHeight, float radius, float height, Position pos)
{
return -1;
}

public Vector3 GlobalToLocalVec(Vector3 global)
{
return global;
}
}
}
26 changes: 26 additions & 0 deletions Source/ACE.Server/Physics/Common/Random.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;

namespace ACE.Server.Physics.Common
{
// probably should be moved outside the physics namespace
// important class, ensure unit tests pass for this
public class Random
{
public static System.Random RNG;

static Random()
{
RNG = new System.Random();
}

/// <summary>
/// Returns a random number between min and max
/// </summary>
public static float RollDice(float min, float max)
{
// todo: implement exactly the way AC handles it
// inclusive/exclusive?
return (float)(RNG.NextDouble() * (max - min) + min);
}
}
}
29 changes: 27 additions & 2 deletions Source/ACE.Server/Physics/Common/SetPosition.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
using System;
using System.Numerics;

namespace ACE.Server.Physics.Common
{
public enum SetPositionError
{
OK = 0x0,
GeneralFailure = 0x1,
NoValidPosition = 0x2,
NoCell = 0x3,
Collided = 0x4,
InvalidArguments = 0x100
};

[Flags]
public enum SetPositionFlags
{
Placement = 0x1,
Teleport = 0x2,
Restore = 0x4,
Slide = 0x10,
DontCreateCells = 0x20,
Scatter = 0x100,
RandomScatter = 0x200,
Line = 0x400,
SendPositionEvent = 0x1000,
};

public class SetPosition
{
public Position pos;
public int Flags;
public Position Pos;
public SetPositionFlags Flags;
public Vector3 Line;
public float RadX;
public float RadY;
Expand Down
10 changes: 10 additions & 0 deletions Source/ACE.Server/Physics/Common/WeenieObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,15 @@ namespace ACE.Server.Physics.Common
public class WeenieObject
{
public double UpdateTime;

public bool IsCorpse()
{
return false;
}

public bool IsStorage()
{
return false;
}
}
}
18 changes: 18 additions & 0 deletions Source/ACE.Server/Physics/Hooks/FPHook.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace ACE.Server.Physics.Hooks
{
public class FPHook: PhysicsObjHook
{
public float StartValue;
public float EndValue;

public FPHook(HookType type, double timeCreated, double delta, float startValue, float endValue, object userData)
{
HookType = type;
TimeCreated = timeCreated;
InterpolationTime = delta;
UserData = userData;
StartValue = startValue;
EndValue = endValue;
}
}
}
35 changes: 35 additions & 0 deletions Source/ACE.Server/Physics/Hooks/PhysicsObjHook.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;

namespace ACE.Server.Physics.Hooks
{
[Flags]
public enum HookType
{
Setup = 0x1,
MotionTable = 0x2,
Velocity = 0x4,
Acceleration = 0x8,
Omega = 0x10,
Parent = 0x20,
Children = 0x40,
ObjScale = 0x80,
Friction = 0x100,
Elasticity = 0x200,
Timestamps = 0x400,
Stable = 0x800,
PETable = 0x1000,
DefaultScript = 0x2000,
DefaultScriptIntensity = 0x4000,
Position = 0x8000,
Movement = 0x10000,
AnimFrameID = 0x20000,
Translucency = 0x40000,
};
public class PhysicsObjHook
{
public HookType HookType;
public double TimeCreated;
public double InterpolationTime;
public Object UserData;
}
}
10 changes: 10 additions & 0 deletions Source/ACE.Server/Physics/Hooks/VectorHook.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Numerics;

namespace ACE.Server.Physics.Hooks
{
public class VectorHook: PhysicsObjHook
{
public Vector3 Start;
public Vector3 End;
}
}
51 changes: 50 additions & 1 deletion Source/ACE.Server/Physics/PartArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class PartArray
public Vector3 Scale;
public AnimFrame LastAnimFrame;

public int AllowsFreeHeading()
public bool AllowsFreeHeading()
{
return Setup.AllowFreeHeading;
}
Expand Down Expand Up @@ -156,6 +156,11 @@ public int GetNumCylsphere()
return Setup.NumCylsphere;
}

public int GetNumSphere()
{
return Setup.NumSphere;
}

public float GetRadius()
{
return Setup.Radius * Scale.Z;
Expand Down Expand Up @@ -477,5 +482,49 @@ public void DestroyLights()
{

}

public void SetDiffusionInternal(float diff)
{

}

public void SetPartDiffusionInternal(int partIdx, float diff)
{
}

public void SetLightingInternal(float luminosity, float diffuse)
{

}

public bool SetPartLightingInternal(int partIdx, float luminosity, float diffuse)
{
return false;
}

public void SetLuminosityInternal(float luminosity)
{

}

public void SetPartLuminosityInternal(int partIdx, float luminosity)
{

}

public void SetPartTextureVelocityInternal(int partIdx, float du, float dv)
{

}

public void SetPartTranslucencyInternal(int partIdx, float translucency)
{

}

public void SetTextureVelocityInternal(float du, float dv)
{

}
}
}
Loading