HaxeJolt
This commit is contained in:
407
lib/haxejolt/Sources/jolt/jolt.idl
Normal file
407
lib/haxejolt/Sources/jolt/jolt.idl
Normal file
@ -0,0 +1,407 @@
|
||||
// Jolt Physics IDL for HashLink bindings
|
||||
// Based on JoltPhysics.js IDL
|
||||
// NOTE: Enums are defined in Jt.hx to avoid redefinition conflicts
|
||||
|
||||
// Vec3
|
||||
interface Vec3 {
|
||||
void Vec3();
|
||||
void Vec3(float inX, float inY, float inZ);
|
||||
[Value] Vec3 sZero();
|
||||
[Value] Vec3 sOne();
|
||||
[Value] Vec3 sAxisX();
|
||||
[Value] Vec3 sAxisY();
|
||||
[Value] Vec3 sAxisZ();
|
||||
float GetX();
|
||||
float GetY();
|
||||
float GetZ();
|
||||
void SetX(float inX);
|
||||
void SetY(float inY);
|
||||
void SetZ(float inZ);
|
||||
void Set(float inX, float inY, float inZ);
|
||||
float Length();
|
||||
float LengthSq();
|
||||
[Value] Vec3 Normalized();
|
||||
[Value] Vec3 Cross([Const, Ref] Vec3 inRHS);
|
||||
float Dot([Const, Ref] Vec3 inRHS);
|
||||
[Operator="+=", Ref] Vec3 Add([Const, Ref] Vec3 inV);
|
||||
[Operator="-=", Ref] Vec3 Sub([Const, Ref] Vec3 inV);
|
||||
[Operator="*=", Ref] Vec3 Mul(float inV);
|
||||
[Operator="/=", Ref] Vec3 Div(float inV);
|
||||
};
|
||||
|
||||
// RVec3 (real/double precision)
|
||||
interface RVec3 {
|
||||
void RVec3();
|
||||
void RVec3(double inX, double inY, double inZ);
|
||||
[Value] RVec3 sZeroR();
|
||||
double GetX();
|
||||
double GetY();
|
||||
double GetZ();
|
||||
void SetX(double inX);
|
||||
void SetY(double inY);
|
||||
void SetZ(double inZ);
|
||||
void Set(double inX, double inY, double inZ);
|
||||
double Length();
|
||||
double LengthSq();
|
||||
[Value] RVec3 Normalized();
|
||||
};
|
||||
|
||||
// Quat
|
||||
interface Quat {
|
||||
void Quat();
|
||||
void Quat(float inX, float inY, float inZ, float inW);
|
||||
[Value] Quat sIdentity();
|
||||
[Value] Quat sRotation([Const, Ref] Vec3 inAxis, float inAngle);
|
||||
[Value] Quat sEulerAngles([Const, Ref] Vec3 inInput);
|
||||
float GetX();
|
||||
float GetY();
|
||||
float GetZ();
|
||||
float GetW();
|
||||
void SetX(float inX);
|
||||
void SetY(float inY);
|
||||
void SetZ(float inZ);
|
||||
void SetW(float inW);
|
||||
void Set(float inX, float inY, float inZ, float inW);
|
||||
float Length();
|
||||
[Value] Quat Normalized();
|
||||
[Value] Vec3 GetEulerAngles();
|
||||
[Value] Quat Conjugated();
|
||||
[Value] Quat Inversed();
|
||||
[Value] Quat MulQuat([Const, Ref] Quat inQ);
|
||||
[Value] Vec3 MulVec3([Const, Ref] Vec3 inV);
|
||||
[Value] Quat SLERP([Const, Ref] Quat inDestination, float inFraction);
|
||||
};
|
||||
|
||||
// Mat44
|
||||
interface Mat44 {
|
||||
void Mat44();
|
||||
[Value] Mat44 sIdentity();
|
||||
[Value] Mat44 sZeroM();
|
||||
[Value] Mat44 sRotation([Const, Ref] Quat inQ);
|
||||
[Value] Mat44 sTranslation([Const, Ref] Vec3 inTranslation);
|
||||
[Value] Mat44 sRotationTranslation([Const, Ref] Quat inRotation, [Const, Ref] Vec3 inTranslation);
|
||||
[Value] Mat44 sScale(float inScale);
|
||||
[Value] Vec3 GetAxisX();
|
||||
[Value] Vec3 GetAxisY();
|
||||
[Value] Vec3 GetAxisZ();
|
||||
[Value] Vec3 GetTranslation();
|
||||
[Value] Quat GetQuaternion();
|
||||
[Value] Mat44 GetRotation();
|
||||
[Value] Mat44 MulMat44([Const, Ref] Mat44 inM);
|
||||
[Value] Vec3 MulVec3([Const, Ref] Vec3 inV);
|
||||
[Value] Mat44 Inversed();
|
||||
};
|
||||
|
||||
// BodyID
|
||||
interface BodyID {
|
||||
void BodyID();
|
||||
long GetIndex();
|
||||
long GetSequenceNumber();
|
||||
boolean IsInvalid();
|
||||
};
|
||||
|
||||
// Shape (base)
|
||||
interface Shape {
|
||||
long GetRefCount();
|
||||
void AddRef();
|
||||
void Release();
|
||||
int GetType();
|
||||
int GetSubType();
|
||||
boolean MustBeStatic();
|
||||
[Value] Vec3 GetCenterOfMass();
|
||||
float GetInnerRadius();
|
||||
long GetUserData();
|
||||
void SetUserData(long inUserData);
|
||||
};
|
||||
|
||||
// BoxShape
|
||||
interface BoxShape {
|
||||
void BoxShape([Const, Ref] Vec3 inHalfExtent);
|
||||
[Value] Vec3 GetHalfExtent();
|
||||
};
|
||||
BoxShape implements Shape;
|
||||
|
||||
// SphereShape
|
||||
interface SphereShape {
|
||||
void SphereShape(float inRadius);
|
||||
float GetRadius();
|
||||
};
|
||||
SphereShape implements Shape;
|
||||
|
||||
// CapsuleShape
|
||||
interface CapsuleShape {
|
||||
void CapsuleShape(float inHalfHeightOfCylinder, float inRadius);
|
||||
float GetHalfHeightOfCylinder();
|
||||
float GetRadius();
|
||||
};
|
||||
CapsuleShape implements Shape;
|
||||
|
||||
// CylinderShape
|
||||
interface CylinderShape {
|
||||
void CylinderShape(float inHalfHeight, float inRadius);
|
||||
float GetHalfHeight();
|
||||
float GetRadius();
|
||||
};
|
||||
CylinderShape implements Shape;
|
||||
|
||||
// Body
|
||||
interface Body {
|
||||
[Const, Value] BodyID GetID();
|
||||
boolean IsActive();
|
||||
boolean IsStatic();
|
||||
boolean IsKinematic();
|
||||
boolean IsDynamic();
|
||||
boolean IsSensor();
|
||||
void SetIsSensor(boolean inIsSensor);
|
||||
int GetMotionType();
|
||||
void SetMotionType(int inMotionType);
|
||||
[Value] RVec3 GetPosition();
|
||||
[Value] Quat GetRotation();
|
||||
[Value] Mat44 GetWorldTransform();
|
||||
[Value] RVec3 GetCenterOfMassPosition();
|
||||
[Value] Mat44 GetCenterOfMassTransform();
|
||||
[Value] Vec3 GetLinearVelocity();
|
||||
[Value] Vec3 GetAngularVelocity();
|
||||
void SetLinearVelocity([Const, Ref] Vec3 inLinearVelocity);
|
||||
void SetAngularVelocity([Const, Ref] Vec3 inAngularVelocity);
|
||||
void SetLinearVelocityClamped([Const, Ref] Vec3 inLinearVelocity);
|
||||
void SetAngularVelocityClamped([Const, Ref] Vec3 inAngularVelocity);
|
||||
[Value] Vec3 GetPointVelocity([Const, Ref] RVec3 inPoint);
|
||||
void AddForce([Const, Ref] Vec3 inForce);
|
||||
void AddForceAtPosition([Const, Ref] Vec3 inForce, [Const, Ref] RVec3 inPosition);
|
||||
void AddTorque([Const, Ref] Vec3 inTorque);
|
||||
void AddImpulse([Const, Ref] Vec3 inImpulse);
|
||||
void AddImpulseAtPosition([Const, Ref] Vec3 inImpulse, [Const, Ref] RVec3 inPosition);
|
||||
void AddAngularImpulse([Const, Ref] Vec3 inAngularImpulse);
|
||||
void MoveKinematic([Const, Ref] RVec3 inTargetPosition, [Const, Ref] Quat inTargetRotation, float inDeltaTime);
|
||||
[Value] Vec3 GetAccumulatedForce();
|
||||
[Value] Vec3 GetAccumulatedTorque();
|
||||
void ResetForce();
|
||||
void ResetTorque();
|
||||
void ResetMotion();
|
||||
[Const] Shape GetShape();
|
||||
float GetFriction();
|
||||
void SetFriction(float inFriction);
|
||||
float GetRestitution();
|
||||
void SetRestitution(float inRestitution);
|
||||
long GetUserData();
|
||||
void SetUserData(long inUserData);
|
||||
};
|
||||
|
||||
// MassProperties
|
||||
interface MassProperties {
|
||||
void MassProperties();
|
||||
attribute float mMass;
|
||||
void ScaleToMass(float inMass);
|
||||
};
|
||||
|
||||
// BodyCreationSettings
|
||||
interface BodyCreationSettings {
|
||||
void BodyCreationSettings([Const] Shape inShape, [Const, Ref] RVec3 inPosition, [Const, Ref] Quat inRotation, int inMotionType, short inObjectLayer);
|
||||
attribute float mFriction;
|
||||
attribute float mRestitution;
|
||||
attribute float mLinearDamping;
|
||||
attribute float mAngularDamping;
|
||||
attribute float mMaxLinearVelocity;
|
||||
attribute float mMaxAngularVelocity;
|
||||
attribute float mGravityFactor;
|
||||
attribute boolean mAllowSleeping;
|
||||
attribute boolean mIsSensor;
|
||||
attribute int mMotionQuality;
|
||||
attribute int mAllowedDOFs;
|
||||
attribute int mOverrideMassProperties;
|
||||
[Value] attribute MassProperties mMassPropertiesOverride;
|
||||
attribute int mNumVelocityStepsOverride;
|
||||
attribute int mNumPositionStepsOverride;
|
||||
};
|
||||
|
||||
// BodyInterface
|
||||
interface BodyInterface {
|
||||
Body CreateBody([Const, Ref] BodyCreationSettings inSettings);
|
||||
void DestroyBody([Const, Ref] BodyID inBodyID);
|
||||
void AddBody([Const, Ref] BodyID inBodyID, int inActivationMode);
|
||||
void RemoveBody([Const, Ref] BodyID inBodyID);
|
||||
boolean IsAdded([Const, Ref] BodyID inBodyID);
|
||||
void ActivateBody([Const, Ref] BodyID inBodyID);
|
||||
void DeactivateBody([Const, Ref] BodyID inBodyID);
|
||||
boolean IsActive([Const, Ref] BodyID inBodyID);
|
||||
void SetMotionType([Const, Ref] BodyID inBodyID, int inMotionType, int inActivationMode);
|
||||
int GetMotionType([Const, Ref] BodyID inBodyID);
|
||||
void SetPosition([Const, Ref] BodyID inBodyID, [Const, Ref] RVec3 inPosition, int inActivationMode);
|
||||
[Value] RVec3 GetPosition([Const, Ref] BodyID inBodyID);
|
||||
[Value] RVec3 GetCenterOfMassPosition([Const, Ref] BodyID inBodyID);
|
||||
void SetRotation([Const, Ref] BodyID inBodyID, [Const, Ref] Quat inRotation, int inActivationMode);
|
||||
[Value] Quat GetRotation([Const, Ref] BodyID inBodyID);
|
||||
void SetPositionAndRotation([Const, Ref] BodyID inBodyID, [Const, Ref] RVec3 inPosition, [Const, Ref] Quat inRotation, int inActivationMode);
|
||||
void SetLinearVelocity([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inLinearVelocity);
|
||||
[Value] Vec3 GetLinearVelocity([Const, Ref] BodyID inBodyID);
|
||||
void SetAngularVelocity([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inAngularVelocity);
|
||||
[Value] Vec3 GetAngularVelocity([Const, Ref] BodyID inBodyID);
|
||||
void AddLinearVelocity([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inLinearVelocity);
|
||||
void AddLinearAndAngularVelocity([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inLinearVelocity, [Const, Ref] Vec3 inAngularVelocity);
|
||||
void AddForce([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inForce);
|
||||
void AddForceAtPosition([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inForce, [Const, Ref] RVec3 inPosition);
|
||||
void AddTorque([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inTorque);
|
||||
void AddImpulse([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inImpulse);
|
||||
void AddImpulseAtPosition([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inImpulse, [Const, Ref] RVec3 inPosition);
|
||||
void AddAngularImpulse([Const, Ref] BodyID inBodyID, [Const, Ref] Vec3 inAngularImpulse);
|
||||
void MoveKinematic([Const, Ref] BodyID inBodyID, [Const, Ref] RVec3 inTargetPosition, [Const, Ref] Quat inTargetRotation, float inDeltaTime);
|
||||
void SetShape([Const, Ref] BodyID inBodyID, [Const] Shape inShape, boolean inUpdateMassProperties, int inActivationMode);
|
||||
[Const] Shape GetShape([Const, Ref] BodyID inBodyID);
|
||||
void SetFriction([Const, Ref] BodyID inBodyID, float inFriction);
|
||||
float GetFriction([Const, Ref] BodyID inBodyID);
|
||||
void SetRestitution([Const, Ref] BodyID inBodyID, float inRestitution);
|
||||
float GetRestitution([Const, Ref] BodyID inBodyID);
|
||||
void SetGravityFactor([Const, Ref] BodyID inBodyID, float inGravityFactor);
|
||||
float GetGravityFactor([Const, Ref] BodyID inBodyID);
|
||||
void SetUserData([Const, Ref] BodyID inBodyID, long inUserData);
|
||||
long GetUserData([Const, Ref] BodyID inBodyID);
|
||||
[Value] Mat44 GetWorldTransform([Const, Ref] BodyID inBodyID);
|
||||
[Value] Mat44 GetCenterOfMassTransform([Const, Ref] BodyID inBodyID);
|
||||
};
|
||||
|
||||
// RayCast
|
||||
interface RRayCast {
|
||||
void RRayCast([Const, Ref] RVec3 inOrigin, [Const, Ref] Vec3 inDirection);
|
||||
[Value] attribute RVec3 mOrigin;
|
||||
[Value] attribute Vec3 mDirection;
|
||||
};
|
||||
|
||||
interface RayCastResult {
|
||||
void RayCastResult();
|
||||
[Value] attribute BodyID mBodyID;
|
||||
attribute float mFraction;
|
||||
};
|
||||
|
||||
// NarrowPhaseQuery
|
||||
interface NarrowPhaseQuery {
|
||||
boolean CastRay([Const, Ref] RRayCast inRay, [Ref] RayCastResult ioHit);
|
||||
};
|
||||
|
||||
// PhysicsSystem
|
||||
interface PhysicsSystem {
|
||||
void PhysicsSystem();
|
||||
void Init(long inMaxBodies, long inNumBodyMutexes, long inMaxBodyPairs, long inMaxContactConstraints);
|
||||
void OptimizeBroadPhase();
|
||||
long Update(float inDeltaTime, long inCollisionSteps);
|
||||
BodyInterface GetBodyInterface();
|
||||
BodyInterface GetBodyInterfaceNoLock();
|
||||
long GetNumBodies();
|
||||
long GetNumActiveBodies();
|
||||
long GetMaxBodies();
|
||||
void SetGravity([Const, Ref] Vec3 inGravity);
|
||||
[Value] Vec3 GetGravity();
|
||||
[Const, Ref] NarrowPhaseQuery GetNarrowPhaseQuery();
|
||||
void AddConstraint(Constraint inConstraint);
|
||||
void RemoveConstraint(Constraint inConstraint);
|
||||
};
|
||||
|
||||
// Constraint base
|
||||
interface Constraint {
|
||||
long GetRefCount();
|
||||
void AddRef();
|
||||
void Release();
|
||||
void SetEnabled(boolean inEnabled);
|
||||
boolean GetEnabled();
|
||||
};
|
||||
|
||||
interface TwoBodyConstraint {
|
||||
Body GetBody1();
|
||||
Body GetBody2();
|
||||
};
|
||||
TwoBodyConstraint implements Constraint;
|
||||
|
||||
// FixedConstraintSettings
|
||||
interface FixedConstraintSettings {
|
||||
void FixedConstraintSettings();
|
||||
attribute int mSpace;
|
||||
attribute boolean mAutoDetectPoint;
|
||||
[Value] attribute RVec3 mPoint1;
|
||||
[Value] attribute RVec3 mPoint2;
|
||||
[Value] attribute Vec3 mAxisX1;
|
||||
[Value] attribute Vec3 mAxisY1;
|
||||
[Value] attribute Vec3 mAxisX2;
|
||||
[Value] attribute Vec3 mAxisY2;
|
||||
TwoBodyConstraint Create(Body inBody1, Body inBody2);
|
||||
};
|
||||
|
||||
// PointConstraintSettings
|
||||
interface PointConstraintSettings {
|
||||
void PointConstraintSettings();
|
||||
attribute int mSpace;
|
||||
[Value] attribute RVec3 mPoint1;
|
||||
[Value] attribute RVec3 mPoint2;
|
||||
TwoBodyConstraint Create(Body inBody1, Body inBody2);
|
||||
};
|
||||
|
||||
// HingeConstraintSettings
|
||||
interface HingeConstraintSettings {
|
||||
void HingeConstraintSettings();
|
||||
attribute int mSpace;
|
||||
[Value] attribute RVec3 mPoint1;
|
||||
[Value] attribute RVec3 mPoint2;
|
||||
[Value] attribute Vec3 mHingeAxis1;
|
||||
[Value] attribute Vec3 mHingeAxis2;
|
||||
[Value] attribute Vec3 mNormalAxis1;
|
||||
[Value] attribute Vec3 mNormalAxis2;
|
||||
attribute float mLimitsMin;
|
||||
attribute float mLimitsMax;
|
||||
attribute float mMaxFrictionTorque;
|
||||
TwoBodyConstraint Create(Body inBody1, Body inBody2);
|
||||
};
|
||||
|
||||
// SliderConstraintSettings
|
||||
interface SliderConstraintSettings {
|
||||
void SliderConstraintSettings();
|
||||
attribute int mSpace;
|
||||
attribute boolean mAutoDetectPoint;
|
||||
[Value] attribute RVec3 mPoint1;
|
||||
[Value] attribute RVec3 mPoint2;
|
||||
[Value] attribute Vec3 mSliderAxis1;
|
||||
[Value] attribute Vec3 mSliderAxis2;
|
||||
[Value] attribute Vec3 mNormalAxis1;
|
||||
[Value] attribute Vec3 mNormalAxis2;
|
||||
attribute float mLimitsMin;
|
||||
attribute float mLimitsMax;
|
||||
attribute float mMaxFrictionForce;
|
||||
TwoBodyConstraint Create(Body inBody1, Body inBody2);
|
||||
};
|
||||
|
||||
// DistanceConstraintSettings
|
||||
interface DistanceConstraintSettings {
|
||||
void DistanceConstraintSettings();
|
||||
attribute int mSpace;
|
||||
[Value] attribute RVec3 mPoint1;
|
||||
[Value] attribute RVec3 mPoint2;
|
||||
attribute float mMinDistance;
|
||||
attribute float mMaxDistance;
|
||||
TwoBodyConstraint Create(Body inBody1, Body inBody2);
|
||||
};
|
||||
|
||||
// SixDOFConstraintSettings
|
||||
interface SixDOFConstraintSettings {
|
||||
void SixDOFConstraintSettings();
|
||||
attribute int mSpace;
|
||||
[Value] attribute RVec3 mPosition1;
|
||||
[Value] attribute RVec3 mPosition2;
|
||||
[Value] attribute Vec3 mAxisX1;
|
||||
[Value] attribute Vec3 mAxisY1;
|
||||
[Value] attribute Vec3 mAxisX2;
|
||||
[Value] attribute Vec3 mAxisY2;
|
||||
void MakeFreeAxis(int inAxis);
|
||||
void MakeFixedAxis(int inAxis);
|
||||
void SetLimitedAxis(int inAxis, float inMin, float inMax);
|
||||
TwoBodyConstraint Create(Body inBody1, Body inBody2);
|
||||
};
|
||||
|
||||
// ConeConstraintSettings
|
||||
interface ConeConstraintSettings {
|
||||
void ConeConstraintSettings();
|
||||
attribute int mSpace;
|
||||
[Value] attribute RVec3 mPoint1;
|
||||
[Value] attribute RVec3 mPoint2;
|
||||
[Value] attribute Vec3 mTwistAxis1;
|
||||
[Value] attribute Vec3 mTwistAxis2;
|
||||
attribute float mHalfConeAngle;
|
||||
TwoBodyConstraint Create(Body inBody1, Body inBody2);
|
||||
};
|
||||
Reference in New Issue
Block a user