Motorized Slider Joint

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Motorized Slider Joint

Postby Chris2002 » Tue Jun 23, 2009 5:44 am

Hi,
I would like to move two cylinders (which are connected with a slider joint) relativ to each other.
What's about
Code: Select all
  NewtonSliderSetUserCallback(Joint, SliderCallback);

Can somebody post an example please?
Thanks a lot!

Chris
Chris2002
 
Posts: 2
Joined: Thu Mar 05, 2009 4:20 pm

Re: Motorized Slider Joint

Postby KiwiCoder » Tue Jun 23, 2009 6:55 am

If you do a Google Code Search for the func it returns a couple of source code samples, you may want to check these..
http://www.google.com/codesearch?hl=en& ... erCallback

Cheers,
KC
KiwiCoder
 
Posts: 15
Joined: Thu Jun 11, 2009 4:39 pm

Re: Motorized Slider Joint

Postby Chris2002 » Tue Jun 23, 2009 8:15 am

Thanks,
it works :)
Code: Select all
function SliderCallback( const slider : PNewtonJoint; desc : PNewtonHingeSliderUpdateDesc ) : Unsigned_int; cdecl;
var
  i: integer;
  position: double;
  LimitMin, Limitmax: double;
begin
  LimitMin := -25;
  LimitMax :=  25;

  position:=...

  if (position<LimitMin) then position:=LimitMin;
  if (position>LimitMax) then position:=LimitMax;

  desc.m_accel:=NewtonSliderCalculateStopAccel(slider,desc,position);
end ;
Chris2002
 
Posts: 2
Joined: Thu Mar 05, 2009 4:20 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron