I have a question about lowlevel path following.
In the HighLevel there's
RotateMoveToPoint(); // Rotate and Move.
I'm running a script in LowLevel.
When I use FacePoint(); Needless to say this isn't a very smooth rotation. The pawn simply, faces the point. I don't have any animations that need to be played or anything.
What I really would like some help with is :
"How can you make the script return the angles the ScriptPoint is facing then have the Pawn ChangeYaw() and keep moving forward to that angle.
Thanks!
rgdyman
Low Level paths.
The new RF should have a low level command called:
GetYawToPoint();
This will return the yaw so that you can then use:
self.ideal_yaw=GetYawToPoint();
ChangeYaw();
In case it is not in the latest RF, here is the code:
Enjoy.
GetYawToPoint();
This will return the yaw so that you can then use:
self.ideal_yaw=GetYawToPoint();
ChangeYaw();
In case it is not in the latest RF, here is the code:
Code: Select all
//GetYawToPoint
case 130 :
{
geVec3d Pos, Orient, Play;
Play = CurrentPoint;
CCD->ActorManager()->GetPosition(Actor, &Pos);
geVec3d_Subtract(&Play, &Pos, &Orient);
float l = geVec3d_Length(&Orient);
if(l > 0.0f)
{
float x = Orient.X;
Orient.X = (float)( GE_PI*0.5 ) -
(float)acos(Orient.Y / l);
Orient.Y = (float)atan2(x , Orient.Z ) + GE_PI;
CCD->ActorManager()->GetRotate(Actor, &Pos);
while(Pos.Y<0.0f)
{
Pos.Y+=(GE_PI*2);
}
while(Pos.Y>=(GE_PI*2))
{
Pos.Y-=(GE_PI*2);
}
}
returnValue = Orient.Y;
return true;
}