public void DistanceToPoint(ScriptThread thread)
 {
     double vectorX = thread.GetDoubleParameter(0) - thread.GetDoubleParameter(2);
     double vectorY = thread.GetDoubleParameter(1) - thread.GetDoubleParameter(3);
     double distance = Math.Sqrt(vectorX * vectorX + vectorY * vectorY);
     thread.SetReturnValue(distance);
 }
 public void Floor(ScriptThread thread)
 {
     thread.SetReturnValue(Math.Floor(thread.GetDoubleParameter(0)));
 }
 public void Cosh(ScriptThread thread)
 {
     thread.SetReturnValue(Math.Cosh(thread.GetDoubleParameter(0)));
 }
 public void Atan2(ScriptThread thread)
 {
     thread.SetReturnValue(Math.Atan2(thread.GetDoubleParameter(0), thread.GetDoubleParameter(1)));
 }
 public void Round(ScriptThread thread)
 {
     thread.SetReturnValue(Math.Round(thread.GetDoubleParameter(0)));
 }
 public void LogB(ScriptThread thread)
 {
     thread.SetReturnValue(Math.Log(thread.GetDoubleParameter(0), thread.GetDoubleParameter(1)));
 }
Exemple #7
0
 public void StreamWriteH(ScriptThread thread)
 {
     ScriptStream stream = ((NativeObject)thread.GetObjectParameter(0)).Object as ScriptStream;
     if (stream == null)
     {
         DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called StreamWrite with an invalid object.", LogAlertLevel.Error);
         return;
     }
     stream.Writer.Write(thread.GetDoubleParameter(1));
 }