And how come no smoothness in the movement? It'd be very easy to add, just like this:
Global gMXSpeed#,gMYSpeed#,gMSpeed#
;; It's your job to reposition the mouse each frame if you so desire to.
Function SmoothTurn(Entity,PitchMax#=80)
gMXSpeed = gMXSpeed*.9 - MouseXSpeed()*.2
gMYSpeed = gMYSpeed*.9 + MouseYSpeed()*.2
AX# = EntityPitch(Entity)
AY# = EntityYaw(Entity)
AX = AX + gMYSpeed
AY = AY + gMXSpeed
PitchMax = Abs(PitchMax)
If Abs(AX) > PitchMax Then
If AX < 0 Then
AX = -PitchMax
Else
AX = PitchMax
EndIf
EndIf
RotateEntity Entity, AX, AY, 0 ;; ROLL == BAD
End Function
In any case, it's cool that you're sharing.
|