AGK for Pascal
ContentsIndexHome
PreviousUpNext
TAgkLimitedJoint.EnableMotor Method

Turns on a motor for the joint so that it moves continuously until prevented by a collision.

Syntax
Pascal
procedure EnableMotor(const Speed: Single; const MaxForce: Single);
Parameters 
Description 
const Speed: Single 
The desired speed of the motor. 
const MaxForce: Single 
The max force it can use to achieve the speed. 

Motors work by applying a force to achieve a set speed, if they meet resistance they increase the force until either the motor is moving at the desired speed or the maximum force specified is reached, at which point the motor will stop, continuing to apply the maximum force. In the case of linear joints the motor applies in one direction and either pushes the attached sprites together or apart.

Copyright (c) 2012. All rights reserved.