mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-07 19:23:49 +03:00
Simplify footprint code
This commit is contained in:
parent
a3d063ec74
commit
030e096420
4 changed files with 50 additions and 55 deletions
|
@ -607,24 +607,24 @@ namespace TEN::Renderer
|
|||
for (auto i = footprints.begin(); i != footprints.end(); i++)
|
||||
{
|
||||
FOOTPRINT_STRUCT& footprint = *i;
|
||||
auto spriteIndex = Objects[ID_MISC_SPRITES].meshIndex + 1 + footprint.foot;
|
||||
auto spriteIndex = Objects[ID_MISC_SPRITES].meshIndex + 1 + (int)footprint.RightFoot;
|
||||
|
||||
if (footprint.active && g_Level.Sprites.size() > spriteIndex)
|
||||
if (footprint.Active && g_Level.Sprites.size() > spriteIndex)
|
||||
{
|
||||
Matrix rot = Matrix::CreateFromYawPitchRoll(TO_RAD(footprint.pos.yRot), TO_RAD(footprint.pos.xRot), TO_RAD(footprint.pos.zRot));
|
||||
Vector3 p1 = Vector3(-64, 0, -64);
|
||||
Vector3 p2 = Vector3(64, 0, -64);
|
||||
Vector3 p3 = Vector3(64, 0, 64);
|
||||
Vector3 p4 = Vector3(-64, 0, 64);
|
||||
Matrix rot = Matrix::CreateFromYawPitchRoll(footprint.Rotation.y, footprint.Rotation.x, footprint.Rotation.z);
|
||||
Vector3 p1 = Vector3( 64, 0, 64);
|
||||
Vector3 p2 = Vector3(-64, 0, 64);
|
||||
Vector3 p3 = Vector3(-64, 0, -64);
|
||||
Vector3 p4 = Vector3( 64, 0, -64);
|
||||
p1 = XMVector3Transform(p1, rot);
|
||||
p2 = XMVector3Transform(p2, rot);
|
||||
p3 = XMVector3Transform(p3, rot);
|
||||
p4 = XMVector3Transform(p4, rot);
|
||||
p1 += Vector3(footprint.pos.xPos, footprint.pos.yPos, footprint.pos.zPos);
|
||||
p2 += Vector3(footprint.pos.xPos, footprint.pos.yPos, footprint.pos.zPos);
|
||||
p3 += Vector3(footprint.pos.xPos, footprint.pos.yPos, footprint.pos.zPos);
|
||||
p4 += Vector3(footprint.pos.xPos, footprint.pos.yPos, footprint.pos.zPos);
|
||||
addSprite3D(&m_sprites[spriteIndex], p1, p2, p3, p4, Vector4(footprint.opacity / 255.0f, footprint.opacity / 255.0f, footprint.opacity / 255.0f, footprint.opacity / 255.0f), 0, 1, {1,1}, BLENDMODE_SUBTRACTIVE, view);
|
||||
p1 += Vector3(footprint.Position.x, footprint.Position.y, footprint.Position.z);
|
||||
p2 += Vector3(footprint.Position.x, footprint.Position.y, footprint.Position.z);
|
||||
p3 += Vector3(footprint.Position.x, footprint.Position.y, footprint.Position.z);
|
||||
p4 += Vector3(footprint.Position.x, footprint.Position.y, footprint.Position.z);
|
||||
addSprite3D(&m_sprites[spriteIndex], p1, p2, p3, p4, Vector4(footprint.Opacity), 0, 1, {1,1}, BLENDMODE_SUBTRACTIVE, view);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue