Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

Engine.CameraModifier


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
/**
 * Copyright 1998-2007 Epic Games, Inc. All Rights Reserved.
 */
class CameraModifier extends Object
    native;

/* Interface class for all camera modifiers applied to
    a player camera actor. Sub classes responsible for
    implementing declared functions.
*/

/* Do not apply this modifier */
var protected   bool    bDisabled;
/* This modifier is still being applied and will disable itself */
var             bool    bPendingDisable;

/** Camera this object is attached to */
var Camera  CameraOwner;


//debug
var(Debug) bool bDebug;

/** Allow anything to happen right after creation */
function Init();


/**
 * Directly modifies variables in the camera actor
 *
 * @param   Camera      reference to camera actor we are modifiying
 * @param   DeltaTime   Change in time since last update
 * @param   OutPOV      current Point of View, to be updated.
 * @return  bool        TRUE if should STOP looping the chain, FALSE otherwise
 */
function bool ModifyCamera
(
        Camera  Camera,
        float   DeltaTime,
    out TPOV    OutPOV
);


/**
 * Camera modifier evaluates itself vs the given camera's modifier list
 *  and decides whether to add itself or not
 *
 * @parma   Camera - reference to camera actor we want add this modifier to
 * @output  bool   - TRUE if modifier added to camera's modifier list, FALSE otherwise
 */
function bool AddCameraModifier( Camera Camera )
{
    //debug
    if (bDebug) LogInternal(self@"AddModifier"@Camera.ModifierList.Length);

    CameraOwner = Camera;

    // Default implementation adds self and always returns true
    Camera.ModifierList[Camera.ModifierList.Length] = self;
    return true;
}

/**
 * Camera modifier removes itself from given camera's modifier list
 *
 * @param   Camera  - reference to camara actor we want to remove this modifier from
 * @output  bool    - TRUE if modifier removed successfully, FALSE otherwise
 */
function bool RemoveCameraModifier( Camera Camera )
{
    local int ModifierIdx;

    //debug
    if (bDebug) LogInternal(self@"RemoveModifier");

    // Loop through each modifier in camera
    for( ModifierIdx = 0; ModifierIdx < Camera.ModifierList.Length; ModifierIdx++ )
    {
        // If we found ourselves, remove ourselves from the list and return
        if( Camera.ModifierList[ModifierIdx] == self )
        {
            Camera.ModifierList.Remove(ModifierIdx, 1);
            return true;
        }
    }

    // Didn't find ourselves in the list
    return false;
}

/** Accessor function to check if modifier is inactive */
simulated function bool IsDisabled()
{
    return bDisabled;
}

/** Accessor functions for changing disable flag */
function DisableModifier()
{
    //debug
    if (bDebug) LogInternal(self@"DisableModifier");

    bDisabled = true;
    bPendingDisable = false;
}
function EnableModifier()
{
    //debug
    if (bDebug) LogInternal(self@"EnableModifier");

    bDisabled = false;
    bPendingDisable = false;
}
function ToggleModifier()
{
    //debug
    if (bDebug) LogInternal(self@"ToggleModifier");

    if( bDisabled )
    {
        EnableModifier();
    }
    else
    {
        DisableModifier();
    }
}
/**
 * Allow this modifier a chance to change view rotation and deltarot
 * Default just returns ViewRotation unchanged
 * @return  bool - TRUE if should stop looping modifiers to adjust rotation, FALSE otherwise
 */
simulated function bool ProcessViewRotation( Actor ViewTarget, float DeltaTime, out Rotator out_ViewRotation, out Rotator out_DeltaRot );

defaultproperties
{
   Name="Default__CameraModifier"
   ObjectArchetype=Object'Core.Default__Object'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Thu 22/11/2007 16:01:50.000 - Creation time: Mon 26/11/2007 17:41:47.609 - Created with UnCodeX