2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

yuzu: Make 3d cube with joycon shape

This commit is contained in:
Narr the Reg 2023-05-08 11:46:50 -06:00
parent 97bd6d6418
commit e1838f51a3

View file

@ -582,9 +582,9 @@ void PlayerControlPreview::DrawDualController(QPainter& p, const QPointF center)
using namespace Settings::NativeMotion; using namespace Settings::NativeMotion;
p.setPen(colors.outline); p.setPen(colors.outline);
p.setBrush(colors.transparent); p.setBrush(colors.transparent);
Draw3dCube(p, center + QPointF(-180, -5), Draw3dCube(p, center + QPointF(-180, 90),
motion_values[Settings::NativeMotion::MotionLeft].euler, 20.0f); motion_values[Settings::NativeMotion::MotionLeft].euler, 20.0f);
Draw3dCube(p, center + QPointF(180, -5), Draw3dCube(p, center + QPointF(180, 90),
motion_values[Settings::NativeMotion::MotionRight].euler, 20.0f); motion_values[Settings::NativeMotion::MotionRight].euler, 20.0f);
} }
@ -2926,14 +2926,14 @@ void PlayerControlPreview::DrawArrow(QPainter& p, const QPointF center, const Di
void PlayerControlPreview::Draw3dCube(QPainter& p, QPointF center, const Common::Vec3f& euler, void PlayerControlPreview::Draw3dCube(QPainter& p, QPointF center, const Common::Vec3f& euler,
float size) { float size) {
std::array<Common::Vec3f, 8> cube{ std::array<Common::Vec3f, 8> cube{
Common::Vec3f{-1, -1, -1}, Common::Vec3f{-0.7f, -1, -0.5f},
{-1, 1, -1}, {-0.7f, 1, -0.5f},
{1, 1, -1}, {0.7f, 1, -0.5f},
{1, -1, -1}, {0.7f, -1, -0.5f},
{-1, -1, 1}, {-0.7f, -1, 0.5f},
{-1, 1, 1}, {-0.7f, 1, 0.5f},
{1, 1, 1}, {0.7f, 1, 0.5f},
{1, -1, 1}, {0.7f, -1, 0.5f},
}; };
for (Common::Vec3f& point : cube) { for (Common::Vec3f& point : cube) {