Skip to content

Commit

Permalink
Feat: apply rotation on jumper
Browse files Browse the repository at this point in the history
  • Loading branch information
theminjunchoi committed Dec 12, 2022
1 parent 20911ff commit b14c138
Show file tree
Hide file tree
Showing 28 changed files with 31 additions and 33 deletions.
Binary file modified Debug/CLight.obj
Binary file not shown.
Binary file modified Debug/VirtualLego.bsc
Binary file not shown.
Binary file modified Debug/VirtualLego.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion Debug/VirtualLego.exe.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\Debug\VirtualLego.exe</FullPath>
<FullPath>C:\Users\mj043\Desktop\OOP-Proj4\Debug\VirtualLego.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
Expand Down
Binary file modified Debug/VirtualLego.ilk
Binary file not shown.
29 changes: 10 additions & 19 deletions Debug/VirtualLego.log
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
cl : 명령줄 warning D9035: 'Gm' 옵션은 더 이상 사용되지 않으므로 이후 릴리스에서 제거될 예정입니다.
DisplayText.cpp
C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\d3dUtility.h(23,1): warning C4005: 'INFINITY': 매크로 재정의
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(88): message : 'INFINITY'의 이전 정의를 참조하십시오.
C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\DisplayText.cpp(15,31): warning C4154: 배열 식을 삭제했습니다. 포인터로 변환이 제공됩니다.
C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\DisplayText.cpp(49,52): warning C4244: '인수': 'int'에서 'FLOAT'(으)로 변환하면서 데이터가 손실될 수 있습니다.
C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\DisplayText.cpp(52,77): warning C4305: '인수': '__int64'에서 'DWORD'(으)로 잘립니다.
C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\DisplayText.cpp(52,44): warning C4309: '인수': 상수 값이 잘립니다.
C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\DisplayText.cpp(55,48): warning C4244: '인수': 'int'에서 'FLOAT'(으)로 변환하면서 데이터가 손실될 수 있습니다.
C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\DisplayText.cpp(56,48): warning C4244: '인수': 'int'에서 'FLOAT'(으)로 변환하면서 데이터가 손실될 수 있습니다.
C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\DisplayText.cpp(57,48): warning C4244: '인수': 'int'에서 'FLOAT'(으)로 변환하면서 데이터가 손실될 수 있습니다.
C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\DisplayText.cpp(58,48): warning C4244: '인수': 'int'에서 'FLOAT'(으)로 변환하면서 데이터가 손실될 수 있습니다.
C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\DisplayText.cpp(61,79): warning C4244: '인수': 'int'에서 'FLOAT'(으)로 변환하면서 데이터가 손실될 수 있습니다.
C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\DisplayText.cpp(61,56): warning C4244: '인수': 'int'에서 'FLOAT'(으)로 변환하면서 데이터가 손실될 수 있습니다.
C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\DisplayText.cpp(62,79): warning C4244: '인수': 'int'에서 'FLOAT'(으)로 변환하면서 데이터가 손실될 수 있습니다.
C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\DisplayText.cpp(62,56): warning C4244: '인수': 'int'에서 'FLOAT'(으)로 변환하면서 데이터가 손실될 수 있습니다.
C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\DisplayText.cpp(65,79): warning C4244: '인수': 'int'에서 'FLOAT'(으)로 변환하면서 데이터가 손실될 수 있습니다.
C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\DisplayText.cpp(65,56): warning C4244: '인수': 'int'에서 'FLOAT'(으)로 변환하면서 데이터가 손실될 수 있습니다.
VirtualLego.vcxproj -> C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\Debug\VirtualLego.exe
cl : 명령줄 warning D9035: 'Gm' 옵션은 더 이상 사용되지 않으므로 이후 릴리스에서 제거될 예정입니다.
Jumper.cpp
C:\Users\mj043\Desktop\OOP-Proj4\d3dUtility.h(23,1): warning C4005: 'INFINITY': 매크로 재정의
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(88): message : 'INFINITY'의 이전 정의를 참조하십시오.
C:\Users\mj043\Desktop\OOP-Proj4\Jumper.cpp(101,30): warning C4305: '초기화 중': 'double'에서 'float'(으)로 잘립니다.
C:\Users\mj043\Desktop\OOP-Proj4\Jumper.cpp(119,14): warning C4244: '초기화 중': 'double'에서 'float'(으)로 변환하면서 데이터가 손실될 수 있습니다.
C:\Users\mj043\Desktop\OOP-Proj4\Jumper.cpp(120,41): warning C4244: '인수': 'double'에서 'FLOAT'(으)로 변환하면서 데이터가 손실될 수 있습니다.
C:\Users\mj043\Desktop\OOP-Proj4\Jumper.cpp(135,8): warning C4244: '=': 'double'에서 'float'(으)로 변환하면서 데이터가 손실될 수 있습니다.
C:\Users\mj043\Desktop\OOP-Proj4\Jumper.cpp(136,8): warning C4244: '=': 'double'에서 'float'(으)로 변환하면서 데이터가 손실될 수 있습니다.
VirtualLego.vcxproj -> C:\Users\mj043\Desktop\OOP-Proj4\Debug\VirtualLego.exe
Binary file modified Debug/VirtualLego.pdb
Binary file not shown.
Binary file modified Debug/VirtualLego.tlog/BscMake.command.1.tlog
Binary file not shown.
Binary file modified Debug/VirtualLego.tlog/CL.read.1.tlog
Binary file not shown.
Binary file modified Debug/VirtualLego.tlog/CL.write.1.tlog
Binary file not shown.
4 changes: 2 additions & 2 deletions Debug/VirtualLego.tlog/VirtualLego.lastbuildstate
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.33.31629:TargetPlatformVersion=10.0.22000.0:
Debug|Win32|C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\|
PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.31.31103:TargetPlatformVersion=10.0.19041.0:
Debug|Win32|C:\Users\mj043\Desktop\OOP-Proj4\|
Binary file modified Debug/VirtualLego.tlog/bscmake.read.1.tlog
Binary file not shown.
Binary file modified Debug/VirtualLego.tlog/bscmake.write.1.tlog
Binary file not shown.
Binary file modified Debug/VirtualLego.tlog/cl.command.1.tlog
Binary file not shown.
Binary file modified Debug/VirtualLego.tlog/link.command.1.tlog
Binary file not shown.
Binary file modified Debug/VirtualLego.tlog/link.read.1.tlog
Binary file not shown.
Binary file modified Debug/VirtualLego.tlog/link.write.1.tlog
Binary file not shown.
1 change: 1 addition & 0 deletions Debug/VirtualLego.vcxproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ C:\Users\김도엽\source\repos\Kredsya\OOP-Proj4\Debug\VirtualLego.exe
C:\Users\jimin\Desktop\repos\hyun-hang\OOP-Proj4\Debug\VirtualLego.exe
C:\Users\김도엽\source\repos\OOP-Proj4\Debug\VirtualLego.exe
C:\Users\mj043\Desktop\객체지향프로그래밍\소스코드\OOP-Proj4\Debug\VirtualLego.exe
C:\Users\mj043\Desktop\OOP-Proj4\Debug\VirtualLego.exe
Binary file modified Debug/d3dUtility.obj
Binary file not shown.
Binary file modified Debug/d3dfont.obj
Binary file not shown.
Binary file modified Debug/d3dutil.obj
Binary file not shown.
Binary file modified Debug/dxutil.obj
Binary file not shown.
Binary file modified Debug/status.obj
Binary file not shown.
Binary file modified Debug/vc143.idb
Binary file not shown.
Binary file modified Debug/vc143.pdb
Binary file not shown.
Binary file modified Debug/virtualLego.obj
Binary file not shown.
25 changes: 14 additions & 11 deletions Jumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Jumper::Jumper(void) {
m_pJumperMesh = NULL;
whereIdx = -1;
moveState = MOVESTATE::STOP;

D3DXMatrixIdentity(&this->boxRotate);
}

Jumper::Jumper(const char* jumperImageFileName) {
Expand Down Expand Up @@ -66,6 +68,9 @@ void Jumper::draw(IDirect3DDevice9* pDevice, const D3DXMATRIX& mWorld) {

pDevice->SetTransform(D3DTS_WORLD, &mWorld);
pDevice->MultiplyTransform(D3DTS_WORLD, &m_mLocal);

pDevice->MultiplyTransform(D3DTS_WORLD, &boxRotate);

pDevice->SetTexture(0, Tex);
pDevice->SetMaterial(&m_mtrl);
m_pJumperMesh->DrawSubset(0);
Expand All @@ -81,6 +86,7 @@ bool Jumper::hasIntersected(Platform& platform) {
double zDiff = (cord.z - JUMPERDEPTH / 2) - (platform_cord.z + PLATFORMDEPTH / 2);

double xBoundary = PLATFORMWIDTH / 2 + JUMPERWIDTH / 2;


if (-xBoundary < xDiff && xDiff < xBoundary) {
if (-PLATFORMDEPTH < zDiff && zDiff < 0) {
Expand All @@ -107,6 +113,14 @@ void Jumper::jumperUpdate(float timeDiff) {
float tX = cord.x + TIME_SCALE * timeDiff * v_x;
float tZ = cord.z + TIME_SCALE * timeDiff * v_z;
this->setPosition(tX, cord.y, tZ);

//D3DXMATRIX tmp;
D3DXVECTOR3 c(0, this->v_x, 0);
float force = sqrt(pow(this->v_x, 2));
D3DXMatrixRotationAxis(&tmp, &c, force * 0.018);
if (!this->isOnPlatform())
boxRotate *= tmp;

}

double Jumper::getVelocity_X() {
Expand Down Expand Up @@ -135,17 +149,6 @@ D3DXVECTOR3 Jumper::getPosition() const {
return org;
}

//void Jumper::adjustPosition(Jumper& jumper, Platform platform) {
// D3DXVECTOR3 jumper_cord = jumper.getPosition();
//
// this->setPosition((x + this->pre_x) / 2, y, (z + this->pre_z) / 2);
// jumper.setPosition((jumper_cord.x + jumper.pre_x) / 2, jumper_cord.y, (jumper_cord.z + jumper.pre_z) / 2);
// if (this->hasIntersected(platform))
// {
// this->setPosition(this->pre_x, y, this->pre_z);
// jumper.setPosition(jumper.pre_x, jumper_cord.y, jumper.pre_z);
// }
//}

void Jumper::setPosition(float x, float y, float z) {
D3DXMATRIX m;
Expand Down
3 changes: 3 additions & 0 deletions Jumper.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class Jumper {
D3DMATERIAL9 m_mtrl;
ID3DXMesh* m_pJumperMesh;

D3DXMATRIX boxRotate;
D3DXMATRIX tmp;

public:
Jumper(void);
Jumper(const char* jumperImageFileName);
Expand Down

0 comments on commit b14c138

Please sign in to comment.