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

Engine.MirrorCamera


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
class MirrorCamera extends GenericExternalCamera
    native;

var() private float MirrorOffset "How much the camera is allowed to move in relation to the player's view rotation.  Larger numbers look more realistic, but can clip into geometry";
var() private Shader    ReferenceShader "If set, allows extra effects to be applied to the Mirror scripted texture.  A copy of the reference shader will be made, and the Diffuse material of the new shader will be set to this mirror's scripted texture.";

var private const transient ScriptedTexture   MirrorTexture;      // Scripted Texture we render into
var private const transient TexScaler         MirrorScaler;       // TexScales that "mirrors" the scripted texture
var transient const Material                  MirrorMaterial;     // Material wrapper for any fancy effects, must wrap the mirror panner in some way

native function Initialize();

native static function ScriptedTexture CreateNewScriptedTexture(string InName);

cpptext
{
    UScriptedTexture* CreateScriptedTexture( const TCHAR* BaseName );
}

event PostBeginPlay()
{
    Super.PostBeginPlay(); // Will call our Initialize function, which doesn't settimer...
    SetTimer(1.0 / UpdateRate,true); // So we set it here.
}

simulated event Destroyed()
{
    if (MirrorTexture != None)
    {
        // prevent GC failure due to hanging actor refs
        MirrorTexture.Client = None;
    }

	Super.Destroyed();
}

simulated function Rotator GetViewRotation()
{
    return Rotation;
}

simulated function Vector GetViewLocation()
{
    local Vector X, Y, Z;
    local Vector EyeLocation, ToPlayer;
    local Actor ViewActor; // unused
    local Rotator EyeRotation; // unused

    Level.GetLocalPlayerController().PlayerCalcView(ViewActor, EyeLocation, EyeRotation);
    ToPlayer = EyeLocation - Location; 
    GetAxes(Rotator(ToPlayer), X, Y, Z);

    // Translate the location along the player's forward vector, capped by MirrorOffset....
    return Location + X * -Min(VSize(ToPlayer)/5.0f, MirrorOffset);
}

defaultproperties
{
    bHidden=true
    DrawScale=0.5
    MirrorOffset=20
    FOV=85
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: ne 5.9.2004 16:01:22.000 - Creation time: st 23.5.2018 00:10:45.651 - Created with UnCodeX