Skip to content

Commit

Permalink
Merge pull request sirkut#14 from erendrake/develop
Browse files Browse the repository at this point in the history
Pulling latest changes into my branch.
  • Loading branch information
ZiwKerman committed Mar 26, 2015
2 parents 08ba284 + 236dc03 commit 1f9343f
Show file tree
Hide file tree
Showing 6 changed files with 267 additions and 268 deletions.
21 changes: 17 additions & 4 deletions InfernalRobotics/InfernalRobotics/Command/Interpolator.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using UnityEngine; // for debug log output

namespace InfernalRobotics.Command
{
Expand All @@ -20,21 +19,36 @@ public Interpolator()
CmdPosition = 0f;
}

// dynamic state
#region dynamic state

public float CmdPosition { get; set; }

public float CmdVelocity { get; set; }

public bool Active { get; set; }

public float Position { get; set; }

public float OldPosition { get; set; }

public float Velocity { get; set; }

// config
#endregion dynamic state

#region config

public float MinPosition { get; set; }

public float MaxPosition { get; set; }

public float MaxVelocity { get; set; }

public float MaxAcceleration { get; set; }

public bool IsModulo { get; set; }

#endregion config

public float GetPosition()
{
return ReduceModulo(Position);
Expand All @@ -50,7 +64,6 @@ public void SetIncrementalCommand(float cPosDelta, float cVel)

public void SetCommand(float cPos, float cVel)
{

if (cVel != CmdVelocity || cPos != CmdPosition)
{
if (IsModulo)
Expand Down
8 changes: 3 additions & 5 deletions InfernalRobotics/InfernalRobotics/Effects/SoundSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace InfernalRobotics.Effects
{
/// <summary>
/// credit for sound support goes to the creators of the Kerbal Attachment
/// credit for sound support goes to the creators of the Kerbal Attachment
/// </summary>
public class SoundSource
{
Expand Down Expand Up @@ -57,7 +57,7 @@ public bool Setup(string soundPath, bool loop, float maxDistance = 10f)
motorSound.audio = null;
return false;
}

motorSound.audio = part.gameObject.AddComponent<AudioSource>();
motorSound.audio.volume = GameSettings.SHIP_VOLUME;
motorSound.audio.rolloffMode = AudioRolloffMode.Logarithmic;
Expand All @@ -72,9 +72,7 @@ public bool Setup(string soundPath, bool loop, float maxDistance = 10f)
}
catch (Exception ex)
{

Logger.Log(string.Format("SoundSource.Setup() exception {0}", ex.Message), Logger.Level.Fatal);

}
return false;
}
Expand All @@ -96,4 +94,4 @@ public void Update(float soundSet, float pitchSet)
motorSound.audio.pitch = pitchSet;
}
}
}
}
Loading

0 comments on commit 1f9343f

Please sign in to comment.