// // Generated by Brutal.Jolt.Generate; do not edit by hand. #nullable enable using Brutal.Interop; using Brutal.Numerics; namespace Brutal.JoltApi { /// /// /// C++: /// Jolt/Physics/Constraints/ConstraintPart/PointConstraintPart.h:40 ///
/// class PointConstraintPart ///
///
/// /// /// Constrains movement along 3 axis /// /// @see "Constraints Derivation for Rigid Body Simulation in 3D" - Daniel Chappuis, section 2.2.1 /// /// Constraint equation (eq 45): /// /// \f[C = p_2 - p_1\f] /// /// Jacobian (transposed) (eq 47): /// /// \f[J^T = \begin{bmatrix}-E & r1x & E & -r2x^T\end{bmatrix} /// = \begin{bmatrix}-E^T \\ r1x^T \\ E^T \\ -r2x^T\end{bmatrix} /// = \begin{bmatrix}-E \\ -r1x \\ E \\ r2x\end{bmatrix}\f] /// /// Used terms (here and below, everything in world space):\n /// p1, p2 = constraint points.\n /// r1 = p1 - x1.\n /// r2 = p2 - x2.\n /// r1x = 3x3 matrix for which r1x v = r1 x v (cross product).\n /// x1, x2 = center of mass for the bodies.\n /// v = [v1, w1, v2, w2].\n /// v1, v2 = linear velocity of body 1 and 2.\n /// w1, w2 = angular velocity of body 1 and 2.\n /// M = mass matrix, a diagonal matrix of the mass and inertia with diagonal [m1, I1, m2, I2].\n /// \f$K^{-1} = \left( J M^{-1} J^T \right)^{-1}\f$ = effective mass.\n /// b = velocity bias.\n /// \f$\beta\f$ = baumgarte constant.\n /// E = identity matrix. /// /// [InteropHandle] public readonly partial struct PointConstraintPart : IDisposable { public static PointConstraintPart Create() => Jolt.PInvoke.PointConstraintPart_Create(); /// /// /// C++: /// Jolt/Physics/Constraints/ConstraintPart/PointConstraintPart.h:80 ///
/// inline void CalculateConstraintProperties(const Body &inBody1, Mat44Arg inRotation1, Vec3Arg inR1, const Body &inBody2, Mat44Arg inRotation2, Vec3Arg inR2) ///
///
/// /// /// Calculate properties used during the functions below /// @param inBody1 The first body that this constraint is attached to /// @param inBody2 The second body that this constraint is attached to /// @param inRotation1 The 3x3 rotation matrix for body 1 (translation part is ignored) /// @param inRotation2 The 3x3 rotation matrix for body 2 (translation part is ignored) /// @param inR1 Local space vector from center of mass to constraint point for body 1 /// @param inR2 Local space vector from center of mass to constraint point for body 2 /// /// public void CalculateConstraintProperties(Body body1, float4x4 rotation1, float3 r1, Body body2, float4x4 rotation2, float3 r2) => Jolt.PInvoke.PointConstraintPart_CalculateConstraintProperties(this, body1, rotation1, r1, body2, rotation2, r2); /// /// /// C++: /// Jolt/Physics/Constraints/ConstraintPart/PointConstraintPart.h:129 ///
/// inline void Deactivate() ///
///
/// /// /// Deactivate this constraint /// /// public void Deactivate() => Jolt.PInvoke.PointConstraintPart_Deactivate(this); /// /// /// C++: /// Jolt/Physics/Constraints/ConstraintPart/PointConstraintPart.h:136 ///
/// inline bool IsActive() const ///
///
/// /// /// Check if constraint is active /// /// public bool IsActive() => Jolt.PInvoke.PointConstraintPart_IsActive(this); /// /// /// C++: /// Jolt/Physics/Constraints/ConstraintPart/PointConstraintPart.h:145 ///
/// inline void WarmStart(Body &ioBody1, Body &ioBody2, float inWarmStartImpulseRatio) ///
///
/// /// /// Must be called from the WarmStartVelocityConstraint call to apply the previous frame's impulses /// @param ioBody1 The first body that this constraint is attached to /// @param ioBody2 The second body that this constraint is attached to /// @param inWarmStartImpulseRatio Ratio of new step to old time step (dt_new / dt_old) for scaling the lagrange multiplier of the previous frame /// /// public void WarmStart(Body body1, Body body2, float warmStartImpulseRatio) => Jolt.PInvoke.PointConstraintPart_WarmStart(this, body1, body2, warmStartImpulseRatio); /// /// /// C++: /// Jolt/Physics/Constraints/ConstraintPart/PointConstraintPart.h:154 ///
/// inline bool SolveVelocityConstraint(Body &ioBody1, Body &ioBody2) ///
///
/// /// /// Iteratively update the velocity constraint. Makes sure d/dt C(...) = 0, where C is the constraint equation. /// @param ioBody1 The first body that this constraint is attached to /// @param ioBody2 The second body that this constraint is attached to /// /// public bool SolveVelocityConstraint(Body body1, Body body2) => Jolt.PInvoke.PointConstraintPart_SolveVelocityConstraint(this, body1, body2); /// /// /// C++: /// Jolt/Physics/Constraints/ConstraintPart/PointConstraintPart.h:168 ///
/// inline bool SolvePositionConstraint(Body &ioBody1, Body &ioBody2, float inBaumgarte) const ///
///
/// /// /// Iteratively update the position constraint. Makes sure C(...) = 0. /// @param ioBody1 The first body that this constraint is attached to /// @param ioBody2 The second body that this constraint is attached to /// @param inBaumgarte Baumgarte constant (fraction of the error to correct) /// /// public bool SolvePositionConstraint(Body body1, Body body2, float baumgarte) => Jolt.PInvoke.PointConstraintPart_SolvePositionConstraint(this, body1, body2, baumgarte); /// /// /// C++: /// Jolt/Physics/Constraints/ConstraintPart/PointConstraintPart.h:213 ///
/// Vec3 GetTotalLambda() const ///
///
/// /// /// Return lagrange multiplier /// /// public float3 GetTotalLambda() => Jolt.PInvoke.PointConstraintPart_GetTotalLambda(this); public void Dispose() => Jolt.PInvoke.PointConstraintPart_Destroy(this); } }