📄 oxnewtondll.pas
字号:
procedure oxMeshSetMass( Body: PNewtonBody; Mass: Float; InertiaX, InertiaY, InertiaZ, OriginX, OriginY, OriginZ, ConcretX, ConcretY, ConcretZ: Float ); stdcall; external oxDLL name 'oxMeshSetMass';
procedure oxCubeSetMass( Body: PNewtonBody; Mass: Float; InertiaX, InertiaY, InertiaZ, OriginX, OriginY, OriginZ, ConcretX, ConcretY, ConcretZ: Float ); stdcall; external oxDLL name 'oxCubeSetMass';
procedure oxSphereSetMass( Body: PNewtonBody; Mass: Float; InertiaX, InertiaY, InertiaZ, OriginX, OriginY, OriginZ, ConcretX, ConcretY, ConcretZ: Float ); stdcall; external oxDLL name 'oxSphereSetMass';
procedure oxCCylinderSetMass( Body: PNewtonBody; Mass: Float; InertiaX, InertiaY, InertiaZ, OriginX, OriginY, OriginZ, ConcretX, ConcretY, ConcretZ: Float ); stdcall; external oxDLL name 'oxCCylinderSetMass';
procedure oxCylinderSetMass( Body: PNewtonBody; Mass: Float; InertiaX, InertiaY, InertiaZ, OriginX, OriginY, OriginZ, ConcretX, ConcretY, ConcretZ: Float ); stdcall; external oxDLL name 'oxCylinderSetMass';
procedure oxChamferCylinderSetMass( Body: PNewtonBody; Mass: Float; InertiaX, InertiaY, InertiaZ, OriginX, OriginY, OriginZ, ConcretX, ConcretY, ConcretZ: Float ); stdcall; external oxDLL name 'oxChamferCylinderSetMass';
procedure oxConeSetMass( Body: PNewtonBody; Mass: Float; InertiaX, InertiaY, InertiaZ, OriginX, OriginY, OriginZ, ConcretX, ConcretY, ConcretZ: Float ); stdcall; external oxDLL name 'oxConeSetMass';
procedure oxCompoundSetMass( Body: PNewtonBody; Mass: Float; InertiaX, InertiaY, InertiaZ, OriginX, OriginY, OriginZ, ConcretX, ConcretY, ConcretZ: Float ); stdcall; external oxDLL name 'oxCompoundSetMass';
procedure oxSkinRagdoll( Geom: PNewtonCollision; Body: PNewtonBody; Mass: Float; InertiaX, InertiaY, InertiaZ, OriginX, OriginY, OriginZ, ConcretX, ConcretY, ConcretZ: Float ); stdcall; external oxDLL name 'oxSkinRagdoll';
procedure oxDynCylinderBuildList( const cylinder: TOXNewtonDynCylinder; rci: TRenderContextInfo ); stdcall; external oxDLL name 'oxDynCylinderBuildList';
procedure oxDynCCylinderBuildList( const ccylinder: TOXNewtonDynCCylinder; rci: TRenderContextInfo ); stdcall; external oxDLL name 'oxDynCCylinderBuildList';
procedure oxGLCCylinderBuildList( const ccylinder: TCompoundCapsule; rci: TRenderContextInfo ); stdcall; external oxDLL name 'oxGLCCylinderBuildList';
procedure oxCompoundCylinderBuildList( const cylinder: TCompoundCylinder; rci: TRenderContextInfo ); stdcall; external oxDLL name 'oxCompoundCylinderBuildList';
procedure oxCompoundConeBuildList( const Cone: TCompoundCone; rci: TRenderContextInfo ); stdcall; external oxDLL name 'oxCompoundConeBuildList';
procedure oxCompoundChamferCylinderBuildList( const ChamferCylinder: TCompoundChamferCylinder; rci: TRenderContextInfo ); stdcall; external oxDLL name 'oxCompoundChamferCylinderBuildList';
procedure oxStaCylinderBuildList( const cylinder: TOXNewtonStaCylinder; rci: TRenderContextInfo ); stdcall; external oxDLL name 'oxStaCylinderBuildList';
procedure oxStaCCylinderBuildList( const ccylinder: TOXNewtonStaCCylinder; rci: TRenderContextInfo ); stdcall; external oxDLL name 'oxStaCCylinderBuildList';
procedure oxStaChamferCylinderBuildList( const Torus: TOXNewtonStaChamferCylinder; rci: TRenderContextInfo ); stdcall; external oxDLL name 'oxStaChamferCylinderBuildList';
procedure oxDynChamferCylinderBuildList( const Torus: TOXNewtonDynChamferCylinder; rci: TRenderContextInfo ); stdcall; external oxDLL name 'oxDynChamferCylinderBuildList';
procedure oxSetCapCCylinder( Cap0, Cap1: TGLSphere; obj: TCompoundCapsule ); stdcall; external oxDLL name 'oxSetCapCCylinder';
procedure oxSetCapDCCylinder( Cap0, Cap1: TGLSphere; obj: TOXNewtonDynCCylinder ); stdcall; external oxDLL name 'oxSetCapDCCylinder';
procedure oxSetCapSCCylinder( Cap0, Cap1: TGLSphere; obj: TOXNewtonStaCCylinder ); stdcall; external oxDLL name 'oxSetCapSCCylinder';
procedure oxDynConeBuildList( const Cone: TOXNewtonDynCone; rci: TRenderContextInfo ); stdcall; external oxDLL name 'oxDynConeBuildList';
procedure oxStaConeBuildList( const Cone: TOXNewtonStaCone; rci: TRenderContextInfo ); stdcall; external oxDLL name 'oxStaConeBuildList';
procedure oxBoneCylinderBuildList( const cylinder: TOXNewtonBoneCylinder; rci: TRenderContextInfo ); stdcall; external oxDLL name 'oxBoneCylinderBuildList';
procedure oxSetRollingFriction( body: PNewtonBody; limitation: Float ); stdcall; external oxDLL name 'oxSetRollingFriction';
// Vehicle utility
procedure oxVehicleBuildConvexHull( Mesh: TOXNewtonVehicle ); stdcall; cdecl; external oxDLL name 'oxVehicleBuildConvexHull';
procedure oxVehicleSetTransform( const Body: PNewtonBody; const Matrix: PFloat ); stdcall; cdecl; external oxDLL name 'oxVehicleSetTransform';
procedure oxVehicleForceAndTorque( const Body: PNewtonBody ); stdcall; cdecl; external oxDLL name 'oxVehicleForceAndTorque';
procedure oxVehicleTireCreateShock( Wheel: TGLFreeForm; pVehicle: TOXNewtonVehicle; pMatrix: TOXMatrix;
Tire: TOXVehicleTire; Mass, pWidth, pRadius, Length, Spring, Shock: Float; Pin: TOXVector3 ); stdcall; external oxDLL name 'oxVehicleTireCreateShock';
procedure oxVehiclePTireUpdate( const Vehicle: PNewtonJoint ); stdcall; cdecl; external oxDLL name 'oxVehiclePTireUpdate';
procedure oxVehicleSetTirePhysics( const Vehicle: PNewtonJoint; TireID: Integer ); stdcall; external oxDLL name 'oxVehicleSetTirePhysics';
procedure oxVehicleSetFrontTirePhysics( const Vehicle: PNewtonJoint; TireID: Integer ); stdcall; external oxDLL name 'oxVehicleSetFrontTirePhysics';
procedure oxVehicleSetRearTirePhysics( const Vehicle: PNewtonJoint; TireID: Integer ); stdcall; external oxDLL name 'oxVehicleSetRearTirePhysics';
procedure oxVehicleSetMass( Body: PNewtonBody; mass: Float; InertiaX, InertiaY, InertiaZ, OriginX, OriginY, OriginZ, ConcretX, ConcretY, ConcretZ: Float ); stdcall; external oxDLL name 'oxVehicleSetMass';
procedure oxVehicleFlipRight( body: PNewtonBody; Joint: PNewtonJoint; fX, fY, fZ, aX, aY, aZ: Float; Angle: Float ); stdcall; external oxDLL name 'oxVehicleFlipRight';
procedure oxVehicleRearFrontSetTorque( Vehicle: TOXNewtonVehicle; Tire1, Tire2, Tire3, Tire4: TOXVehicleTire; pTorque: Float ); stdcall; external oxDLL name 'oxVehicleRearFrontSetTorque';
procedure oxVehicleFrontSetSteeringAngle( Vehicle: TOXNewtonVehicle; Tire1, Tire2: TOXVehicleTire; pSteeringAngle: Float ); stdcall; external oxDLL name 'oxVehicleFrontSetSteeringAngle';
function oxVehicleSpeed( Body: PNewtonBody ): Float; stdcall; external oxDLL name 'oxVehicleSpeed';
procedure oxVehicleStreamCom( const FreeForm: TGLFreeForm; const Name: ShortString; const matlib: TGLMaterialLibrary ); stdcall; external oxDLL name 'oxVehicleStreamCom';
procedure oxVehicleStreamDec( const FreeForm: TGLFreeForm; const Name: ShortString; const matlib: TGLMaterialLibrary ); stdcall; external oxDLL name 'oxVehicleStreamDec';
// Vehicle utility
procedure oxVehicleMeshModify( FreeForm: TGLFreeForm; sx, sy, sz, rx, ry, rz: single ); stdcall; external oxDLL name 'oxVehicleMeshModify';
// Show Debug collision
procedure oxDebugShowBodyCollision( const Body: PNewtonBody ); stdcall; cdecl; external oxDLL name 'oxDebugShowBodyCollision';
procedure oxDebugShowGeometryCollision( const Body: PNewtonBody; VertexCount: Integer;
const FaceArray: PFloat; FaceId: integer ); stdcall; cdecl; external oxDLL name 'oxDebugShowGeometryCollision';
//Material Managing.
procedure oxSetWorldDefaultMaterial( va1, va2, va3, va4: float ); stdcall; external oxDLL name 'oxSetWorldDefaultMaterial';
procedure oxSetObjectMaterial( Body: PNewtonBody ); stdcall; external oxDLL name 'oxSetObjectMaterial';
procedure oxSetRagdollMaterial( Body: PNewtonBody ); stdcall; external oxDLL name 'oxSetRagdollMaterial';
//Joints Managing
procedure oxSetJointBall( obj: TOXBallJoint; body0, body1: PNewtonBody ); stdcall; external oxDLL name 'oxSetJointBall';
procedure oxSetJointHinge( obj: TOXHingeJoint; body0, body1: PNewtonBody ); stdcall; external oxDLL name 'oxSetJointHinge';
procedure oxSetJointSlider( obj: TOXSliderJoint; body0, body1: PNewtonBody ); stdcall; external oxDLL name 'oxSetJointSlider';
procedure oxSetJointCorkscrew( obj: TOXCorkscrewJoint; body0, body1: PNewtonBody ); stdcall; external oxDLL name 'oxSetJointCorkscrew';
procedure oxSetJointUniversal( obj: TOXUniversalJoint; body0, body1: PNewtonBody ); stdcall; external oxDLL name 'oxSetJointUniversal';
procedure oxSetJointUpVector( obj: TOXUpVectorJoint; body: PNewtonBody ); stdcall; external oxDLL name 'oxSetJointUpVector';
procedure oxSetJointUserBilateral( obj: TOXUserBilateralJoint; body0, body1: PNewtonBody ); stdcall; external oxDLL name 'oxSetJointUserBilateral';
//
implementation
uses oxModuleLoader;
var voxHandle: TModuleHandle;
function oxInit( DllName: PChar ): boolean;
begin
if ( DllName = '' ) then
DllName:= oxDLL;
IsOXInitialized:= LoadModule( voxHandle, DllName );
result:= IsOXInitialized;
if IsOXInitialized then
begin
{DynamicLoadMarker}
end;
end;
procedure oxClose;
begin
IsOXInitialized:= false;
UnLoadModule( voxHandle );
end;
{******************************************************************************}
{$D '[15-9-2007]: TOXNewtonManager v1.55 by Dave Gravel under MPL-1.1 license.'}
{******************************************************************************}
initialization
oxInit( oxDLL );
finalization
oxClose;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -