Game Development Reference
In-Depth Information
This part is slightly different from what we've seen before. Rather than offer
the option of choosing to use the target's rotation or not, we're just declaring
that we will indeed use the target's (pawn's) rotation.
/** Force the camera to use the target's rotation */
/** Add the camera offset */
OutVT.POV.Rotation += CamOffsetRotation;
/** Math for the potential camera location */
PotentialCameraLocation = OutVT.POV.Location +
/** Draw a trace to see if the potential camera location will work
HitActor = Trace(HitLocation, HitNormal,
PotentialCameraLocation, OutVT.POV.Location, true,,,
/** Will the trace hit world geometry? If so then use the hit
location and offset it by the hit normal */
if (HitActor != None && HitActor.bWorldGeometry)
OutVT.POV.Location = HitLocation + HitNormal * 16.f;
OutVT.POV.Location = PotentialCameraLocation;
6. Our hardcoded values for our camera's offset and rotation will be defined in the class'
default properties, CamOffsetRotation=(Pitch=16384, Roll=0, Yaw=0) ,
which is the Unreal unity equivalent to 90 degrees.
/** Hardcoded vector & rotator values for our camera */
CamOffsetRotation=(Pitch=0, Roll=0, Yaw=0)
Search Nedrilad ::

Custom Search