Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

Handling camera rotation with extended GameThirdPersonCameraMode_Default

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Handling camera rotation with extended GameThirdPersonCameraMode_Default

    Ok, with the various options, I was able to get my camera to the right position and let it follow my character with nice interpolation.

    The problem I have and it may be related to core third person camera implementation, is that I cannot find a way to put the camera into stock rotation to get a clean RTS Isometric camera. If I try to override the rotations with the pawn calcCamera it will simply ignore basic defaultProperties.

    Here is my default camera extention :
    Code:
    class LumeThirdPersonCameraMode_Default extends GameThirdPersonCameraMode_Default;
    
    var float FOV;
    
    function float GetDesiredFOV( Pawn ViewedPawn )
    {
    	return FOV;
    }
    
    DefaultProperties
    {
    	FOV=90.f;
    	PawnRelativeOffset=(x=0,y=192,z=192)
    	bLockedToViewTarget=FALSE
    	bFollowTarget=TRUE
    	bInterpLocation=TRUE
    	bInterpRotation=TRUE
    	bSkipCameraCollision=TRUE
    	BlendTime=0.75
    }
    Now just like PawnRelativeOffset, is there a relativeRotation ?

  • #2
    I know that there probably is because you can set your relative rotation I believe if you do all this in Kismet.

    Comment


    • #3
      I am getting really tired of trying to put a simple overhead camera in UDK, might default to Kismet now, in Unity, it took 15 min. to code in javascript with Z axis zoom in/out and panning when cursor went near corners. Please if somebody has an answer I am really out of options, and since all the axises are messed up it does'nt really help me to get it right.

      I got a question, if I use kismet for initializing the camera and I stream the levels of my game, do I have to copy paste the OnLevelLoaded kismet code in all my level ?

      Comment


      • #4
        You don't need to use GameThirdPersonCamera class from GameFramework. Instead you need to implement your own camera, maybe extend it from GameBaseCamera. And then in yours PlayerCamera class in function FindBestCameraType you need to return your type of camera. Epics code don't have 'out of the box' RTS camera.

        Comment


        • #5
          Well thats what I feared I would have to do. The big problem with that is that we have absolutely no documentation except the code which is a bit hardcore to understand sometimes, especially when there is CPP declaration and we just have no clue as to what the functions does. Does someone knows about a tutorial that exist on the internet that I could use as a starting point ?

          Comment


          • #6
            Originally posted by ddelion View Post
            You don't need to use GameThirdPersonCamera class from GameFramework. Instead you need to implement your own camera, maybe extend it from GameBaseCamera. And then in yours PlayerCamera class in function FindBestCameraType you need to return your type of camera. Epics code don't have 'out of the box' RTS camera.
            Why would you do that? The ThirdPersonCamera already provided is excellent.

            All you have to do is overide the correct functions and you can make the camera do what ever you want.

            Comment


            • #7
              Originally posted by Chris2009 View Post
              Why would you do that? The ThirdPersonCamera already provided is excellent.

              All you have to do is overide the correct functions and you can make the camera do what ever you want.
              Do you know how to change the rotations with the defaultproperties then ?

              Comment


              • #8
                I really hope you figure this out as im looking for a similar approach and pretty much stuck in same boat as you.

                Comment


                • #9
                  Override this function in your playerController

                  Code:
                  class function UpdateRotation( float DeltaTime )
                  
                  Do rotation adjustment.......
                  set your cam to thirdperson

                  Comment


                  • #10
                    Originally posted by Chris2009 View Post
                    Override this function in your playerController

                    Code:
                    class function UpdateRotation( float DeltaTime )
                    
                    Do rotation adjustment.......
                    set your cam to thirdperson
                    ok here's the deal, it works, i simply copied the PlayerController UpdateRotation and added a few things as well as remove the delta for player inputs as I do not want the player to change the rotation at all :

                    Code:
                    function UpdateRotation( float DeltaTime )
                    {
                    	local Rotator	DeltaRot, newRotation, ViewRotation;
                    
                    	ViewRotation = Rotation;
                    	if (Pawn!=none)
                    	{
                    		Pawn.SetDesiredRotation(ViewRotation);
                    	}
                    
                    	//BEING EDIT-----
                    	// Calculate Delta to be applied on ViewRotation
                    	//DeltaRot.Yaw	= PlayerInput.aTurn;
                    	//DeltaRot.Pitch	= PlayerInput.aLookUp;
                    
                    	
                    	ViewRotation.Pitch = (-55.0f * DegToRad) * RadToUnrRot;
                    	ViewRotation.Yaw = (-45.0f * DegToRad) * RadToUnrRot;
                    	//END EDIT-----
                    	ProcessViewRotation( DeltaTime, ViewRotation, DeltaRot );
                    	SetRotation(ViewRotation);
                    
                    	ViewShake( deltaTime );
                    
                    	NewRotation = ViewRotation;
                    	NewRotation.Roll = Rotation.Roll;
                    
                    	if ( Pawn != None )
                    		Pawn.FaceRotation(NewRotation, deltatime);
                    }
                    The problem I am now facing is that the camera keeps bobbing up and down. Also I noticed drawing artifacts that maybe related to parralax shader ??

                    Here is the video :

                    http://www.youtube.com/watch?v=EsB_6PoIjIk

                    Any Idea what could cause that ?

                    Comment


                    • #11
                      Code:
                      	ViewRotation.Pitch = (-55.0f * DegToRad) * RadToUnrRot;
                      	ViewRotation.Yaw = (-45.0f * DegToRad) * RadToUnrRot;
                      This is the problem I think.

                      Unreal uses Unreal units or UU for short.

                      65535 uu = 360 degrees.

                      so if you want the rotation to be fixed just set the pitch and yaw to a number within this range.

                      example would be if you put the pitch to -16000 then the rotation would be directly above, facing down.

                      hope this helps

                      edit: Also i dont think you need to used this
                      Code:
                      NewRotation = ViewRotation;
                      NewRotation.Roll = Rotation.Roll;
                      try removing it.

                      Look at my example

                      http://www.moddb.com/members/plus1/v...udk-movement-3

                      Comment


                      • #12
                        Does your Game extends UTDeathmatch &&
                        Controller extends UTPlayerController &&
                        Pawn extends UTPawn ?

                        Comment


                        • #13
                          I just clicked on the bobbing issue, its the effect of the player walking. Though I do not know if it is supposed to be there in third person...

                          Comment


                          • #14
                            Ok I GOT IT WORKING !!!!!!!

                            I will write of a tutorial for it on my blog, it is definitly a first step in the right direction, next will be mouse inputs with raycasting on the floor. Its sad that you got it working and not me, but at the very least I know its doable, not that I had any doubts....

                            Comment


                            • #15
                              So how did you get it working?

                              Comment

                              Working...
                              X