forked from LeenkxTeam/LNXSDK
Jolt Patch
This commit is contained in:
@ -158,7 +158,9 @@ extern class Body {
|
||||
public function IsSensor():Bool;
|
||||
public function SetIsSensor(sensor:Bool):Void;
|
||||
public function GetPosition():RVec3;
|
||||
public function GetPositionInto(out:RVec3):Void;
|
||||
public function GetRotation():Quat;
|
||||
public function GetRotationInto(out:Quat):Void;
|
||||
public function GetWorldTransform():Mat44;
|
||||
public function GetCenterOfMassPosition():RVec3;
|
||||
public function GetCenterOfMassTransform():Mat44;
|
||||
@ -291,6 +293,7 @@ extern class MassProperties {
|
||||
@:native('Jolt.BodyCreationSettings')
|
||||
extern class BodyCreationSettings {
|
||||
public function new(shape:Shape, position:RVec3, rotation:Quat, motionType:Int, objectLayer:Int):Void;
|
||||
public var mObjectLayer:Int;
|
||||
public var mFriction:Float;
|
||||
public var mRestitution:Float;
|
||||
public var mLinearDamping:Float;
|
||||
@ -409,9 +412,70 @@ extern class ObjectLayerPairFilter {
|
||||
public function new():Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.RayCastSettings')
|
||||
extern class RayCastSettings {
|
||||
public function new():Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.BroadPhaseLayerFilter')
|
||||
extern class BroadPhaseLayerFilter {
|
||||
public function new():Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.ObjectLayerFilter')
|
||||
extern class ObjectLayerFilter {
|
||||
public function new():Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.DefaultObjectLayerFilter')
|
||||
extern class DefaultObjectLayerFilter extends ObjectLayerFilter {
|
||||
public function new(objectLayerPairFilter:ObjectLayerPairFilter, objectLayer:Int):Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.BodyFilter')
|
||||
extern class BodyFilter {
|
||||
public function new():Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.ShapeFilter')
|
||||
extern class ShapeFilter {
|
||||
public function new():Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.CastRayCollector')
|
||||
extern class CastRayCollector {
|
||||
public function new():Void;
|
||||
public function Reset():Void;
|
||||
public function SetContext(context:Dynamic):Void;
|
||||
public function GetContext():Dynamic;
|
||||
public function UpdateEarlyOutFraction(fraction:Float):Void;
|
||||
public function ResetEarlyOutFraction(fraction:Float = 1.0):Void;
|
||||
public function ForceEarlyOut():Void;
|
||||
public function ShouldEarlyOut():Bool;
|
||||
public function GetEarlyOutFraction():Float;
|
||||
public function GetPositiveEarlyOutFraction():Float;
|
||||
}
|
||||
|
||||
@:native('Jolt.CastRayClosestHitCollisionCollector')
|
||||
extern class CastRayClosestHitCollisionCollector extends CastRayCollector {
|
||||
public function new():Void;
|
||||
public function HadHit():Bool;
|
||||
public var mHit:RayCastResult;
|
||||
}
|
||||
|
||||
@:native('Jolt.BroadPhaseQuery')
|
||||
extern class BroadPhaseQuery {
|
||||
public function CastRay(ray:RRayCast, result:RayCastResult,
|
||||
broadPhaseFilter:BroadPhaseLayerFilter,
|
||||
objectLayerFilter:ObjectLayerFilter):Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.NarrowPhaseQuery')
|
||||
extern class NarrowPhaseQuery {
|
||||
public function CastRay(ray:RRayCast, result:RayCastResult):Bool;
|
||||
public function CastRay(ray:RRayCast, settings:RayCastSettings,
|
||||
collector:CastRayCollector, broadPhaseFilter:BroadPhaseLayerFilter,
|
||||
objectLayerFilter:ObjectLayerFilter, bodyFilter:BodyFilter,
|
||||
shapeFilter:ShapeFilter):Void;
|
||||
}
|
||||
|
||||
@:native('Jolt.ContactListenerJS')
|
||||
@ -440,6 +504,7 @@ extern class PhysicsSystem {
|
||||
public function SetContactListener(listener:ContactListener):Void;
|
||||
public function SetBodyActivationListener(listener:BodyActivationListener):Void;
|
||||
public function GetNarrowPhaseQuery():NarrowPhaseQuery;
|
||||
public function GetBroadPhaseQuery():BroadPhaseQuery;
|
||||
public function AddConstraint(constraint:Constraint):Void;
|
||||
public function RemoveConstraint(constraint:Constraint):Void;
|
||||
}
|
||||
|
||||
@ -156,7 +156,9 @@ interface Body {
|
||||
int GetMotionType();
|
||||
void SetMotionType(int inMotionType);
|
||||
[Value] RVec3 GetPosition();
|
||||
void GetPositionInto([Ref] RVec3 outPosition);
|
||||
[Value] Quat GetRotation();
|
||||
void GetRotationInto([Ref] Quat outRotation);
|
||||
[Value] Mat44 GetWorldTransform();
|
||||
[Value] RVec3 GetCenterOfMassPosition();
|
||||
[Value] Mat44 GetCenterOfMassTransform();
|
||||
@ -198,6 +200,7 @@ interface MassProperties {
|
||||
// BodyCreationSettings
|
||||
interface BodyCreationSettings {
|
||||
void BodyCreationSettings([Const] Shape inShape, [Const, Ref] RVec3 inPosition, [Const, Ref] Quat inRotation, int inMotionType, short inObjectLayer);
|
||||
attribute short mObjectLayer;
|
||||
attribute float mFriction;
|
||||
attribute float mRestitution;
|
||||
attribute float mLinearDamping;
|
||||
@ -273,9 +276,39 @@ interface RayCastResult {
|
||||
attribute float mFraction;
|
||||
};
|
||||
|
||||
// RayCastSettings
|
||||
interface RayCastSettings {
|
||||
void RayCastSettings();
|
||||
};
|
||||
|
||||
// BroadPhaseLayerFilter
|
||||
interface BroadPhaseLayerFilter {
|
||||
void BroadPhaseLayerFilter();
|
||||
};
|
||||
|
||||
// ObjectLayerFilter
|
||||
interface ObjectLayerFilter {
|
||||
void ObjectLayerFilter();
|
||||
};
|
||||
|
||||
// BodyFilter
|
||||
interface BodyFilter {
|
||||
void BodyFilter();
|
||||
};
|
||||
|
||||
// ShapeFilter
|
||||
interface ShapeFilter {
|
||||
void ShapeFilter();
|
||||
};
|
||||
|
||||
// BroadPhaseQuery
|
||||
interface BroadPhaseQuery {
|
||||
void CastRay([Const, Ref] RRayCast inRay, [Ref] RayCastResult ioHit, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseLayerFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter);
|
||||
};
|
||||
|
||||
// NarrowPhaseQuery
|
||||
interface NarrowPhaseQuery {
|
||||
boolean CastRay([Const, Ref] RRayCast inRay, [Ref] RayCastResult ioHit);
|
||||
boolean CastRay([Const, Ref] RRayCast inRay, [Ref] RayCastResult ioHit, [Const, Ref] RayCastSettings inRayCastSettings, [Const, Ref] BroadPhaseLayerFilter inBroadPhaseLayerFilter, [Const, Ref] ObjectLayerFilter inObjectLayerFilter, [Const, Ref] BodyFilter inBodyFilter, [Const, Ref] ShapeFilter inShapeFilter);
|
||||
};
|
||||
|
||||
// PhysicsSystem
|
||||
@ -292,6 +325,7 @@ interface PhysicsSystem {
|
||||
void SetGravity([Const, Ref] Vec3 inGravity);
|
||||
[Value] Vec3 GetGravity();
|
||||
[Const, Ref] NarrowPhaseQuery GetNarrowPhaseQuery();
|
||||
[Const, Ref] BroadPhaseQuery GetBroadPhaseQuery();
|
||||
void AddConstraint(Constraint inConstraint);
|
||||
void RemoveConstraint(Constraint inConstraint);
|
||||
};
|
||||
|
||||
@ -214,7 +214,7 @@ class Module {
|
||||
if( v.ret.t != TVoid )
|
||||
e = { expr : EReturn(e), pos : p };
|
||||
else if( isConstr )
|
||||
e = macro this = $e;
|
||||
e = macro this = untyped $e;
|
||||
return e;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user