forked from LeenkxTeam/LNXSDK
HaxeJolt
This commit is contained in:
694
lib/haxejolt/Sources/jolt/Jt.hx
Normal file
694
lib/haxejolt/Sources/jolt/Jt.hx
Normal file
@ -0,0 +1,694 @@
|
||||
// Jolt Physics bindings for Haxe
|
||||
|
||||
package jolt;
|
||||
|
||||
enum abstract EMotionType(Int) from Int to Int {
|
||||
var Static = 0;
|
||||
var Kinematic = 1;
|
||||
var Dynamic = 2;
|
||||
}
|
||||
|
||||
enum abstract EActivation(Int) from Int to Int {
|
||||
var Activate = 0;
|
||||
var DontActivate = 1;
|
||||
}
|
||||
|
||||
enum abstract EShapeType(Int) from Int to Int {
|
||||
var Convex = 0;
|
||||
var Compound = 1;
|
||||
var Decorated = 2;
|
||||
var Mesh = 3;
|
||||
var HeightField = 4;
|
||||
var Plane = 5;
|
||||
var Empty = 6;
|
||||
}
|
||||
|
||||
enum abstract EShapeSubType(Int) from Int to Int {
|
||||
var Sphere = 0;
|
||||
var Box = 1;
|
||||
var Capsule = 2;
|
||||
var TaperedCapsule = 3;
|
||||
var Cylinder = 4;
|
||||
var TaperedCylinder = 5;
|
||||
var ConvexHull = 6;
|
||||
var StaticCompound = 7;
|
||||
var MutableCompound = 8;
|
||||
var RotatedTranslated = 9;
|
||||
var Scaled = 10;
|
||||
var OffsetCenterOfMass = 11;
|
||||
var MeshShape = 12;
|
||||
var HeightFieldShape = 13;
|
||||
var PlaneShape = 14;
|
||||
var EmptyShape = 15;
|
||||
}
|
||||
|
||||
#if hl
|
||||
|
||||
typedef Jt = haxe.macro.MacroType<[webidl.Module.build({
|
||||
idlFile: "Sources/jolt/jolt.idl",
|
||||
chopPrefix: "",
|
||||
autoGC: false,
|
||||
nativeLib: "jolt"
|
||||
})]>;
|
||||
|
||||
#else
|
||||
|
||||
@:native('Jolt.Vec3')
|
||||
extern class Vec3 {
|
||||
public function new(?x:Float, ?y:Float, ?z:Float):Void;
|
||||
public static function sZero():Vec3;
|
||||
public static function sOne():Vec3;
|
||||
public static function sAxisX():Vec3;
|
||||
public static function sAxisY():Vec3;
|
||||
public static function sAxisZ():Vec3;
|
||||
public function GetX():Float;
|
||||
public function GetY():Float;
|
||||
public function GetZ():Float;
|
||||
public function SetX(x:Float):Void;
|
||||
public function SetY(y:Float):Void;
|
||||
public function SetZ(z:Float):Void;
|
||||
public function Set(x:Float, y:Float, z:Float):Void;
|
||||
public function Length():Float;
|
||||
public function LengthSq():Float;
|
||||
public function Normalized():Vec3;
|
||||
public function Cross(v:Vec3):Vec3;
|
||||
public function Dot(v:Vec3):Float;
|
||||
public function Add(v:Vec3):Vec3;
|
||||
public function Sub(v:Vec3):Vec3;
|
||||
public function Mul(f:Float):Vec3;
|
||||
public function Div(f:Float):Vec3;
|
||||
}
|
||||
|
||||
@:native('Jolt.RVec3')
|
||||
extern class RVec3 {
|
||||
public function new(?x:Float, ?y:Float, ?z:Float):Void;
|
||||
public static function sZero():RVec3;
|
||||
public function GetX():Float;
|
||||
public function GetY():Float;
|
||||
public function GetZ():Float;
|
||||
public function SetX(x:Float):Void;
|
||||
public function SetY(y:Float):Void;
|
||||
public function SetZ(z:Float):Void;
|
||||
public function Set(x:Float, y:Float, z:Float):Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.Quat')
|
||||
extern class Quat {
|
||||
public function new(?x:Float, ?y:Float, ?z:Float, ?w:Float):Void;
|
||||
public static function sIdentity():Quat;
|
||||
public static function sRotation(axis:Vec3, angle:Float):Quat;
|
||||
public static function sEulerAngles(angles:Vec3):Quat;
|
||||
public function GetX():Float;
|
||||
public function GetY():Float;
|
||||
public function GetZ():Float;
|
||||
public function GetW():Float;
|
||||
public function SetX(x:Float):Void;
|
||||
public function SetY(y:Float):Void;
|
||||
public function SetZ(z:Float):Void;
|
||||
public function SetW(w:Float):Void;
|
||||
public function Set(x:Float, y:Float, z:Float, w:Float):Void;
|
||||
public function Length():Float;
|
||||
public function Normalized():Quat;
|
||||
public function GetEulerAngles():Vec3;
|
||||
public function Conjugated():Quat;
|
||||
public function Inversed():Quat;
|
||||
public function MulQuat(q:Quat):Quat;
|
||||
public function MulVec3(v:Vec3):Vec3;
|
||||
public function SLERP(dest:Quat, fraction:Float):Quat;
|
||||
}
|
||||
|
||||
@:native('Jolt.Mat44')
|
||||
extern class Mat44 {
|
||||
public function new():Void;
|
||||
public static function sIdentity():Mat44;
|
||||
public static function sZero():Mat44;
|
||||
public static function sRotation(q:Quat):Mat44;
|
||||
public static function sTranslation(v:Vec3):Mat44;
|
||||
public static function sRotationTranslation(q:Quat, v:Vec3):Mat44;
|
||||
public static function sScale(s:Float):Mat44;
|
||||
public function GetAxisX():Vec3;
|
||||
public function GetAxisY():Vec3;
|
||||
public function GetAxisZ():Vec3;
|
||||
public function GetTranslation():Vec3;
|
||||
public function GetQuaternion():Quat;
|
||||
public function GetRotation():Mat44;
|
||||
public function MulMat44(m:Mat44):Mat44;
|
||||
public function MulVec3(v:Vec3):Vec3;
|
||||
public function Inversed():Mat44;
|
||||
}
|
||||
|
||||
@:native('Jolt.BodyID')
|
||||
extern class BodyID {
|
||||
public function new():Void;
|
||||
public function GetIndex():Int;
|
||||
public function GetSequenceNumber():Int;
|
||||
public function IsInvalid():Bool;
|
||||
}
|
||||
|
||||
@:native('Jolt.Body')
|
||||
extern class Body {
|
||||
public function GetID():BodyID;
|
||||
public function GetBodyType():Int;
|
||||
public function GetMotionType():Int;
|
||||
public function SetMotionType(type:Int):Void;
|
||||
public function IsActive():Bool;
|
||||
public function IsStatic():Bool;
|
||||
public function IsKinematic():Bool;
|
||||
public function IsDynamic():Bool;
|
||||
public function IsSensor():Bool;
|
||||
public function SetIsSensor(sensor:Bool):Void;
|
||||
public function GetPosition():RVec3;
|
||||
public function GetRotation():Quat;
|
||||
public function GetWorldTransform():Mat44;
|
||||
public function GetCenterOfMassPosition():RVec3;
|
||||
public function GetCenterOfMassTransform():Mat44;
|
||||
public function GetLinearVelocity():Vec3;
|
||||
public function GetAngularVelocity():Vec3;
|
||||
public function SetLinearVelocity(v:Vec3):Void;
|
||||
public function SetAngularVelocity(v:Vec3):Void;
|
||||
public function SetLinearVelocityClamped(v:Vec3):Void;
|
||||
public function SetAngularVelocityClamped(v:Vec3):Void;
|
||||
public function GetPointVelocity(point:RVec3):Vec3;
|
||||
public function AddForce(force:Vec3):Void;
|
||||
public function AddForceAtPosition(force:Vec3, position:RVec3):Void;
|
||||
public function AddTorque(torque:Vec3):Void;
|
||||
public function AddImpulse(impulse:Vec3):Void;
|
||||
public function AddImpulseAtPosition(impulse:Vec3, position:RVec3):Void;
|
||||
public function AddAngularImpulse(impulse:Vec3):Void;
|
||||
public function MoveKinematic(targetPosition:RVec3, targetRotation:Quat, deltaTime:Float):Void;
|
||||
public function GetAccumulatedForce():Vec3;
|
||||
public function GetAccumulatedTorque():Vec3;
|
||||
public function ResetForce():Void;
|
||||
public function ResetTorque():Void;
|
||||
public function ResetMotion():Void;
|
||||
public function GetInverseInertia():Mat44;
|
||||
public function GetWorldSpaceBounds():Dynamic;
|
||||
public function GetShape():Shape;
|
||||
public function GetFriction():Float;
|
||||
public function SetFriction(friction:Float):Void;
|
||||
public function GetRestitution():Float;
|
||||
public function SetRestitution(restitution:Float):Void;
|
||||
public function GetUserData():Int;
|
||||
public function SetUserData(data:Int):Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.Shape')
|
||||
extern class Shape {
|
||||
public function GetType():Int;
|
||||
public function GetSubType():Int;
|
||||
public function GetUserData():Int;
|
||||
public function SetUserData(data:Int):Void;
|
||||
public function MustBeStatic():Bool;
|
||||
public function GetCenterOfMass():Vec3;
|
||||
public function GetLocalBounds():Dynamic;
|
||||
public function GetInnerRadius():Float;
|
||||
public function GetVolume():Float;
|
||||
public function GetMassProperties():Dynamic;
|
||||
}
|
||||
|
||||
@:native('Jolt.BoxShapeSettings')
|
||||
extern class BoxShapeSettings {
|
||||
public function new(halfExtent:Vec3):Void;
|
||||
public function Create():ShapeResult;
|
||||
}
|
||||
|
||||
@:native('Jolt.BoxShape')
|
||||
extern class BoxShape extends Shape {
|
||||
public function new(halfExtent:Vec3):Void;
|
||||
public function GetHalfExtent():Vec3;
|
||||
}
|
||||
|
||||
@:native('Jolt.SphereShapeSettings')
|
||||
extern class SphereShapeSettings {
|
||||
public function new(radius:Float):Void;
|
||||
public function Create():ShapeResult;
|
||||
}
|
||||
|
||||
@:native('Jolt.SphereShape')
|
||||
extern class SphereShape extends Shape {
|
||||
public function new(radius:Float):Void;
|
||||
public function GetRadius():Float;
|
||||
}
|
||||
|
||||
@:native('Jolt.CapsuleShapeSettings')
|
||||
extern class CapsuleShapeSettings {
|
||||
public function new(halfHeight:Float, radius:Float):Void;
|
||||
public function Create():ShapeResult;
|
||||
}
|
||||
|
||||
@:native('Jolt.CapsuleShape')
|
||||
extern class CapsuleShape extends Shape {
|
||||
public function new(halfHeight:Float, radius:Float):Void;
|
||||
public function GetHalfHeightOfCylinder():Float;
|
||||
public function GetRadius():Float;
|
||||
}
|
||||
|
||||
@:native('Jolt.CylinderShapeSettings')
|
||||
extern class CylinderShapeSettings {
|
||||
public function new(halfHeight:Float, radius:Float):Void;
|
||||
public function Create():ShapeResult;
|
||||
}
|
||||
|
||||
@:native('Jolt.CylinderShape')
|
||||
extern class CylinderShape extends Shape {
|
||||
public function new(halfHeight:Float, radius:Float):Void;
|
||||
public function GetHalfHeight():Float;
|
||||
public function GetRadius():Float;
|
||||
}
|
||||
|
||||
@:native('Jolt.ConvexHullShapeSettings')
|
||||
extern class ConvexHullShapeSettings {
|
||||
public function new():Void;
|
||||
public function Create():ShapeResult;
|
||||
}
|
||||
|
||||
@:native('Jolt.MeshShapeSettings')
|
||||
extern class MeshShapeSettings {
|
||||
public function new():Void;
|
||||
public function Create():ShapeResult;
|
||||
}
|
||||
|
||||
@:native('Jolt.HeightFieldShapeSettings')
|
||||
extern class HeightFieldShapeSettings {
|
||||
public function new():Void;
|
||||
public function Create():ShapeResult;
|
||||
}
|
||||
|
||||
@:native('Jolt.ShapeResult')
|
||||
extern class ShapeResult {
|
||||
public function IsValid():Bool;
|
||||
public function HasError():Bool;
|
||||
public function Get():Shape;
|
||||
}
|
||||
|
||||
@:native('Jolt.MassProperties')
|
||||
extern class MassProperties {
|
||||
public function new():Void;
|
||||
public var mMass:Float;
|
||||
public function ScaleToMass(mass:Float):Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.BodyCreationSettings')
|
||||
extern class BodyCreationSettings {
|
||||
public function new(shape:Shape, position:RVec3, rotation:Quat, motionType:Int, objectLayer:Int):Void;
|
||||
public var mFriction:Float;
|
||||
public var mRestitution:Float;
|
||||
public var mLinearDamping:Float;
|
||||
public var mAngularDamping:Float;
|
||||
public var mMaxLinearVelocity:Float;
|
||||
public var mMaxAngularVelocity:Float;
|
||||
public var mGravityFactor:Float;
|
||||
public var mAllowSleeping:Bool;
|
||||
public var mIsSensor:Bool;
|
||||
public var mMotionQuality:Int;
|
||||
public var mAllowedDOFs:Int;
|
||||
public var mOverrideMassProperties:Int;
|
||||
public var mMassPropertiesOverride:MassProperties;
|
||||
public var mNumVelocityStepsOverride:Int;
|
||||
public var mNumPositionStepsOverride:Int;
|
||||
}
|
||||
|
||||
@:native('Jolt.BodyInterface')
|
||||
extern class BodyInterface {
|
||||
public function CreateBody(settings:BodyCreationSettings):Body;
|
||||
public function CreateBodyWithID(bodyId:BodyID, settings:BodyCreationSettings):Body;
|
||||
public function DestroyBody(bodyId:BodyID):Void;
|
||||
public function AddBody(bodyId:BodyID, activation:Int):Void;
|
||||
public function RemoveBody(bodyId:BodyID):Void;
|
||||
public function IsAdded(bodyId:BodyID):Bool;
|
||||
public function ActivateBody(bodyId:BodyID):Void;
|
||||
public function DeactivateBody(bodyId:BodyID):Void;
|
||||
public function IsActive(bodyId:BodyID):Bool;
|
||||
public function SetMotionType(bodyId:BodyID, motionType:Int, activation:Int):Void;
|
||||
public function GetMotionType(bodyId:BodyID):Int;
|
||||
public function SetPosition(bodyId:BodyID, position:RVec3, activation:Int):Void;
|
||||
public function GetPosition(bodyId:BodyID):RVec3;
|
||||
public function GetCenterOfMassPosition(bodyId:BodyID):RVec3;
|
||||
public function SetRotation(bodyId:BodyID, rotation:Quat, activation:Int):Void;
|
||||
public function GetRotation(bodyId:BodyID):Quat;
|
||||
public function SetPositionAndRotation(bodyId:BodyID, position:RVec3, rotation:Quat, activation:Int):Void;
|
||||
public function SetPositionAndRotationWhenChanged(bodyId:BodyID, position:RVec3, rotation:Quat, activation:Int):Void;
|
||||
public function SetLinearVelocity(bodyId:BodyID, velocity:Vec3):Void;
|
||||
public function GetLinearVelocity(bodyId:BodyID):Vec3;
|
||||
public function SetAngularVelocity(bodyId:BodyID, velocity:Vec3):Void;
|
||||
public function GetAngularVelocity(bodyId:BodyID):Vec3;
|
||||
public function AddLinearVelocity(bodyId:BodyID, velocity:Vec3):Void;
|
||||
public function AddLinearAndAngularVelocity(bodyId:BodyID, linear:Vec3, angular:Vec3):Void;
|
||||
public function GetPointVelocity(bodyId:BodyID, point:RVec3):Vec3;
|
||||
public function AddForce(bodyId:BodyID, force:Vec3, activation:Int = 0):Void;
|
||||
public function AddForceAtPosition(bodyId:BodyID, force:Vec3, position:RVec3, activation:Int = 0):Void;
|
||||
public function AddTorque(bodyId:BodyID, torque:Vec3, activation:Int = 0):Void;
|
||||
public function AddImpulse(bodyId:BodyID, impulse:Vec3):Void;
|
||||
public function AddImpulseAtPosition(bodyId:BodyID, impulse:Vec3, position:RVec3):Void;
|
||||
public function AddAngularImpulse(bodyId:BodyID, impulse:Vec3):Void;
|
||||
public function MoveKinematic(bodyId:BodyID, targetPosition:RVec3, targetRotation:Quat, deltaTime:Float):Void;
|
||||
public function SetShape(bodyId:BodyID, shape:Shape, updateMassProperties:Bool, activation:Int):Void;
|
||||
public function GetShape(bodyId:BodyID):Shape;
|
||||
public function SetFriction(bodyId:BodyID, friction:Float):Void;
|
||||
public function GetFriction(bodyId:BodyID):Float;
|
||||
public function SetRestitution(bodyId:BodyID, restitution:Float):Void;
|
||||
public function GetRestitution(bodyId:BodyID):Float;
|
||||
public function SetGravityFactor(bodyId:BodyID, factor:Float):Void;
|
||||
public function GetGravityFactor(bodyId:BodyID):Float;
|
||||
public function SetUserData(bodyId:BodyID, data:Int):Void;
|
||||
public function GetUserData(bodyId:BodyID):Int;
|
||||
public function GetWorldTransform(bodyId:BodyID):Mat44;
|
||||
public function GetCenterOfMassTransform(bodyId:BodyID):Mat44;
|
||||
}
|
||||
|
||||
@:native('Jolt.RRayCast')
|
||||
extern class RRayCast {
|
||||
public function new(origin:RVec3, direction:Vec3):Void;
|
||||
public var mOrigin:RVec3;
|
||||
public var mDirection:Vec3;
|
||||
}
|
||||
|
||||
@:native('Jolt.RayCastResult')
|
||||
extern class RayCastResult {
|
||||
public function new():Void;
|
||||
public var mBodyID:BodyID;
|
||||
public var mFraction:Float;
|
||||
}
|
||||
|
||||
@:native('Jolt.BroadPhaseLayer')
|
||||
extern class BroadPhaseLayer {
|
||||
public function new(layer:Int):Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.BroadPhaseLayerInterfaceTable')
|
||||
extern class BroadPhaseLayerInterfaceTable extends BroadPhaseLayerInterface {
|
||||
public function new(numObjectLayers:Int, numBroadPhaseLayers:Int):Void;
|
||||
public function MapObjectToBroadPhaseLayer(objectLayer:Int, broadPhaseLayer:BroadPhaseLayer):Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.ObjectLayerPairFilterTable')
|
||||
extern class ObjectLayerPairFilterTable extends ObjectLayerPairFilter {
|
||||
public function new(numObjectLayers:Int):Void;
|
||||
public function EnableCollision(layer1:Int, layer2:Int):Void;
|
||||
public function DisableCollision(layer1:Int, layer2:Int):Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.ObjectVsBroadPhaseLayerFilterTable')
|
||||
extern class ObjectVsBroadPhaseLayerFilterTable extends ObjectVsBroadPhaseLayerFilter {
|
||||
public function new(broadPhaseLayerInterface:BroadPhaseLayerInterfaceTable, numBroadPhaseLayers:Int,
|
||||
objectLayerPairFilter:ObjectLayerPairFilterTable, numObjectLayers:Int):Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.BroadPhaseLayerInterfaceJS')
|
||||
extern class BroadPhaseLayerInterface {
|
||||
public function new():Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.ObjectVsBroadPhaseLayerFilterJS')
|
||||
extern class ObjectVsBroadPhaseLayerFilter {
|
||||
public function new():Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.ObjectLayerPairFilterJS')
|
||||
extern class ObjectLayerPairFilter {
|
||||
public function new():Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.NarrowPhaseQuery')
|
||||
extern class NarrowPhaseQuery {
|
||||
public function CastRay(ray:RRayCast, result:RayCastResult):Bool;
|
||||
}
|
||||
|
||||
@:native('Jolt.ContactListenerJS')
|
||||
extern class ContactListener {
|
||||
public function new():Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.BodyActivationListenerJS')
|
||||
extern class BodyActivationListener {
|
||||
public function new():Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.PhysicsSystem')
|
||||
extern class PhysicsSystem {
|
||||
public function new():Void;
|
||||
public function Init(maxBodies:Int, numBodyMutexes:Int, maxBodyPairs:Int, maxContactConstraints:Int):Void;
|
||||
public function Update(deltaTime:Float, collisionSteps:Int):Void;
|
||||
public function OptimizeBroadPhase():Void;
|
||||
public function GetBodyInterface():BodyInterface;
|
||||
public function GetBodyInterfaceNoLock():BodyInterface;
|
||||
public function GetNumBodies():Int;
|
||||
public function GetNumActiveBodies(bodyType:Int):Int;
|
||||
public function GetMaxBodies():Int;
|
||||
public function SetGravity(gravity:Vec3):Void;
|
||||
public function GetGravity():Vec3;
|
||||
public function SetContactListener(listener:ContactListener):Void;
|
||||
public function SetBodyActivationListener(listener:BodyActivationListener):Void;
|
||||
public function GetNarrowPhaseQuery():NarrowPhaseQuery;
|
||||
public function AddConstraint(constraint:Constraint):Void;
|
||||
public function RemoveConstraint(constraint:Constraint):Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.JoltSettings')
|
||||
extern class JoltSettings {
|
||||
public function new():Void;
|
||||
public var mMaxBodies:Int;
|
||||
public var mMaxBodyPairs:Int;
|
||||
public var mMaxContactConstraints:Int;
|
||||
public var mBroadPhaseLayerInterface:BroadPhaseLayerInterface;
|
||||
public var mObjectVsBroadPhaseLayerFilter:ObjectVsBroadPhaseLayerFilter;
|
||||
public var mObjectLayerPairFilter:ObjectLayerPairFilter;
|
||||
}
|
||||
|
||||
@:native('Jolt.JoltInterface')
|
||||
extern class JoltInterface {
|
||||
public function new(settings:JoltSettings):Void;
|
||||
public function Step(deltaTime:Float, collisionSteps:Int):Void;
|
||||
public function GetPhysicsSystem():PhysicsSystem;
|
||||
public function GetTempAllocator():Dynamic;
|
||||
}
|
||||
|
||||
@:native('Jolt.Constraint')
|
||||
extern class Constraint {
|
||||
public function GetType():Int;
|
||||
public function GetSubType():Int;
|
||||
public function GetRefCount():Int;
|
||||
public function SetEnabled(enabled:Bool):Void;
|
||||
public function GetEnabled():Bool;
|
||||
}
|
||||
|
||||
@:native('Jolt.TwoBodyConstraint')
|
||||
extern class TwoBodyConstraint extends Constraint {
|
||||
public function GetBody1():Body;
|
||||
public function GetBody2():Body;
|
||||
}
|
||||
|
||||
@:native('Jolt.FixedConstraintSettings')
|
||||
extern class FixedConstraintSettings {
|
||||
public function new():Void;
|
||||
public var mSpace:Int;
|
||||
public var mAutoDetectPoint:Bool;
|
||||
public var mPoint1:RVec3;
|
||||
public var mPoint2:RVec3;
|
||||
public var mAxisX1:Vec3;
|
||||
public var mAxisY1:Vec3;
|
||||
public var mAxisX2:Vec3;
|
||||
public var mAxisY2:Vec3;
|
||||
public function Create(body1:Body, body2:Body):TwoBodyConstraint;
|
||||
}
|
||||
|
||||
@:native('Jolt.PointConstraintSettings')
|
||||
extern class PointConstraintSettings {
|
||||
public function new():Void;
|
||||
public var mSpace:Int;
|
||||
public var mPoint1:RVec3;
|
||||
public var mPoint2:RVec3;
|
||||
public function Create(body1:Body, body2:Body):TwoBodyConstraint;
|
||||
}
|
||||
|
||||
@:native('Jolt.HingeConstraintSettings')
|
||||
extern class HingeConstraintSettings {
|
||||
public function new():Void;
|
||||
public var mSpace:Int;
|
||||
public var mPoint1:RVec3;
|
||||
public var mPoint2:RVec3;
|
||||
public var mHingeAxis1:Vec3;
|
||||
public var mHingeAxis2:Vec3;
|
||||
public var mNormalAxis1:Vec3;
|
||||
public var mNormalAxis2:Vec3;
|
||||
public var mLimitsMin:Float;
|
||||
public var mLimitsMax:Float;
|
||||
public var mMaxFrictionTorque:Float;
|
||||
public function Create(body1:Body, body2:Body):TwoBodyConstraint;
|
||||
}
|
||||
|
||||
@:native('Jolt.SliderConstraintSettings')
|
||||
extern class SliderConstraintSettings {
|
||||
public function new():Void;
|
||||
public var mSpace:Int;
|
||||
public var mAutoDetectPoint:Bool;
|
||||
public var mPoint1:RVec3;
|
||||
public var mPoint2:RVec3;
|
||||
public var mSliderAxis1:Vec3;
|
||||
public var mSliderAxis2:Vec3;
|
||||
public var mNormalAxis1:Vec3;
|
||||
public var mNormalAxis2:Vec3;
|
||||
public var mLimitsMin:Float;
|
||||
public var mLimitsMax:Float;
|
||||
public var mMaxFrictionForce:Float;
|
||||
public function Create(body1:Body, body2:Body):TwoBodyConstraint;
|
||||
}
|
||||
|
||||
@:native('Jolt.DistanceConstraintSettings')
|
||||
extern class DistanceConstraintSettings {
|
||||
public function new():Void;
|
||||
public var mSpace:Int;
|
||||
public var mPoint1:RVec3;
|
||||
public var mPoint2:RVec3;
|
||||
public var mMinDistance:Float;
|
||||
public var mMaxDistance:Float;
|
||||
public function Create(body1:Body, body2:Body):TwoBodyConstraint;
|
||||
}
|
||||
|
||||
@:native('Jolt.ConeConstraintSettings')
|
||||
extern class ConeConstraintSettings {
|
||||
public function new():Void;
|
||||
public var mSpace:Int;
|
||||
public var mPoint1:RVec3;
|
||||
public var mPoint2:RVec3;
|
||||
public var mTwistAxis1:Vec3;
|
||||
public var mTwistAxis2:Vec3;
|
||||
public var mHalfConeAngle:Float;
|
||||
public function Create(body1:Body, body2:Body):TwoBodyConstraint;
|
||||
}
|
||||
|
||||
@:native('Jolt.SixDOFConstraintSettings')
|
||||
extern class SixDOFConstraintSettings {
|
||||
public function new():Void;
|
||||
public var mSpace:Int;
|
||||
public var mPosition1:RVec3;
|
||||
public var mPosition2:RVec3;
|
||||
public var mAxisX1:Vec3;
|
||||
public var mAxisY1:Vec3;
|
||||
public var mAxisX2:Vec3;
|
||||
public var mAxisY2:Vec3;
|
||||
public function MakeFreeAxis(axis:Int):Void;
|
||||
public function MakeFixedAxis(axis:Int):Void;
|
||||
public function SetLimitedAxis(axis:Int, min:Float, max:Float):Void;
|
||||
public function Create(body1:Body, body2:Body):TwoBodyConstraint;
|
||||
}
|
||||
|
||||
@:native('Jolt.SixDOFConstraintSettings.EAxis')
|
||||
extern class SixDOFConstraintSettingsEAxis {
|
||||
public static var TranslationX:Int;
|
||||
public static var TranslationY:Int;
|
||||
public static var TranslationZ:Int;
|
||||
public static var RotationX:Int;
|
||||
public static var RotationY:Int;
|
||||
public static var RotationZ:Int;
|
||||
}
|
||||
|
||||
@:native('Jolt.Float3')
|
||||
extern class Float3 {
|
||||
public function new(x:Float, y:Float, z:Float):Void;
|
||||
public var x:Float;
|
||||
public var y:Float;
|
||||
public var z:Float;
|
||||
}
|
||||
|
||||
@:native('Jolt.IndexedTriangle')
|
||||
extern class IndexedTriangle {
|
||||
public function new():Void;
|
||||
public var mIdx:Array<Int>;
|
||||
public var mMaterialIndex:Int;
|
||||
}
|
||||
|
||||
@:native('Jolt.ConvexHullShapeSettings')
|
||||
extern class ConvexHullShapeSettingsExt extends ConvexHullShapeSettings {
|
||||
public var mPoints:Dynamic; // std::vector<Vec3>
|
||||
public var mMaxConvexRadius:Float;
|
||||
}
|
||||
|
||||
@:native('Jolt.MeshShapeSettings')
|
||||
extern class MeshShapeSettingsExt extends MeshShapeSettings {
|
||||
public var mTriangleVertices:Dynamic; // std::vector<Float3>
|
||||
public var mIndexedTriangles:Dynamic; // std::vector<IndexedTriangle>
|
||||
}
|
||||
|
||||
@:native('Jolt.HeightFieldShapeSettings')
|
||||
extern class HeightFieldShapeSettingsExt extends HeightFieldShapeSettings {
|
||||
public var mOffset:Vec3;
|
||||
public var mScale:Vec3;
|
||||
public var mSampleCount:Int;
|
||||
public var mHeightSamples:Dynamic; // float array
|
||||
}
|
||||
|
||||
@:native('Jolt.VehicleConstraintSettings')
|
||||
extern class VehicleConstraintSettings {
|
||||
public function new():Void;
|
||||
public var mMaxPitchRollAngle:Float;
|
||||
}
|
||||
|
||||
@:native('Jolt.WheelSettings')
|
||||
extern class WheelSettings {
|
||||
public function new():Void;
|
||||
public var mPosition:Vec3;
|
||||
public var mSuspensionDirection:Vec3;
|
||||
public var mSteeringAxis:Vec3;
|
||||
public var mWheelUp:Vec3;
|
||||
public var mWheelForward:Vec3;
|
||||
public var mSuspensionMinLength:Float;
|
||||
public var mSuspensionMaxLength:Float;
|
||||
public var mSuspensionPreloadLength:Float;
|
||||
public var mRadius:Float;
|
||||
public var mWidth:Float;
|
||||
}
|
||||
|
||||
@:native('Jolt.CharacterVirtualSettings')
|
||||
extern class CharacterVirtualSettings {
|
||||
public function new():Void;
|
||||
public var mShape:Shape;
|
||||
public var mMaxSlopeAngle:Float;
|
||||
public var mMass:Float;
|
||||
public var mMaxStrength:Float;
|
||||
public var mPredictiveContactDistance:Float;
|
||||
public var mEnhancedInternalEdgeRemoval:Bool;
|
||||
}
|
||||
|
||||
@:native('Jolt.CharacterVirtual')
|
||||
extern class CharacterVirtual {
|
||||
public function new(settings:CharacterVirtualSettings, position:RVec3, rotation:Quat, physicsSystem:PhysicsSystem):Void;
|
||||
public function SetLinearVelocity(velocity:Vec3):Void;
|
||||
public function GetLinearVelocity():Vec3;
|
||||
public function GetPosition():RVec3;
|
||||
public function SetPosition(position:RVec3):Void;
|
||||
public function GetRotation():Quat;
|
||||
public function SetRotation(rotation:Quat):Void;
|
||||
public function GetGroundState():Int;
|
||||
public function IsSupported():Bool;
|
||||
public function GetGroundNormal():Vec3;
|
||||
public function GetGroundVelocity():Vec3;
|
||||
public function Update(deltaTime:Float, gravity:Vec3, broadPhaseLayerFilter:Dynamic, objectLayerFilter:Dynamic, bodyFilter:Dynamic, allocator:Dynamic):Void;
|
||||
}
|
||||
|
||||
enum abstract EGroundState(Int) from Int to Int {
|
||||
var OnGround = 0;
|
||||
var OnSteepGround = 1;
|
||||
var NotSupported = 2;
|
||||
var InAir = 3;
|
||||
}
|
||||
|
||||
@:native('Jolt.SoftBodySharedSettings')
|
||||
extern class SoftBodySharedSettings {
|
||||
public function new():Void;
|
||||
public function AddFace(f:Dynamic):Void;
|
||||
public function CreateConstraints(settings:Dynamic):Void;
|
||||
public function Optimize():Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.SoftBodyCreationSettings')
|
||||
extern class SoftBodyCreationSettings {
|
||||
public function new(settings:SoftBodySharedSettings, position:RVec3, rotation:Quat, objectLayer:Int):Void;
|
||||
}
|
||||
|
||||
@:native('Jolt')
|
||||
extern class Jolt {
|
||||
public static function destroy(obj:Dynamic):Void;
|
||||
}
|
||||
|
||||
#end
|
||||
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