//
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:37
///
/// class CapsuleShape final : public ConvexShape
///
///
///
///
/// A capsule, implemented as a line segment with convex radius
///
///
[InteropHandle]
public readonly partial struct CapsuleShape : IDisposable
{
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:43
///
/// CapsuleShape()
///
///
///
///
/// Constructor
///
///
public static CapsuleShape Create() => Jolt.PInvoke.CapsuleShape_Create();
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:47
///
/// CapsuleShape(float inHalfHeightOfCylinder, float inRadius, const PhysicsMaterial *inMaterial = nullptr)
///
///
///
///
/// Create a capsule centered around the origin with one sphere cap at (0, -inHalfHeightOfCylinder, 0) and
/// the other at (0, inHalfHeightOfCylinder, 0)
///
///
public static CapsuleShape Create(float halfHeightOfCylinder, float radius, PhysicsMaterial material) => Jolt.PInvoke.CapsuleShape_Create_2(halfHeightOfCylinder, radius, material);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:50
///
/// float GetRadius() const
///
///
///
///
/// Radius of the cylinder
///
///
public float GetRadius() => Jolt.PInvoke.CapsuleShape_GetRadius(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:53
///
/// float GetHalfHeightOfCylinder() const
///
///
///
///
/// Get half of the height of the cylinder
///
///
public float GetHalfHeightOfCylinder() => Jolt.PInvoke.CapsuleShape_GetHalfHeightOfCylinder(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:63
///
/// virtual float GetInnerRadius() const override
///
///
///
///
/// See Shape::GetInnerRadius
///
///
public float GetInnerRadius() => Jolt.PInvoke.CapsuleShape_GetInnerRadius(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:69
///
/// virtual Vec3 GetSurfaceNormal(const SubShapeID &inSubShapeID, Vec3Arg inLocalSurfacePosition) const override
///
///
///
///
/// See Shape::GetSurfaceNormal
///
///
public float3 GetSurfaceNormal(uint subShapeID, float3 localSurfacePosition) => Jolt.PInvoke.CapsuleShape_GetSurfaceNormal(this, subShapeID, localSurfacePosition);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:79
///
/// virtual void Draw(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, Vec3Arg inScale, ColorArg inColor, bool inUseMaterialColors, bool inDrawWireframe) const override
///
///
///
///
/// See Shape::Draw
///
///
public void Draw(DebugRenderer renderer, float4x4 centerOfMassTransform, float3 scale, uint color, bool useMaterialColors, bool drawWireframe) => Jolt.PInvoke.CapsuleShape_Draw(this, renderer, centerOfMassTransform, scale, color, useMaterialColors, drawWireframe);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:90
///
/// virtual void CollideSoftBodyVertices(Mat44Arg inCenterOfMassTransform, Vec3Arg inScale, const CollideSoftBodyVertexIterator &inVertices, uint inNumVertices, int inCollidingShapeIndex) const override
///
///
///
///
/// See: Shape::CollideSoftBodyVertices
///
///
public void CollideSoftBodyVertices(float4x4 centerOfMassTransform, float3 scale, CollideSoftBodyVertexIterator vertices, uint numVertices, int collidingShapeIndex) => Jolt.PInvoke.CapsuleShape_CollideSoftBodyVertices(this, centerOfMassTransform, scale, vertices, numVertices, collidingShapeIndex);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:93
///
/// virtual void GetTrianglesStart(GetTrianglesContext &ioContext, const AABox &inBox, Vec3Arg inPositionCOM, QuatArg inRotation, Vec3Arg inScale) const override
///
///
///
///
/// See Shape::GetTrianglesStart
///
///
public void GetTrianglesStart(ref Shape.GetTrianglesContext context, AABox box, float3 positionCOM, floatQuat rotation, float3 scale) => Jolt.PInvoke.CapsuleShape_GetTrianglesStart(this, ref context, box, positionCOM, rotation, scale);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:99
///
/// virtual void SaveBinaryState(StreamOut &inStream) const override
///
///
///
///
/// See Shape
///
///
public void SaveBinaryState(StreamOut stream) => Jolt.PInvoke.CapsuleShape_SaveBinaryState(this, stream);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:105
///
/// virtual float GetVolume() const override
///
///
///
///
/// See Shape::GetVolume
///
///
public float GetVolume() => Jolt.PInvoke.CapsuleShape_GetVolume(this);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:108
///
/// virtual bool IsValidScale(Vec3Arg inScale) const override
///
///
///
///
/// See Shape::IsValidScale
///
///
public bool IsValidScale(float3 scale) => Jolt.PInvoke.CapsuleShape_IsValidScale(this, scale);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:111
///
/// virtual Vec3 MakeScaleValid(Vec3Arg inScale) const override
///
///
///
///
/// See Shape::MakeScaleValid
///
///
public float3 MakeScaleValid(float3 scale) => Jolt.PInvoke.CapsuleShape_MakeScaleValid(this, scale);
///
///
/// C++:
/// Jolt/Physics/Collision/Shape/CapsuleShape.h:114
///
/// static void sRegister()
///
///
///
///
/// Register shape functions with the registry
///
///
public static void sRegister() => Jolt.PInvoke.CapsuleShape_sRegister();
public void AddRef() => Jolt.PInvoke.CapsuleShape_AddRef(this);
public void Release() => Jolt.PInvoke.CapsuleShape_Release(this);
public uint GetRefCount() => Jolt.PInvoke.CapsuleShape_GetRefCount(this);
public static implicit operator ConvexShape(CapsuleShape value) => Jolt.PInvoke.CapsuleShape_AsConvexShape(value);
public static implicit operator Shape(CapsuleShape value) => Jolt.PInvoke.CapsuleShape_AsShape(value);
public void Dispose()
{
if (IsNull()) return;
Release();
}
}
}