//
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using System.Runtime.CompilerServices;
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
///
///
/// Sample implementation of PhysicsMaterial that just holds the needed properties directly
///
///
/// C++:
/// Jolt/Physics/Collision/PhysicsMaterialSimple.h:12
///
/// class PhysicsMaterialSimple : public PhysicsMaterial
///
///
[InteropHandle]
public readonly partial struct PhysicsMaterialSimple : IDisposable
{
///
///
/// Constructor
///
///
/// C++:
/// Jolt/Physics/Collision/PhysicsMaterialSimple.h:18
///
/// PhysicsMaterialSimple() = default
///
///
public static PhysicsMaterialSimple Create() => Jolt.PInvoke.PhysicsMaterialSimple_Create();
///
///
/// C++:
/// Jolt/Physics/Collision/PhysicsMaterialSimple.h:19
///
/// PhysicsMaterialSimple(const string_view &inName, ColorArg inColor)
///
///
public static unsafe PhysicsMaterialSimple Create(RefString8 name, uint color)
{
fixed (byte* name_fixed = name)
{
return Jolt.PInvoke.PhysicsMaterialSimple_Create_2(name_fixed, color);
}
}
///
public RTTI GetRTTI() => ((PhysicsMaterial)this).GetRTTI();
///
public unsafe Ptr CastTo(RTTI rtti) => ((PhysicsMaterial)this).CastTo(rtti);
///
public unsafe RefString8 GetDebugName() => ((PhysicsMaterial)this).GetDebugName();
///
public uint GetDebugColor() => ((PhysicsMaterial)this).GetDebugColor();
///
public void SaveBinaryState(StreamOut stream) => ((PhysicsMaterial)this).SaveBinaryState(stream);
public void AddRef() => ((PhysicsMaterial)this).AddRef();
public void Release() => ((PhysicsMaterial)this).Release();
public uint GetRefCount() => ((PhysicsMaterial)this).GetRefCount();
public static implicit operator PhysicsMaterial(PhysicsMaterialSimple value) =>
Unsafe.BitCast(value);
public void Dispose()
{
if (IsNull())
return;
Release();
}
///
public unsafe ByteSize SaveObjectStream(
Span buffer,
ObjectStreamType streamType = ObjectStreamType.Text
) => ((PhysicsMaterial)this).SaveObjectStream(buffer, streamType);
}
}