add osSlerp()

This commit is contained in:
UbitUmarov
2019-09-04 23:27:48 +01:00
parent 7771cc00c4
commit 93f13aa00d
5 changed files with 72 additions and 1 deletions

View File

@@ -5554,5 +5554,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
DateTime time = TimeZoneInfo.ConvertTime(DateTime.UtcNow, PSTTimeZone);
return time.TimeOfDay.TotalSeconds;
}
public LSL_Rotation osSlerp(LSL_Rotation a, LSL_Rotation b, LSL_Float amount)
{
if(amount < 0)
amount= 0;
else if(amount > 1.0)
amount = 1.0;
a.Normalize();
b.Normalize();
return LSL_Rotation.Slerp(a, b, amount);
}
}
}

View File

@@ -36,6 +36,7 @@ using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list;
using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat;
using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
using LSL_Key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
@@ -554,5 +555,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_String osGetInventoryDesc(LSL_String itemNameOrId);
LSL_Key osGetLastChangedEventKey();
LSL_Float osGetPSTWallclock();
LSL_Rotation osSlerp(LSL_Rotation a, LSL_Rotation b, LSL_Float amount);
}
}

View File

@@ -35,7 +35,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public partial class ScriptBaseClass
{
// SCRIPTS CONSTANTS
public static readonly LSLInteger OS_APIVERSION = 7;
public static readonly LSLInteger OS_APIVERSION = 8;
public static readonly LSLInteger TRUE = 1;
public static readonly LSLInteger FALSE = 0;

View File

@@ -1407,5 +1407,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osGetPSTWallclock();
}
public rotation osSlerp(rotation a, rotation b, LSL_Float amount)
{
return m_OSSL_Functions.osSlerp(a, b, amount);
}
}
}