mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
add osSlerp()
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user