large worlds engine compat refactor, change vector -> float
This commit is contained in:
@@ -34,7 +34,7 @@ namespace Game
|
||||
|
||||
public override void OnStart()
|
||||
{
|
||||
Vector3 initialEulerAngles = Actor.Orientation.EulerAngles;
|
||||
Float3 initialEulerAngles = Actor.Orientation.EulerAngles;
|
||||
viewPitch = initialEulerAngles.X;
|
||||
viewYaw = initialEulerAngles.Y;
|
||||
viewRoll = initialEulerAngles.Z;
|
||||
@@ -62,7 +62,7 @@ namespace Game
|
||||
|
||||
float inputH = InputManager.GetAxis("Horizontal");
|
||||
float inputV = InputManager.GetAxis("Vertical");
|
||||
Vector3 move = new Vector3(inputH, 0.0f, inputV);
|
||||
Float3 move = new Float3(inputH, 0.0f, inputV);
|
||||
|
||||
if (!move.IsZero)
|
||||
{
|
||||
@@ -70,7 +70,7 @@ namespace Game
|
||||
move = camera.Transform.TransformDirection(move) * MoveSpeed;
|
||||
|
||||
{
|
||||
Vector3 delta = move * Time.UnscaledDeltaTime;
|
||||
Float3 delta = move * Time.UnscaledDeltaTime;
|
||||
float movementLeft = delta.Length;
|
||||
|
||||
// TODO: check multiple times in case we get stuck in walls
|
||||
@@ -83,7 +83,7 @@ namespace Game
|
||||
|
||||
//bool nohit = true;
|
||||
float hitDistance = moveDist;
|
||||
Vector3 hitNormal = move.Normalized;
|
||||
Float3 hitNormal = move.Normalized;
|
||||
foreach (RayCastHit hitInfo in hitInfos)
|
||||
{
|
||||
if (hitInfo.Collider.Parent == Parent)
|
||||
@@ -99,7 +99,7 @@ namespace Game
|
||||
}
|
||||
|
||||
if (hitDistance != moveDist)
|
||||
//camTrans.Translation = Vector3.Lerp(Actor.Transform.Translation, camTrans.Translation, hitDistance);
|
||||
//camTrans.Translation = Float3.Lerp(Actor.Transform.Translation, camTrans.Translation, hitDistance);
|
||||
|
||||
//projected = normal * dot(direction, normal);
|
||||
//direction = direction - projected
|
||||
@@ -107,7 +107,7 @@ namespace Game
|
||||
//camTrans.Translation += hitNormal * (moveDist - hitDistance); // correct?
|
||||
//camTrans.Translation = hitNormal * (move * hitNormal); // correct?
|
||||
//camTrans.Translation = Actor.Transform.Translation;
|
||||
delta += -Vector3.Dot(delta, hitNormal) * hitNormal; // correct?
|
||||
delta += -Float3.Dot(delta, hitNormal) * hitNormal; // correct?
|
||||
|
||||
camTrans.Translation += delta;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user