Changeset View
Changeset View
Standalone View
Standalone View
0ad/source/simulation2/helpers/Render.cpp
Show First 20 Lines • Show All 597 Lines • ▼ Show 20 Lines | void SimRender::SubdividePoints(std::vector<CVector2D>& points, float maxSegmentLength, bool closed) | ||||
} | } | ||||
points.swap(newPoints); | points.swap(newPoints); | ||||
} | } | ||||
void SimRender::ConstructTexturedLineBox(SOverlayTexturedLine& overlay, const CVector2D& origin, | void SimRender::ConstructTexturedLineBox(SOverlayTexturedLine& overlay, const CVector2D& origin, | ||||
const CFixedVector3D& rotation, const float sizeX, const float sizeZ) | const CFixedVector3D& rotation, const float sizeX, const float sizeZ) | ||||
{ | { | ||||
float s = sinf(-rotation.Y.ToFloat()); | float s = sinf(-rotation.getY().ToFloat()); | ||||
float c = cosf(-rotation.Y.ToFloat()); | float c = cosf(-rotation.getY().ToFloat()); | ||||
CVector2D unitX(c, s); | CVector2D unitX(c, s); | ||||
CVector2D unitZ(-s, c); | CVector2D unitZ(-s, c); | ||||
// Add half the line thickness to the radius so that we get an 'outside' stroke of the footprint shape | // Add half the line thickness to the radius so that we get an 'outside' stroke of the footprint shape | ||||
const float halfSizeX = sizeX / 2.f + overlay.m_Thickness / 2.f; | const float halfSizeX = sizeX / 2.f + overlay.m_Thickness / 2.f; | ||||
const float halfSizeZ = sizeZ / 2.f + overlay.m_Thickness / 2.f; | const float halfSizeZ = sizeZ / 2.f + overlay.m_Thickness / 2.f; | ||||
Show All 24 Lines |
Wildfire Games · Phabricator