Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/CinemaManager.cpp
Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | void CCinemaManager::DrawSpline(const RNSpline& spline, const CColor& splineColor, int smoothness) const | ||||
for (int i = 0; i <= smoothness; ++i) | for (int i = 0; i <= smoothness; ++i) | ||||
{ | { | ||||
const float time = start * i / spline.MaxDistance.ToFloat(); | const float time = start * i / spline.MaxDistance.ToFloat(); | ||||
line.emplace_back(spline.GetPosition(time)); | line.emplace_back(spline.GetPosition(time)); | ||||
} | } | ||||
g_Renderer.GetDebugRenderer().DrawLine(line, splineColor, 0.2f, false); | g_Renderer.GetDebugRenderer().DrawLine(line, splineColor, 0.2f, false); | ||||
// Height indicator | // Height indicator | ||||
if (g_Game && g_Game->GetWorld() && g_Game->GetWorld()->GetTerrain()) | if (g_Game && g_Game->GetWorld()) | ||||
{ | { | ||||
for (int i = 0; i <= smoothness; ++i) | for (int i = 0; i <= smoothness; ++i) | ||||
{ | { | ||||
const float time = start * i / spline.MaxDistance.ToFloat(); | const float time = start * i / spline.MaxDistance.ToFloat(); | ||||
const CVector3D tmp = spline.GetPosition(time); | const CVector3D tmp = spline.GetPosition(time); | ||||
const float groundY = g_Game->GetWorld()->GetTerrain()->GetExactGroundLevel(tmp.X, tmp.Z); | const float groundY = g_Game->GetWorld()->GetTerrain().GetExactGroundLevel(tmp.X, tmp.Z); | ||||
g_Renderer.GetDebugRenderer().DrawLine(tmp, CVector3D(tmp.X, groundY, tmp.Z), splineColor, 0.1f, false); | g_Renderer.GetDebugRenderer().DrawLine(tmp, CVector3D(tmp.X, groundY, tmp.Z), splineColor, 0.1f, false); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
void CCinemaManager::DrawNodes(const RNSpline& spline, const CColor& nodeColor) const | void CCinemaManager::DrawNodes(const RNSpline& spline, const CColor& nodeColor) const | ||||
{ | { | ||||
for (const SplineData& node : spline.GetAllNodes()) | for (const SplineData& node : spline.GetAllNodes()) | ||||
Show All 27 Lines |
Wildfire Games · Phabricator