6 #include "VectorMath.h"
24 inline TextVertex CreateTextVertex(
float x,
float y,
float z,
float altitude,
float u,
float v,
float shadow)
30 vtx.altitude = altitude;
41 u8 altColor, pad0, pad1, pad2;
47 : x(x), y(y), u(u), v(v), altColor(altColor), pad0(0), pad1(0), pad2(255)
55 u8 altColor, pad0, pad1, pad2;
105 float x,y,z,lightDots;
141 inline ScreenTextVertex CreateScreenTextVertex(
float x,
float y,
float u,
float v,
float altColorParam)
143 const float uvScale = 65536.f;
145 u16 su =
static_cast<u16
>(Math::Clamp(static_cast<int>(u*uvScale), 0, 0xffff));
146 u16 sv =
static_cast<u16
>(Math::Clamp(static_cast<int>(v*uvScale), 0, 0xffff));
147 u8 altColor =
static_cast<u8
>(Math::Clamp(static_cast<int>(altColorParam*256.f), 0, 0xff));
151 inline WorldTextVertex CreateWorldTextVertex(
float x,
float y,
float z,
float u,
float v,
float altColorParam)
153 const float uvScale = 65536.f;
159 vtx.u =
static_cast<u16
>(Math::Clamp(static_cast<int>(u*uvScale), 0, 0xffff));
160 vtx.v =
static_cast<u16
>(Math::Clamp(static_cast<int>(v*uvScale), 0, 0xffff));
161 vtx.altColor =
static_cast<u8
>(Math::Clamp(static_cast<int>(altColorParam*256.f), 0, 0xff));
168 inline ColoredVertex CreateColoredVertex(
const v3& position,
const v4& color)
171 vert.x = position.GetX();
172 vert.y = position.GetY();
173 vert.z = position.GetZ();
175 vert.r = color.GetX();
176 vert.g = color.GetY();
177 vert.b = color.GetZ();
178 vert.a = color.GetW();
183 inline ColoredVertex CreateColoredVertex(
const v3& position,
const v3& color)
185 ColoredVertex vert = CreateColoredVertex(position, v4(color, 1.f));
189 inline TexturedColoredVertex CreateTexturedColoredVertex(
const v3& position,
const v2& uv,
const v4& color)
191 TexturedColoredVertex vert;
192 vert.x = position.GetX();
193 vert.y = position.GetY();
194 vert.z = position.GetZ();
199 vert.r = color.GetX();
200 vert.g = color.GetY();
201 vert.b = color.GetZ();
202 vert.a = color.GetW();
208 inline PositionVertex CreatePositionVertex(
float x,
float y,
float z)
217 inline PositionVertex CreatePositionVertex(
const Eegeo::v3& p)
219 return CreatePositionVertex(p.x, p.y, p.z);
222 inline TexturedVertex CreateTexturedVertex(
float x,
float y,
float z,
float u,
float v)
235 return CreateTexturedVertex(p.x, p.y, p.z, uv.x, uv.y);
243 inline Textured2DVertex CreateTextured2DVertex(
float x,
float y,
float u,
float v)
255 ModelDiffuseVertex vtx;