void clTrajectoryPositioner::Update( float dt )
{
	/// Update time counter if required
	if ( FUpdateTime ) { FLocalTime += FSpeedFactor * dt; }

	if ( !FTrajectory ) { return; }

	float MaxT = GetMaxTime();
	float MinT = GetMinTime();

	if ( FTrajectory->FLoop )
	{
		while ( FLocalTime > MaxT )
		{
			FLocalTime -= ( MaxT - MinT );
		}

		while ( FLocalTime < MinT )
		{
			FLocalTime += ( MaxT - MinT );
		}
	}
	else
	{
		FLocalTime = Math::Clamp( FLocalTime, MinT, MaxT );
	}

	LVector3 Pos = FTrajectory->GetPositionForTime( FLocalTime );

	LQuaternion Q = FTrackTarget ?
	                LQuaternion( Math::LookAt( Pos, FStaticTarget, FUpVector ).ExtractMatrix3() ) :
	                FTrajectory->GetOrientationForTime( FLocalTime );

	FCurrentTransform = ComposeCameraTransformation( Pos, LMatrix4( Q.ToMatrix3() ) );
}
Exemplo n.º 2
0
bool
IgcReplay::update_time()
{
  const fixed t_simulation_last = t_simulation;

  t_simulation += fixed_one * TimeScale;
  t_simulation = std::max(GetMinTime(), t_simulation);

  return (t_simulation > t_simulation_last);
}
Exemplo n.º 3
0
void ChronoDrawTree::DrawTimeInterval(const Link* link, ostream& os, double x, double y, double xscale, double yscale)	{
	if (! link->Out()->isLeaf())	{
		if ((! onlygroups) || (groupname[link->Out()->GetNode()] != ""))	{
			if (link->isRoot())	{
				// cerr << GetDepth(GetRoot()) << '\t' << GetMinTime(GetRoot()) << '\t' << GetMaxTime(GetRoot()) << '\n';
			}
			double tmin = xscale * (GetDepth() - GetMinTime(link->Out()));
			double tmax = xscale * (GetDepth() - GetMaxTime(link->Out()));
			/*
			double tmin = xscale * (GetDepth(GetRoot()) - GetMinTime(link->Out()));
			double tmax = xscale * (GetDepth(GetRoot()) - GetMaxTime(link->Out()));
			*/
			double offset = 0.5 * barwidth;
			/*
			int color = 0;
			if (onlygroups)	{
				color = groupcolor[link->Out()->GetNode()];
			}
			*/
			int color = groupcolor[link->Out()->GetNode()];
			if (color == 0)	{
				os << "\\path [fill=blue,opacity=0.5,anchor=center] (" << texapprox(tmin) << ',' << texapprox(y-offset) << ") rectangle (" << texapprox(tmax) << ',' << texapprox(y+offset)  << ");\n";
			}
			else if (color == 1)	{
				offset *= 1.5;
				os << "\\path [fill=blue,opacity=0.6,anchor=center] (" << texapprox(tmin) << ',' << texapprox(y-offset) << ") rectangle (" << texapprox(tmax) << ',' << texapprox(y+offset)  << ");\n";
			}
			else if (color == 2)	{
				offset *= 1.5;
				os << "\\path [fill=orange,opacity=0.6,anchor=center] (" << texapprox(tmin) << ',' << texapprox(y-offset) << ") rectangle (" << texapprox(tmax) << ',' << texapprox(y+offset)  << ");\n";
			}
			else if (color == 3)	{
				offset *= 1.5;
				os << "\\path [fill=red,opacity=0.6,anchor=center] (" << texapprox(tmin) << ',' << texapprox(y-offset) << ") rectangle (" << texapprox(tmax) << ',' << texapprox(y+offset)  << ");\n";
			}
		}
	}
}
FText FBPProfilerStat::GetMinTimeText() const
{
	return FText::AsNumber(GetMinTime(), &SBlueprintProfilerView::GetNumberFormat());
}
void clTrajectoryPositioner::AddControlUI()
{
	FUpdateCheck = Env->GUI->AddPropertyCheck ( vec2( 0.02f, 0.85f ), vec2( 0.1f, 0.05f ), "Update time", this, "UpdateTime" );
	FTrackCheck = Env->GUI->AddPropertyCheck ( vec2( 0.3f, 0.85f ), vec2( 0.1f, 0.05f ), "Track target", this, "TrackTarget" );
	FSpeedSlider = Env->GUI->AddPropertySlider ( vec2( 0.02f, 0.90f ), vec2( 0.3f, 0.05f ), -128.0f, 128.0f, "Speed", this, "SpeedFactor" );
	FTimeSlider = Env->GUI->AddPropertySlider ( vec2( 0.02f, 0.95f ), vec2( 0.3f, 0.05f ), GetMinTime(), GetMaxTime(), "Time", this, "LocalTime" );
}