teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

ソースコードの追加

2021/01/31 04:53

投稿

futon03
futon03

スコア33

title CHANGED
File without changes
body CHANGED
@@ -43,7 +43,7 @@
43
43
  //壁沿りベクトル
44
44
      //引数1 : プレイヤーの進行ベクトル(正面ベクトル)
45
45
  //引数2 : 壁の衝突時の法線ベクトル(CollisionOBB3D関数の7つ目の引数に設定した法線ベクトルを格納したもの)
46
- *GetModel()->GetPos() = GetCollision()->CalcWallScratchVector(GetModel()->vecForward, GetCollision()->Obj2_Normalvector);
46
+ *GetModel()->GetPos() += GetCollision()->CalcWallScratchVector(GetModel()->vecForward, GetCollision()->Obj2_Normalvector);
47
47
  }
48
48
  ```
49
49
 

1

ソースの修正

2021/01/31 04:53

投稿

futon03
futon03

スコア33

title CHANGED
File without changes
body CHANGED
@@ -17,12 +17,12 @@
17
17
 
18
18
  normal_n = GetMath()->Vector_Normalize(normal);//法線ベクトルを正規化
19
19
  //進行ベクトルの逆ベクトルと法線ベクトルの内積
20
- StaggeredNormal.x = -GetMath()->Dot3DX(front, normal_n);
20
+ StaggeredNormal.x = GetMath()->Dot3DX(-front, normal_n);
21
- StaggeredNormal.y = -GetMath()->Dot3DY(front, normal_n);
21
+ StaggeredNormal.y = GetMath()->Dot3DY(-front, normal_n);
22
- StaggeredNormal.z = -GetMath()->Dot3DZ(front, normal_n);
22
+ StaggeredNormal.z = GetMath()->Dot3DZ(-front, normal_n);
23
- out.x = front.x - StaggeredNormal.x;
23
+ out.x = front.x + StaggeredNormal.x * normal.x;
24
- out.y = front.y - StaggeredNormal.y;
24
+ out.y = front.y + StaggeredNormal.y * normal.y;
25
- out.z = front.z - StaggeredNormal.z;
25
+ out.z = front.z + StaggeredNormal.z * normal.z;
26
26
  return out;
27
27
  }
28
28
  ```
@@ -37,7 +37,7 @@
37
37
  GetFenceOutSide()->GetPosOBBNo1(),//壁の位置
38
38
  GetFenceOutSide()->GetSizeOBBNo1(),//壁の当たり判定のサイズ
39
39
  GetFenceOutSide()->GetRotOBBNo1(),//壁の向き
40
- &GetFenceOutSide()->GetFenceNormal[4]))//壁の法線ベクトル
40
+ &GetFenceOutSide()->GetFenceNormal[0]))//壁の法線ベクトル
41
41
  {
42
42
  PrintDebugProc("[FenceOutSideOBBHitPlayeOBB : No1 : Hit]\n");
43
43
  //壁沿りベクトル