mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
450 lines
25 KiB
C#
450 lines
25 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.Jolt.Generate; do not edit by hand.
|
|
#nullable enable
|
|
|
|
using Brutal.Interop;
|
|
using Brutal.Numerics;
|
|
namespace Brutal.JoltApi
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L115">Jolt/Physics/Collision/Shape/HeightFieldShape.h:115</see>
|
|
/// <br/>
|
|
/// <c>class HeightFieldShape final : public Shape</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// A height field shape. Cannot be used as a dynamic object.
|
|
///
|
|
/// Note: If you're using HeightFieldShape and are querying data while modifying the shape you'll have a race condition.
|
|
/// In this case it is best to create a new HeightFieldShape using the Clone function. You replace the shape on a body using BodyInterface::SetShape.
|
|
/// If a query is still working on the old shape, it will have taken a reference and keep the old shape alive until the query finishes.
|
|
/// </code>
|
|
/// </remarks>
|
|
[InteropHandle]
|
|
public readonly partial struct HeightFieldShape : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L337">Jolt/Physics/Collision/Shape/HeightFieldShape.h:337</see>
|
|
/// <br/>
|
|
/// <c>struct alignas(16) RangeBlock</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// A block of 2x2 ranges used to form a hierarchical grid, ordered left top, right top, left bottom, right
|
|
/// bottom
|
|
/// </para>
|
|
/// </remarks>
|
|
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
|
public struct RangeBlock
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L339">Jolt/Physics/Collision/Shape/HeightFieldShape.h:339</see>
|
|
/// <br/>
|
|
/// <c>uint16 mMin[4]</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(0)]
|
|
public ushort_4 mMin;
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L340">Jolt/Physics/Collision/Shape/HeightFieldShape.h:340</see>
|
|
/// <br/>
|
|
/// <c>uint16 mMax[4]</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(8)]
|
|
public ushort_4 mMax;
|
|
}
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L121">Jolt/Physics/Collision/Shape/HeightFieldShape.h:121</see>
|
|
/// <br/>
|
|
/// <c>HeightFieldShape()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Constructor
|
|
/// </para>
|
|
/// </remarks>
|
|
public static HeightFieldShape Create() => Jolt.PInvoke.HeightFieldShape_Create();
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L126">Jolt/Physics/Collision/Shape/HeightFieldShape.h:126</see>
|
|
/// <br/>
|
|
/// <c>Ref<HeightFieldShape> Clone() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Clone this shape. Can be used to avoid race conditions. See the documentation of this class for more
|
|
/// information.
|
|
/// </para>
|
|
/// </remarks>
|
|
public HeightFieldShape Clone() => Jolt.PInvoke.HeightFieldShape_Clone(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L129">Jolt/Physics/Collision/Shape/HeightFieldShape.h:129</see>
|
|
/// <br/>
|
|
/// <c>virtual bool MustBeStatic() const override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// See Shape::MustBeStatic
|
|
/// </para>
|
|
/// </remarks>
|
|
public bool MustBeStatic() => Jolt.PInvoke.HeightFieldShape_MustBeStatic(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L132">Jolt/Physics/Collision/Shape/HeightFieldShape.h:132</see>
|
|
/// <br/>
|
|
/// <c>inline uint GetSampleCount() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Get the size of the height field. Note that this will always be rounded up to the nearest multiple of
|
|
/// GetBlockSize().
|
|
/// </para>
|
|
/// </remarks>
|
|
public uint GetSampleCount() => Jolt.PInvoke.HeightFieldShape_GetSampleCount(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L135">Jolt/Physics/Collision/Shape/HeightFieldShape.h:135</see>
|
|
/// <br/>
|
|
/// <c>inline uint GetBlockSize() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Get the size of a block
|
|
/// </para>
|
|
/// </remarks>
|
|
public uint GetBlockSize() => Jolt.PInvoke.HeightFieldShape_GetBlockSize(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L141">Jolt/Physics/Collision/Shape/HeightFieldShape.h:141</see>
|
|
/// <br/>
|
|
/// <c>virtual uint GetSubShapeIDBitsRecursive() const override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// See Shape::GetSubShapeIDBitsRecursive
|
|
/// </para>
|
|
/// </remarks>
|
|
public uint GetSubShapeIDBitsRecursive() => Jolt.PInvoke.HeightFieldShape_GetSubShapeIDBitsRecursive(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L144">Jolt/Physics/Collision/Shape/HeightFieldShape.h:144</see>
|
|
/// <br/>
|
|
/// <c>virtual float GetInnerRadius() const override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// See Shape::GetInnerRadius
|
|
/// </para>
|
|
/// </remarks>
|
|
public float GetInnerRadius() => Jolt.PInvoke.HeightFieldShape_GetInnerRadius(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L150">Jolt/Physics/Collision/Shape/HeightFieldShape.h:150</see>
|
|
/// <br/>
|
|
/// <c>virtual const PhysicsMaterial * GetMaterial(const SubShapeID &inSubShapeID) const override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// See Shape::GetMaterial
|
|
/// </para>
|
|
/// </remarks>
|
|
public PhysicsMaterial GetMaterial(uint subShapeID) => Jolt.PInvoke.HeightFieldShape_GetMaterial(this, subShapeID);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L153">Jolt/Physics/Collision/Shape/HeightFieldShape.h:153</see>
|
|
/// <br/>
|
|
/// <c>const PhysicsMaterial * GetMaterial(uint inX, uint inY) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Overload to get the material at a particular location
|
|
/// </para>
|
|
/// </remarks>
|
|
public PhysicsMaterial GetMaterial(uint x, uint y) => Jolt.PInvoke.HeightFieldShape_GetMaterial_2(this, x, y);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L156">Jolt/Physics/Collision/Shape/HeightFieldShape.h:156</see>
|
|
/// <br/>
|
|
/// <c>virtual Vec3 GetSurfaceNormal(const SubShapeID &inSubShapeID, Vec3Arg inLocalSurfacePosition) const override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// See Shape::GetSurfaceNormal
|
|
/// </para>
|
|
/// </remarks>
|
|
public float3 GetSurfaceNormal(uint subShapeID, float3 localSurfacePosition) => Jolt.PInvoke.HeightFieldShape_GetSurfaceNormal(this, subShapeID, localSurfacePosition);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L162">Jolt/Physics/Collision/Shape/HeightFieldShape.h:162</see>
|
|
/// <br/>
|
|
/// <c>virtual void GetSubmergedVolume(Mat44Arg inCenterOfMassTransform, Vec3Arg inScale, const Plane &inSurface, float &outTotalVolume, float &outSubmergedVolume, Vec3 &outCenterOfBuoyancy JPH_IF_DEBUG_RENDERER(, RVec3Arg inBaseOffset)) const override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// See Shape::GetSubmergedVolume
|
|
/// </para>
|
|
/// </remarks>
|
|
public void GetSubmergedVolume(float4x4 centerOfMassTransform, float3 scale, Plane surface, out float totalVolume, out float submergedVolume, out float3 centerOfBuoyancy, float3 baseOffset) => Jolt.PInvoke.HeightFieldShape_GetSubmergedVolume(this, centerOfMassTransform, scale, surface, out totalVolume, out submergedVolume, out centerOfBuoyancy, baseOffset);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L166">Jolt/Physics/Collision/Shape/HeightFieldShape.h:166</see>
|
|
/// <br/>
|
|
/// <c>virtual void Draw(DebugRenderer *inRenderer, RMat44Arg inCenterOfMassTransform, Vec3Arg inScale, ColorArg inColor, bool inUseMaterialColors, bool inDrawWireframe) const override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// See Shape::Draw
|
|
/// </para>
|
|
/// </remarks>
|
|
public void Draw(DebugRenderer renderer, float4x4 centerOfMassTransform, float3 scale, uint color, bool useMaterialColors, bool drawWireframe) => Jolt.PInvoke.HeightFieldShape_Draw(this, renderer, centerOfMassTransform, scale, color, useMaterialColors, drawWireframe);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L177">Jolt/Physics/Collision/Shape/HeightFieldShape.h:177</see>
|
|
/// <br/>
|
|
/// <c>virtual void CollideSoftBodyVertices(Mat44Arg inCenterOfMassTransform, Vec3Arg inScale, const CollideSoftBodyVertexIterator &inVertices, uint inNumVertices, int inCollidingShapeIndex) const override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// See: Shape::CollideSoftBodyVertices
|
|
/// </para>
|
|
/// </remarks>
|
|
public void CollideSoftBodyVertices(float4x4 centerOfMassTransform, float3 scale, CollideSoftBodyVertexIterator vertices, uint numVertices, int collidingShapeIndex) => Jolt.PInvoke.HeightFieldShape_CollideSoftBodyVertices(this, centerOfMassTransform, scale, vertices, numVertices, collidingShapeIndex);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L180">Jolt/Physics/Collision/Shape/HeightFieldShape.h:180</see>
|
|
/// <br/>
|
|
/// <c>virtual void GetTrianglesStart(GetTrianglesContext &ioContext, const AABox &inBox, Vec3Arg inPositionCOM, QuatArg inRotation, Vec3Arg inScale) const override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// See Shape::GetTrianglesStart
|
|
/// </para>
|
|
/// </remarks>
|
|
public void GetTrianglesStart(ref Shape.GetTrianglesContext context, AABox box, float3 positionCOM, floatQuat rotation, float3 scale) => Jolt.PInvoke.HeightFieldShape_GetTrianglesStart(this, ref context, box, positionCOM, rotation, scale);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L187">Jolt/Physics/Collision/Shape/HeightFieldShape.h:187</see>
|
|
/// <br/>
|
|
/// <c>Vec3 GetPosition(uint inX, uint inY) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Get height field position at sampled location (inX, inY).
|
|
/// where inX and inY are integers in the range inX e [0, mSampleCount - 1] and inY e [0, mSampleCount - 1].
|
|
/// </code>
|
|
/// </remarks>
|
|
public float3 GetPosition(uint x, uint y) => Jolt.PInvoke.HeightFieldShape_GetPosition(this, x, y);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L190">Jolt/Physics/Collision/Shape/HeightFieldShape.h:190</see>
|
|
/// <br/>
|
|
/// <c>bool IsNoCollision(uint inX, uint inY) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Check if height field at sampled location (inX, inY) has collision (has a hole or not)
|
|
/// </para>
|
|
/// </remarks>
|
|
public bool IsNoCollision(uint x, uint y) => Jolt.PInvoke.HeightFieldShape_IsNoCollision(this, x, y);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L194">Jolt/Physics/Collision/Shape/HeightFieldShape.h:194</see>
|
|
/// <br/>
|
|
/// <c>bool ProjectOntoSurface(Vec3Arg inLocalPosition, Vec3 &outSurfacePosition, SubShapeID &outSubShapeID) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Projects inLocalPosition (a point in the space of the shape) along the Y axis onto the surface and returns it in outSurfacePosition.
|
|
/// When there is no surface position (because of a hole or because the point is outside the heightfield) the function will return false.
|
|
/// </code>
|
|
/// </remarks>
|
|
public bool ProjectOntoSurface(float3 localPosition, out float3 surfacePosition, out uint subShapeID) => Jolt.PInvoke.HeightFieldShape_ProjectOntoSurface(this, localPosition, out surfacePosition, out subShapeID);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L204">Jolt/Physics/Collision/Shape/HeightFieldShape.h:204</see>
|
|
/// <br/>
|
|
/// <c>float GetMinHeightValue() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Get the range of height values that this height field can encode. Can be used to determine the allowed
|
|
/// range when setting the height values with SetHeights.
|
|
/// </para>
|
|
/// </remarks>
|
|
public float GetMinHeightValue() => Jolt.PInvoke.HeightFieldShape_GetMinHeightValue(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L205">Jolt/Physics/Collision/Shape/HeightFieldShape.h:205</see>
|
|
/// <br/>
|
|
/// <c>float GetMaxHeightValue() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float GetMaxHeightValue() => Jolt.PInvoke.HeightFieldShape_GetMaxHeightValue(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L215">Jolt/Physics/Collision/Shape/HeightFieldShape.h:215</see>
|
|
/// <br/>
|
|
/// <c>void GetHeights(uint inX, uint inY, uint inSizeX, uint inSizeY, float *outHeights, intptr_t inHeightsStride) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Get the height values of a block of data.
|
|
/// Note that the height values are decompressed so will be slightly different from what the shape was originally created with.
|
|
/// @param inX Start X position, must be a multiple of mBlockSize and in the range [0, mSampleCount - 1]
|
|
/// @param inY Start Y position, must be a multiple of mBlockSize and in the range [0, mSampleCount - 1]
|
|
/// @param inSizeX Number of samples in X direction, must be a multiple of mBlockSize and in the range [0, mSampleCount - inX]
|
|
/// @param inSizeY Number of samples in Y direction, must be a multiple of mBlockSize and in the range [0, mSampleCount - inY]
|
|
/// @param outHeights Returned height values, must be at least inSizeX * inSizeY floats. Values are returned in x-major order and can be cNoCollisionValue.
|
|
/// @param inHeightsStride Stride in floats between two consecutive rows of outHeights (can be negative if the data is upside down).
|
|
/// </code>
|
|
/// </remarks>
|
|
public unsafe void GetHeights(uint x, uint y, uint sizeX, uint sizeY, Ptr<float> heights, long heightsStride) => Jolt.PInvoke.HeightFieldShape_GetHeights(this, x, y, sizeX, sizeY, heights, heightsStride);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L228">Jolt/Physics/Collision/Shape/HeightFieldShape.h:228</see>
|
|
/// <br/>
|
|
/// <c>void SetHeights(uint inX, uint inY, uint inSizeX, uint inSizeY, const float *inHeights, intptr_t inHeightsStride, TempAllocator &inAllocator, float inActiveEdgeCosThresholdAngle = 0.996195f)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Set the height values of a block of data.
|
|
/// Note that this requires decompressing and recompressing a border of size mBlockSize in the negative x/y direction so will cause some precision loss.
|
|
/// Beware this can create a race condition if you're running collision queries in parallel. See class documentation for more information.
|
|
/// @param inX Start X position, must be a multiple of mBlockSize and in the range [0, mSampleCount - 1]
|
|
/// @param inY Start Y position, must be a multiple of mBlockSize and in the range [0, mSampleCount - 1]
|
|
/// @param inSizeX Number of samples in X direction, must be a multiple of mBlockSize and in the range [0, mSampleCount - inX]
|
|
/// @param inSizeY Number of samples in Y direction, must be a multiple of mBlockSize and in the range [0, mSampleCount - inY]
|
|
/// @param inHeights The new height values to set, must be an array of inSizeX * inSizeY floats, can be cNoCollisionValue. Values outside of the range [GetMinHeightValue(), GetMaxHeightValue()] will be clamped.
|
|
/// @param inHeightsStride Stride in floats between two consecutive rows of inHeights (can be negative if the data is upside down).
|
|
/// @param inAllocator Allocator to use for temporary memory
|
|
/// @param inActiveEdgeCosThresholdAngle Cosine of the threshold angle (if the angle between the two triangles is bigger than this, the edge is active, note that a concave edge is always inactive).
|
|
/// </code>
|
|
/// </remarks>
|
|
public unsafe void SetHeights(uint x, uint y, uint sizeX, uint sizeY, Ptr<float> heights, long heightsStride, TempAllocator allocator, float activeEdgeCosThresholdAngle) => Jolt.PInvoke.HeightFieldShape_SetHeights(this, x, y, sizeX, sizeY, heights, heightsStride, allocator, activeEdgeCosThresholdAngle);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L240">Jolt/Physics/Collision/Shape/HeightFieldShape.h:240</see>
|
|
/// <br/>
|
|
/// <c>void GetMaterials(uint inX, uint inY, uint inSizeX, uint inSizeY, uint8 *outMaterials, intptr_t inMaterialsStride) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Get the material indices of a block of data.
|
|
/// @param inX Start X position, must in the range [0, mSampleCount - 1]
|
|
/// @param inY Start Y position, must in the range [0, mSampleCount - 1]
|
|
/// @param inSizeX Number of samples in X direction
|
|
/// @param inSizeY Number of samples in Y direction
|
|
/// @param outMaterials Returned material indices, must be at least inSizeX * inSizeY uint8s. Values are returned in x-major order.
|
|
/// @param inMaterialsStride Stride in uint8s between two consecutive rows of outMaterials (can be negative if the data is upside down).
|
|
/// </code>
|
|
/// </remarks>
|
|
public unsafe void GetMaterials(uint x, uint y, uint sizeX, uint sizeY, Ptr<byte> materials, long materialsStride) => Jolt.PInvoke.HeightFieldShape_GetMaterials(this, x, y, sizeX, sizeY, materials, materialsStride);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L256">Jolt/Physics/Collision/Shape/HeightFieldShape.h:256</see>
|
|
/// <br/>
|
|
/// <c>virtual void SaveBinaryState(StreamOut &inStream) const override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// See Shape
|
|
/// </para>
|
|
/// </remarks>
|
|
public void SaveBinaryState(StreamOut stream) => Jolt.PInvoke.HeightFieldShape_SaveBinaryState(this, stream);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L264">Jolt/Physics/Collision/Shape/HeightFieldShape.h:264</see>
|
|
/// <br/>
|
|
/// <c>virtual float GetVolume() const override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// See Shape::GetVolume
|
|
/// </para>
|
|
/// </remarks>
|
|
public float GetVolume() => Jolt.PInvoke.HeightFieldShape_GetVolume(this);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Physics/Collision/Shape/HeightFieldShape.h#L272">Jolt/Physics/Collision/Shape/HeightFieldShape.h:272</see>
|
|
/// <br/>
|
|
/// <c>static void sRegister()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Register shape functions with the registry
|
|
/// </para>
|
|
/// </remarks>
|
|
public static void sRegister() => Jolt.PInvoke.HeightFieldShape_sRegister();
|
|
public void AddRef() => Jolt.PInvoke.HeightFieldShape_AddRef(this);
|
|
public void Release() => Jolt.PInvoke.HeightFieldShape_Release(this);
|
|
public uint GetRefCount() => Jolt.PInvoke.HeightFieldShape_GetRefCount(this);
|
|
public static implicit operator Shape(HeightFieldShape value) => Jolt.PInvoke.HeightFieldShape_AsShape(value);
|
|
public void Dispose()
|
|
{
|
|
if (IsNull()) return;
|
|
Release();
|
|
}
|
|
}
|
|
}
|