Using physX how do I apply force in direction model is facing?

Posted By: bpc31

Using physX how do I apply force in direction model is facing? - 02/23/11 17:48

I am trying to propel a boat model forward without using any of the tire physic templates but so far I can only rotate left and right. When I apply pXentsetforce local or global it only moves in absolutes not relative to my last rotation. Anyone have a code samples for this?
Posted By: Rei_Ayanami

Re: Using physX how do I apply force in direction model is facing? - 02/23/11 18:04

Rotating the speed/accel vector with the actual rotation would be my solution.
Posted By: bpc31

Re: Using physX how do I apply force in direction model is facing? - 02/24/11 18:15

Any code samples? I'm not much of a programmer. laugh
Posted By: TehV

Re: Using physX how do I apply force in direction model is facing? - 03/18/11 17:56

This should work:

Code:
a = cos(me.pan);
b = sin(me.pan);

pXentsetforce(me,vector(a,b,0));



I am not sure about how to use pXentsetforce(), so you might have to adjust that bit. Everything else should work.
© 2024 lite-C Forums