質問編集履歴

2

ソースコードの追加

2021/01/31 04:53

投稿

futon03
futon03

スコア33

test CHANGED
File without changes
test CHANGED
@@ -88,7 +88,7 @@
88
88
 
89
89
  //引数2 : 壁の衝突時の法線ベクトル(CollisionOBB3D関数の7つ目の引数に設定した法線ベクトルを格納したもの)
90
90
 
91
- *GetModel()->GetPos() = GetCollision()->CalcWallScratchVector(GetModel()->vecForward, GetCollision()->Obj2_Normalvector);
91
+ *GetModel()->GetPos() += GetCollision()->CalcWallScratchVector(GetModel()->vecForward, GetCollision()->Obj2_Normalvector);
92
92
 
93
93
  }
94
94
 

1

ソースの修正

2021/01/31 04:53

投稿

futon03
futon03

スコア33

test CHANGED
File without changes
test CHANGED
@@ -36,17 +36,17 @@
36
36
 
37
37
  //進行ベクトルの逆ベクトルと法線ベクトルの内積
38
38
 
39
- StaggeredNormal.x = -GetMath()->Dot3DX(front, normal_n);
39
+ StaggeredNormal.x = GetMath()->Dot3DX(-front, normal_n);
40
40
 
41
- StaggeredNormal.y = -GetMath()->Dot3DY(front, normal_n);
41
+ StaggeredNormal.y = GetMath()->Dot3DY(-front, normal_n);
42
42
 
43
- StaggeredNormal.z = -GetMath()->Dot3DZ(front, normal_n);
43
+ StaggeredNormal.z = GetMath()->Dot3DZ(-front, normal_n);
44
44
 
45
- out.x = front.x - StaggeredNormal.x;
45
+ out.x = front.x + StaggeredNormal.x * normal.x;
46
46
 
47
- out.y = front.y - StaggeredNormal.y;
47
+ out.y = front.y + StaggeredNormal.y * normal.y;
48
48
 
49
- out.z = front.z - StaggeredNormal.z;
49
+ out.z = front.z + StaggeredNormal.z * normal.z;
50
50
 
51
51
  return out;
52
52
 
@@ -76,7 +76,7 @@
76
76
 
77
77
  GetFenceOutSide()->GetRotOBBNo1(),//壁の向き
78
78
 
79
- &GetFenceOutSide()->GetFenceNormal[4]))//壁の法線ベクトル
79
+ &GetFenceOutSide()->GetFenceNormal[0]))//壁の法線ベクトル
80
80
 
81
81
  {
82
82