//
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
///
///
/// C++:
/// Jolt/Skeleton/SkeletalAnimation.h:17
///
/// class SkeletalAnimation : public RefTarget<SkeletalAnimation>
///
///
///
///
/// Resource for a skinned animation
///
///
[InteropHandle]
public readonly partial struct SkeletalAnimation : IDisposable
{
public static SkeletalAnimation Create() => Jolt.PInvoke.SkeletalAnimation_Create();
///
///
/// C++:
/// Jolt/Skeleton/SkeletalAnimation.h:62
///
/// float GetDuration() const
///
///
///
///
/// Get the length (in seconds) of this animation
///
///
public float GetDuration() => Jolt.PInvoke.SkeletalAnimation_GetDuration(this);
///
///
/// C++:
/// Jolt/Skeleton/SkeletalAnimation.h:65
///
/// void ScaleJoints(float inScale)
///
///
///
///
/// Scale the size of all joints by inScale
///
///
public void ScaleJoints(float scale) => Jolt.PInvoke.SkeletalAnimation_ScaleJoints(this, scale);
///
///
/// C++:
/// Jolt/Skeleton/SkeletalAnimation.h:68
///
/// void SetIsLooping(bool inIsLooping)
///
///
///
///
/// If the animation is looping or not. If an animation is looping, the animation will continue playing
/// after completion
///
///
public void SetIsLooping(bool isLooping) => Jolt.PInvoke.SkeletalAnimation_SetIsLooping(this, isLooping);
///
///
/// C++:
/// Jolt/Skeleton/SkeletalAnimation.h:69
///
/// bool IsLooping() const
///
///
public bool IsLooping() => Jolt.PInvoke.SkeletalAnimation_IsLooping(this);
///
///
/// C++:
/// Jolt/Skeleton/SkeletalAnimation.h:72
///
/// void Sample(float inTime, SkeletonPose &ioPose) const
///
///
///
///
/// Get the (interpolated) joint transforms at time inTime
///
///
public void Sample(float time, SkeletonPose pose) => Jolt.PInvoke.SkeletalAnimation_Sample(this, time, pose);
///
///
/// C++:
/// Jolt/Skeleton/SkeletalAnimation.h:79
///
/// void SaveBinaryState(StreamOut &inStream) const
///
///
///
///
/// Saves the state of this animation in binary form to inStream.
///
///
public void SaveBinaryState(StreamOut stream) => Jolt.PInvoke.SkeletalAnimation_SaveBinaryState(this, stream);
///
///
/// C++:
/// Jolt/Skeleton/SkeletalAnimation.h:84
///
/// static AnimationResult sRestoreFromBinaryState(StreamIn &inStream)
///
///
///
///
/// Restore a saved ragdoll from inStream
///
///
/// Throws InvalidOperationException with Jolt's error message when the operation fails.
///
///
public static SkeletalAnimation sRestoreFromBinaryState(StreamIn stream)
{
var _handle = Jolt.PInvoke.SkeletalAnimation_sRestoreFromBinaryState(stream);
if (_handle.IsNull()) throw new InvalidOperationException(Jolt.GetLastError());
return _handle;
}
public void AddRef() => Jolt.PInvoke.SkeletalAnimation_AddRef(this);
public void Release() => Jolt.PInvoke.SkeletalAnimation_Release(this);
public uint GetRefCount() => Jolt.PInvoke.SkeletalAnimation_GetRefCount(this);
public void Dispose()
{
if (IsNull()) return;
Release();
}
}
}