📄 oxnewtonjoint.pas
字号:
NewtonJointSetCollisionState( Joint, FCollisionState );
end;
end;
{******************************************************************************}
// [15-9-2007]: TOXSliderJoint last change by Dave Gravel. //
{******************************************************************************}
function TOXSliderJoint.GetStiffness: Float;
begin
if FActived then
result:= NewtonJointGetStiffness( Joint )
else
result:= FStiffness;
end;
{******************************************************************************}
// [15-9-2007]: TOXSliderJoint last change by Dave Gravel. //
{******************************************************************************}
procedure TOXSliderJoint.DoProgress( const progressTime: TProgressTimes );
begin
inherited;
if FActived then
begin
end;
end;
{******************************************************************************}
// [15-9-2007]: TOXSliderJoint last change by Dave Gravel. //
{******************************************************************************}
procedure TOXSliderJoint.InitJoint( body1, body2: PNewtonBody );
begin
FManager:= TOXNewtonManager(Scene);
if FActived or ( FManager = nil ) then Exit;
FManager.AddLog( Name + ' create.', 1, ':Info Object' );
oxSetJointSlider( self, body1, body2 );
FManager.AddLog( 'Joint Slider Name: '+Name, 1, ':Info Object' );
FManager.AddLog( Name + ' InitJoint.', 1, ':Info Object' );
FActived:= True;
end;
{******************************************************************************}
// [15-9-2007]: TOXSliderJoint last change by Dave Gravel. //
{******************************************************************************}
procedure TOXSliderJoint.SetStiffness( const val: Float );
begin
if FStiffness <> val then
begin
FStiffness:= val;
if FActived then
NewtonJointSetStiffness( Joint, FStiffness );
end;
end;
{******************************************************************************}
// [15-9-2007]: TOXSliderJoint last change by Dave Gravel. //
{******************************************************************************}
destructor TOXSliderJoint.destroy;
begin
if FActived and assigned(Joint) then begin
if ( not ( csDesigning in ComponentState ) ) then
if Name = '' then FManager.AddLog( ClassName + ' destroyed.', 1, ':Info Object' )
else FManager.AddLog( Name + ' destroyed.', 1, ':Info Object' );
if Joint<>nil then
NewtonDestroyJoint( FManager.World, Joint );
FActived:= False;
end;
inherited destroy;
end;
{******************************************************************************}
// [15-9-2007]: TOXCorkscrewJoint last change by Dave Gravel. //
{******************************************************************************}
constructor TOXCorkscrewJoint.Create( aOwner: TComponent );
begin
inherited Create( aOwner );
FOrionX3D:= 100;
FActived:= False;
FCollisionState:= 0;
FStiffness:= 1;
EdgeColor.AsWinColor:= clRed;
end;
{******************************************************************************}
// [15-9-2007]: TOXCorkscrewJoint last change by Dave Gravel. //
{******************************************************************************}
function TOXCorkscrewJoint.GetCollisionState: integer;
begin
if FActived then
result:= NewtonJointGetCollisionState( Joint )
else
result:= FCollisionState;
end;
{******************************************************************************}
// [15-9-2007]: TOXCorkscrewJoint last change by Dave Gravel. //
{******************************************************************************}
procedure TOXCorkscrewJoint.SetCollisionState( const val: integer );
begin
if FCollisionState <> val then
begin
FCollisionState:= val;
if FActived then
NewtonJointSetCollisionState( Joint, FCollisionState );
end;
end;
{******************************************************************************}
// [15-9-2007]: TOXCorkscrewJoint last change by Dave Gravel. //
{******************************************************************************}
function TOXCorkscrewJoint.GetJAngle: TOXVector3;
begin
if FActived then
begin
NewtonBallGetJointAngle( Joint, @result[0] );
end else
result:= oxV3Make( 0, 0, 0 );
end;
{******************************************************************************}
// [15-9-2007]: TOXCorkscrewJoint last change by Dave Gravel. //
{******************************************************************************}
function TOXCorkscrewJoint.GetJOmega: TOXVector3;
begin
if FActived then
begin
NewtonBallGetJointOmega( Joint, @result[0] );
end else
result:= oxV3Make( 0, 0, 0 );
end;
{******************************************************************************}
// [15-9-2007]: TOXCorkscrewJoint last change by Dave Gravel. //
{******************************************************************************}
function TOXCorkscrewJoint.GetJForce: TOXVector3;
begin
if FActived then
begin
NewtonBallGetJointForce( Joint, @result[0] );
end else
result:= oxV3Make( 0, 0, 0 );
end;
{******************************************************************************}
// [15-9-2007]: TOXCorkscrewJoint last change by Dave Gravel. //
{******************************************************************************}
function TOXCorkscrewJoint.GetStiffness: Float;
begin
if FActived then
result:= NewtonJointGetStiffness( Joint )
else
result:= FStiffness;
end;
{******************************************************************************}
// [15-9-2007]: TOXCorkscrewJoint last change by Dave Gravel. //
{******************************************************************************}
procedure TOXCorkscrewJoint.DoProgress( const progressTime: TProgressTimes );
begin
inherited;
if FActived then
begin
end;
end;
{******************************************************************************}
// [15-9-2007]: TOXCorkscrewJoint last change by Dave Gravel. //
{******************************************************************************}
procedure TOXCorkscrewJoint.InitJoint( body1, body2: PNewtonBody );
begin
FManager:= TOXNewtonManager(Scene);
if FActived or ( FManager = nil ) then Exit;
FManager.AddLog( Name + ' create.', 1, ':Info Object' );
oxSetJointCorkscrew( self, body1, body2 );
FManager.AddLog( 'Joint Corkscrew Name: '+Name, 1, ':Info Object' );
FManager.AddLog( Name + ' InitJoint.', 1, ':Info Object' );
FActived:= True;
end;
{******************************************************************************}
// [15-9-2007]: TOXCorkscrewJoint last change by Dave Gravel. //
{******************************************************************************}
procedure TOXCorkscrewJoint.SetStiffness( const val: Float );
begin
if FStiffness <> val then
begin
FStiffness:= val;
if FActived then
NewtonJointSetStiffness( Joint, FStiffness );
end;
end;
{******************************************************************************}
// [15-9-2007]: TOXCorkscrewJoint last change by Dave Gravel. //
{******************************************************************************}
destructor TOXCorkscrewJoint.destroy;
begin
if FActived and assigned(Joint) then begin
if ( not ( csDesigning in ComponentState ) ) then
if Name = '' then FManager.AddLog( ClassName + ' destroyed.', 1, ':Info Object' )
else FManager.AddLog( Name + ' destroyed.', 1, ':Info Object' );
if Joint<>nil then
NewtonDestroyJoint( FManager.World, Joint );
FActived:= False;
end;
inherited destroy;
end;
{******************************************************************************}
// [15-9-2007]: TOXUniversalJoint last change by Dave Gravel. //
{******************************************************************************}
constructor TOXUniversalJoint.Create( aOwner: TComponent );
begin
inherited Create( aOwner );
FOrionX3D:= 100;
FActived:= False;
FCollisionState:= 0;
FStiffness:= 1;
EdgeColor.AsWinColor:= clRed;
end;
{******************************************************************************}
// [15-9-2007]: TOXUniversalJoint last change by Dave Gravel. //
{******************************************************************************}
function TOXUniversalJoint.GetCollisionState: integer;
begin
if FActived then
result:= NewtonJointGetCollisionState( Joint )
else
result:= FCollisionState;
end;
{******************************************************************************}
// [15-9-2007]: TOXUniversalJoint last change by Dave Gravel. //
{******************************************************************************}
procedure TOXUniversalJoint.SetCollisionState( const val: integer );
begin
if FCollisionState <> val then
begin
FCollisionState:= val;
if FActived then
NewtonJointSetCollisionState( Joint, FCollisionState );
end;
end;
{******************************************************************************}
// [15-9-2007]: TOXUniversalJoint last change by Dave Gravel. //
{******************************************************************************}
function TOXUniversalJoint.GetStiffness: Float;
begin
if FActived then
result:= NewtonJointGetStiffness( Joint )
else
result:= FStiffness;
end;
{******************************************************************************}
// [15-9-2007]: TOXUniversalJoint last change by Dave Gravel. //
{******************************************************************************}
procedure TOXUniversalJoint.DoProgress( const progressTime: TProgressTimes );
begin
inherited;
if FActived then
begin
end;
end;
{******************************************************************************}
// [15-9-2007]: TOXUniversalJoint last change by Dave Gravel. //
{******************************************************************************}
procedure TOXUniversalJoint.InitJoint( body1, body2: PNewtonBody );
begin
FManager:= TOXNewtonManager(Scene);
if FActived or ( FManager = nil ) then Exit;
FManager.AddLog( Name + ' create.', 1, ':Info Object' );
oxSetJointUniversal( self, body1, body2 );
FManager.AddLog( 'Joint Universal Name: '+Name, 1, ':Info Object' );
FManager.AddLog( Name + ' InitJoint.', 1, ':Info Object' );
FActived:= True;
end;
{******************************************************************************}
// [15-9-2007]: TOXUniversalJoint last change by Dave Gravel. //
{******************************************************************************}
procedure TOXUniversalJoint.SetStiffness( const val: Float );
begin
if FStiffness <> val then
begin
FStiffness:= val;
if FActived then
NewtonJointSetStiffness( Joint, FStiffness );
end;
end;
{******************************************************************************}
// [15-9-2007]: TOXUniversalJoint last change by Dave Gravel. //
{******************************************************************************}
destructor TOXUniversalJoint.destroy;
begin
if FActived and assigned(Joint) then begin
if ( not ( csDesigning in ComponentState ) ) then
if Name = '' then FManager.AddLog( ClassName + ' destroyed.', 1, ':Info Object' )
else FManager.AddLog( Name + ' destroyed.', 1, ':Info Object' );
if Joint<>nil then
NewtonDestroyJoint( FManager.World, Joint );
FActived:= False;
end;
inherited destroy;
end;
{******************************************************************************}
// [15-9-2007]: TOXUpVectorJoint last change by Dave Gravel. //
{******************************************************************************}
constructor TOXUpVectorJoint.Create( aOwner: TComponent );
begin
inherited Create( aOwner );
FOrionX3D:= 100;
FActived:= False;
FCollisionState:= 0;
FStiffness:= 1;
EdgeColor.AsWinColor:= clRed;
end;
{******************************************************************************}
// [15-9-2007]: TOXUpVectorJoint last change by Dave Gravel. //
{******************************************************************************}
function TOXUpVectorJoint.GetCollisionState: integer;
begin
if FActived then
result:= NewtonJointGetCollisionState( Joint )
else
result:= FCollisionState;
end;
{******************************************************************************}
// [15-9-2007]: TOXUpVectorJoint last change by Dave Gravel. //
{******************************************************************************}
procedure TOXUpVectorJoint.SetCollisionState( const val: integer );
begin
if FCollisionState <> val then
begin
FCollisionState:= val;
if FActived then
NewtonJointSetCollisionState( Joint, FCollisionState );
end;
end;
{******************************************************************************}
// [15-9-2007]: TOXUpVectorJoint last change by Dave Gravel. //
{******************************************************************************}
function TOXUpVectorJoint.GetStiffness: Float;
begin
if FActived then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -