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

Engine.SkelControlLookAt


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
00141
00142
00143
00144
00145
00146
00147
class SkelControlLookAt extends SkelControlBase
	native(Anim);
	
/**
 * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
 *
 *	Controller that rotates a single bone to 'look at' a given target.
 */
 
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)

/** Position in world space that this bone is looking at. */
var(LookAt)		vector				TargetLocation;

/** Reference frame that TargetLocation is defined in. */
var(LookAt)		EBoneControlSpace	TargetLocationSpace;

/** Name of bone used if TargetLocationSpace is BCS_OtherBoneSpace. */
var(LookAt)		name				TargetSpaceBoneName;

/** Axis of the controlled bone that you wish to point at the TargetLocation. */
var(LookAt)		EAxis				LookAtAxis;

/** Whether to invert the LookAtAxis, so it points away from the TargetLocation. */
var(LookAt)		bool				bInvertLookAtAxis;

/** If you want to also define which axis should try to point 'up' (world +Z). */
var(LookAt)		bool				bDefineUpAxis;

/** Axis of bone to point upwards. Cannot be the same as LookAtAxis. */
var(LookAt)		EAxis				UpAxis;

/** Whether to invert the UpAxis, so it points down instead. */
var(LookAt)		bool				bInvertUpAxis;

/** Interpolation speed for TargetLocation to DesiredTargetLocation */
var(LookAt)		float				TargetLocationInterpSpeed;

/** Interpolation target for TargetLocation */
var				vector				DesiredTargetLocation;

/** If true, only allow a certain adjustment from the reference pose of the bone. */
var(Limit)		bool				bEnableLimit;
/** By default limit is based on ref pose of the character */
var(Limit)		bool				bLimitBasedOnRefPose;
/** Interp back to zero strength if limit surpassed */
var(Limit)		bool				bDisableBeyondLimit;
/** Call event to notify owner of limit break */
var(Limit)		bool				bNotifyBeyondLimit;

/** If true, draw a cone in the editor to indicate the maximum allowed movement of the bone. */
var(Limit)		bool				bShowLimit;

/** The maximum rotation applied from the reference pose of the bone, in degrees. */
var(Limit)		float				MaxAngle;

/** Allowed error between the current look direction and the desired look direction. */
var(Limit)		float				DeadZoneAngle;

/** Per rotation axis filtering */
var(Limit)		bool				bAllowRotationX;
var(Limit)		bool				bAllowRotationY;
var(Limit)		bool				bAllowRotationZ;
var(Limit)		EBoneControlSpace	AllowRotationSpace;
var(Limit)		Name				AllowRotationOtherBoneName;

/** LookAtAlpha allows to cancel head look when going beyond boundaries */
var const transient	float	LookAtAlpha;
var const transient float	LookAtAlphaTarget;
var const transient float	LookAtAlphaBlendTimeToGo;

/** internal, used to draw base orientation for limits */
var const transient Vector	LimitLookDir;
/** Internal, base look dir, without skel controller's influence. */
var const transient Vector	BaseLookDir;
/** Internal, base bone position in component space. */
var const transient Vector	BaseBonePos;
/** 
 * Keep track of when the controller was last calculated.
 * We need this to make sure BaseLookDir is accurate, when using CanLookAt().
 */
var const transient float	LastCalcTime;

function SetTargetLocation(Vector NewTargetLocation)
{
	DesiredTargetLocation = NewTargetLocation;

	// If control is not relevant, update TargetLocation right away, with no interpolation.
	if( ControlStrength * LookAtAlpha < 0.00001f )
	{
		TargetLocation = NewTargetLocation;
	}
}

simulated function InterpolateTargetLocation(float DeltaTime)
{
	TargetLocation = VInterpTo(TargetLocation, DesiredTargetLocation, DeltaTime, TargetLocationInterpSpeed);
}

/** 
 * Set LookAtAlpha. 
 * Allows the controller to blend in/out while still being processed.
 * CalculateNewBoneTransforms() is still called when ControllerStength > 0 and LookAtAlpha <= 0
 */
final native function SetLookAtAlpha(float DesiredAlpha, float DesiredBlendTime);

/** 
 * returns TRUE if PointLoc is within cone of vision of look at controller. 
 * This requires the mesh to be rendered, SpaceBases has to be up to date.
 * @param	PointLoc		Point in world space.
 * @param	bDrawDebugInfo	if true, debug information will be drawn on hud.
 */
final native function bool CanLookAtPoint(vector PointLoc, optional bool bDrawDebugInfo, optional bool bDebugUsePersistentLines, optional bool bDebugFlushLinesFirst);

defaultproperties
{
   LookAtAxis=AXIS_X
   UpAxis=AXIS_Z
   AllowRotationSpace=BCS_BoneSpace
   bLimitBasedOnRefPose=True
   bShowLimit=True
   bAllowRotationX=True
   bAllowRotationY=True
   bAllowRotationZ=True
   TargetLocationInterpSpeed=10.000000
   Name="Default__SkelControlLookAt"
   ObjectArchetype=SkelControlBase'Engine.Default__SkelControlBase'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: tr 31-1-2018 17:18:00.000 - Creation time: sk 18-3-2018 10:01:14.246 - Created with UnCodeX