Skip to content

Commit

Permalink
Fixed Get2dPosition
Browse files Browse the repository at this point in the history
  • Loading branch information
Conarnar committed Jan 12, 2025
1 parent 4d204cd commit d79ed4d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/GcLib/directx/DxCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "DirectGraphics.hpp"
#include "DxUtility.hpp"
#include "DxScript.hpp"

using namespace directx;

Expand Down Expand Up @@ -146,14 +147,13 @@ D3DXVECTOR2 DxCamera::TransformCoordinateTo2D(D3DXVECTOR3 pos) {
D3DXVECTOR4 vect;
D3DXVec3Transform(&vect, &pos, &matViewProjection_);

/*
if (vect.w > 0) {
vect.x = width / 2.0f + (vect.x / vect.w) * width / 2.0f;
vect.y = height / 2.0f - (vect.y / vect.w) * height / 2.0f;
vect.y = height / 2.0f - (vect.y / vect.w) * height / 2.0f; // Y方向は上が正となるため
return D3DXVECTOR2(vect.x, vect.y);
}
*/

return D3DXVECTOR2(vect.x, vect.y);
return D3DXVECTOR2((FLOAT)DxScript::g_posInvalidX_, (FLOAT)DxScript::g_posInvalidY_);
}
void DxCamera::PushMatrixState() {
listMatrixState_.push_back(matViewProjection_);
Expand Down

0 comments on commit d79ed4d

Please sign in to comment.