News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 26th Jun 2004, 12:51 AM   #1
dataangel
Registered User
 
Join Date: Apr. 11th, 2004
Posts: 184
Rotation Deobfuscation?

Sometimes in my mod I want my pawn's rotation to not be affected by the player's view (this is a 3rd person mod), and other times I want it to be. This is proving to be alot more difficult than it should be.

The only way I can change rotation is by either direct calls to SetRotation or calling Controller.SetViewRotation. I can't get DesiredRotation to work at all.

Changing the Yaw to be += 16384 (90 degrees) with Controller.SetViewRotation() rotates the view and the pawn, as I would expect. But changing the Roll just resets the view to the default, and changing the pitch always makes the camera go right under the pawn looking straight up at his crotch (even with LimitPitch overridden).

Why don't xPawns seem to respond to DesiredRotation? The description in Actor.uc says that the physics will automatically rotate the actor to DesiredRotation, but this doesn't happen. At first I thought this was because I wasn't rotating the controller, but setting the controller DesiredRotation to the same value at the same time still does not work. bRotateToDesired is true for both pawn and controller. Setting bSetTurnRot for the controller to true doesn't work either.

Another theory -- since it seems DesiredRotation is applied in native physics code, I thought maybe pawn's were specially exempted. But if you look in xPawn.uc there's a function called RandSpin() defined that uses DesiredRotation -- although calling it does nothing. It's also not called in any of xPawn's subclasses. I thought maybe it would be called in native code for ragdolls -- but why do that when all the other ragdoll stuff is in script? :P

More checking -- no states defined in pawn.uc, xpawn.uc, controller.uc, playercontroller.uc, or xplayer.uc ignore DesiredRotation.

At this point it looks like the only way to get my own smooth rotation is by calling SetRotation by the tick -- which would be a pain, and would have to take into account stuff like one desired rotation one tick and a different one the next tick :P

Any ideas on how to get DesiredRotation to work for pawns? Or a simpler way to get smooth rotation?

P.S. I'm testing all of this by using an exec function and binding a key to it. And yes I've used logs to make sure it's running =)

Last edited by dataangel; 26th Jun 2004 at 12:53 AM.
dataangel is offline   Reply With Quote
Old 16th Sep 2005, 03:28 AM   #2
Orione
Registered User
 
Join Date: Nov. 15th, 2004
Posts: 31
I know this message is a quite old, but solution can anyway be useful to someone else at least:

from the wiki:
PHYS_Rotating
Only rotation changes. Location doesn't change. If bRotateToDesired is false, then the Actor rotates according to RotationRate. If bRotateToDesired is true, then the Actor rotates to the rotation specified by DesiredRotation at the speed specified by RotationRate.

So to make Actors to rotate to DesiredRotation you have not only to set bRotateToDesired to true, but also to set a RotationRate value
Orione is offline   Reply With Quote
Old 16th Sep 2005, 06:15 AM   #3
Orione
Registered User
 
Join Date: Nov. 15th, 2004
Posts: 31
Actually I'm stucked on event EndedRotation():
From the wiki: Called when an actor's rotation has reached DesiredRotation?

I'd want to move an Actor just as it finishes to rotate, but it seems not to enter this event body.

an alternative solution could be to check every 0.1 seconds if rotation is completed, comparing actual Actor's rotation and target one, but I'd prefer to use the event.

So if anyone could make more light in this topic hints are well accepted.
Orione
Orione is offline   Reply With Quote
Old 16th Sep 2005, 09:02 AM   #4
Orione
Registered User
 
Join Date: Nov. 15th, 2004
Posts: 31
EndedRotation() is a probe function, so it can be Enabled/Disabled
So I tried to Enable('EndedRotation'), but it still seems not to be executed even if my Actor stops rotating when it reaches the correct direction
Orione is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:31 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer