0

Hi I'm currently new in farseer physics engine, anyway, I have read tutorial about farseer 3.31 here http://roy-t.nl/index.php/2012/09/06/farseer-physics-3-3-1-and-xna-joints/

in the tutorial he's trying to attach/join paddle body to world withJointFactory.CreateFixedRevoluteJoint , unfortunately in farseer 3.5 there is no CreateFixedRevoluteJoint method, it's only CreateRevoluteJoint which is joint two bodies, so how can I revolute joint one body to world object ?

4

1 回答 1

3

使用 RevoluteJoint。并让你的桨围绕另一个物体旋转。像这样:

Body motorPaddle = CreateMotorPaddle();  
Body motorPaddleAxle = BodyFactory.CreateCircle(World, 0.1f, 1f);  

var j = JointFactory.CreateRevoluteJoint  
    (  
        World,  
        motorPaddle,  
        motorPaddleAxle,  
        new Vector2(0.0f, 0.0f),  
        new Vector2(-14.0f, 10.0f)  
        );  

// set speed and torque  
j.MotorSpeed = MathHelper.Pi;  
j.MotorImpulse = 100;   
j.MotorEnabled = true;  
j.MaxMotorTorque = 100;  

更多细节在这里

于 2013-11-17T01:24:21.207 回答