• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Violet Vreath is Shooter Game for Windows XP+(個人制作シューティングゲーム)


Commit MetaInfo

Revision54af9b96447af94038036aa656d937a30395f4d0 (tree)
Time2023-10-03 21:19:34
Authorgecchi <gecchi@boch...>
Commitergecchi

Log Message

平均すると先がへにょる、平均しないとぎざぎざになる、困った;;

Change Summary

Incremental Difference

--- a/GgafDx/include/jp/ggaf/dx/util/Util.h
+++ b/GgafDx/include/jp/ggaf/dx/util/Util.h
@@ -583,10 +583,10 @@ public:
583583 * @param out_nvx
584584 * @param out_nvy
585585 */
586- static void getNormalizedVector(double x,
587- double y,
588- double& out_nvx,
589- double& out_nvy) {
586+ static void getNormalized2DVector(double x,
587+ double y,
588+ double& out_nvx,
589+ double& out_nvy) {
590590 const double t = 1.0 / sqrt(x * x + y * y);
591591 out_nvx = t * x;
592592 out_nvy = t * y;
@@ -599,10 +599,10 @@ public:
599599 * @param out_nvx
600600 * @param out_nvy
601601 */
602- static void getNormalizedVector(coord x,
603- coord y,
604- double& out_nvx,
605- double& out_nvy ) {
602+ static void getNormalized2DVector(coord x,
603+ coord y,
604+ double& out_nvx,
605+ double& out_nvy ) {
606606 const double vx = (double)(x * (1.0 / (LEN_UNIT * PX_UNIT)));
607607 const double vy = (double)(y * (1.0 / (LEN_UNIT * PX_UNIT)));
608608 const double t = 1.0 / sqrt(vx * vx + vy * vy);
--- a/GgafLib/src/jp/ggaf/lib/util/Direction8Util.cpp
+++ b/GgafLib/src/jp/ggaf/lib/util/Direction8Util.cpp
@@ -94,7 +94,7 @@ void Direction8Util::cnvVec2Sgn(float prm_vx, float prm_vy,
9494 static const double v = 0.9238795325112;
9595
9696 double nvx, nvy;
97- UTIL::getNormalizedVector(prm_vx, prm_vy,
97+ UTIL::getNormalized2DVector(prm_vx, prm_vy,
9898 nvx, nvy);
9999
100100 //
--- a/VioletVreath/src/jp/gecchi/VioletVreath/actor/my/Bunshin/MyBunshinBase.cpp
+++ b/VioletVreath/src/jp/gecchi/VioletVreath/actor/my/Bunshin/MyBunshinBase.cpp
@@ -560,7 +560,7 @@ void MyBunshinBase::setBunshinNum(int prm_num) {
560560 }
561561 }
562562
563- const angvelo INNER_ROT = D_ANG(0.5); //分身がぐるぐる旋回している速度
563+ const angvelo INNER_ROT = D_ANG(1); //分身がぐるぐる旋回している速度
564564 const angvelo OUTER_ROT = -D_ANG(1);
565565 const coord INNER_RADIUS = PX_C(50); //内側分身の中心からの距離
566566 const coord OUTER_RADIUS = PX_C(120); //外側分身の中心からの距離
--- a/VioletVreath/src/jp/gecchi/VioletVreath/actor/my/Bunshin/MyBunshinWateringLaserChip001.cpp
+++ b/VioletVreath/src/jp/gecchi/VioletVreath/actor/my/Bunshin/MyBunshinWateringLaserChip001.cpp
@@ -24,7 +24,7 @@ using namespace GgafLib;
2424 using namespace VioletVreath;
2525
2626 const velo MyBunshinWateringLaserChip001::MAX_VELO = PX_C(512); //この値を大きくすると、最高速度が早くなる。
27-const int MyBunshinWateringLaserChip001::R_MAX_ACCE = 20; //MAX_VELO に対する加速度、この値を大きくすると、カーブが緩くなる。小さくすると、カーブがきつくなるがギザギザになりやすい
27+const int MyBunshinWateringLaserChip001::R_MAX_ACCE = 25; //MAX_VELO に対する加速度、この値を大きくすると、カーブが緩くなる。小さくすると、カーブがきつくなるがギザギザになりやすい
2828 const velo MyBunshinWateringLaserChip001::INITIAL_VELO = MAX_VELO*0.6; //レーザー発射時の初期速度
2929 const acce MyBunshinWateringLaserChip001::MAX_ACCE_RENGE = MAX_VELO/R_MAX_ACCE;
3030 const velo MyBunshinWateringLaserChip001::MIN_VELO_ = MyBunshinWateringLaserChip001::INITIAL_VELO/2; // ÷2 は、最低移動する各軸のINITIAL_VELOの割合
@@ -363,17 +363,25 @@ throwCriticalException("pLeaderChip_AimInfo_
363363 //なぜなら dispatch の瞬間に_pChip_behind != nullptr となるが、active()により有効になるのは次フレームだから
364364 //_x,_y,_z にはまだ変な値が入っている。
365365 if (pB && pB->isActive()) {
366- if (_dispatch_index == 0) { //N_DISPATCH_AT_ONCE の節目が角張るので平均化を強くした
367- _x = _x + (coord)((pB->_x-_x)*0.4 + (pF->_x-_x)*0.5);
368- _y = _y + (coord)((pB->_y-_y)*0.4 + (pF->_y-_y)*0.5);
369- _z = _z + (coord)((pB->_z-_z)*0.4 + (pF->_z-_z)*0.5);
370- } else {
371- //中間座標に再設定
372- //座標の重みは、(ひとつ前, 自身, 一つ先)= (0.2, 0.3, 0.4)
373- _x = _x + (coord)((pB->_x-_x)*0.2 + (pF->_x-_x)*0.4);
374- _y = _y + (coord)((pB->_y-_y)*0.2 + (pF->_y-_y)*0.4);
375- _z = _z + (coord)((pB->_z-_z)*0.2 + (pF->_z-_z)*0.4);
376- }
366+// if (_dispatch_index == 0) { //N_DISPATCH_AT_ONCE の節目が角張るので平均化を強くした
367+// _x = _x + (coord)((pB->_x-_x)*0.4 + (pF->_x-_x)*0.5);
368+// _y = _y + (coord)((pB->_y-_y)*0.4 + (pF->_y-_y)*0.5);
369+// _z = _z + (coord)((pB->_z-_z)*0.4 + (pF->_z-_z)*0.5);
370+// } else {
371+// //中間座標に再設定
372+// //座標の重みは、(ひとつ前, 自身, 一つ先)= (0.2, 0.3, 0.4)
373+// _x = _x + (coord)((pB->_x-_x)*0.2 + (pF->_x-_x)*0.4);
374+// _y = _y + (coord)((pB->_y-_y)*0.2 + (pF->_y-_y)*0.4);
375+// _z = _z + (coord)((pB->_z-_z)*0.2 + (pF->_z-_z)*0.4);
376+// }
377+
378+ _x = (pB->_x + _x + pF->_x) / 3;
379+ _y = (pB->_y + _y + pF->_y) / 3;
380+ _z = (pB->_z + _z + pF->_z) / 3;
381+
382+
383+ //TODO:平均すると先がへにょる
384+ //TODO:平均しないとぎざぎざになる
377385
378386 //速度ベクトルも平均化してギザギザ対策
379387 // GgafDx::NaviVehicle* pF_pNaviVehicle = pF->getNaviVehicle();
@@ -384,8 +392,12 @@ throwCriticalException("pLeaderChip_AimInfo_
384392 // pNaviVehicle->_velo_vc_z = pNaviVehicle->_velo_vc_z + (velo)((pB_pNaviVehicle->_velo_vc_z - pNaviVehicle->_velo_vc_z)*0.2 + (pF_pNaviVehicle->_velo_vc_z - pNaviVehicle->_velo_vc_z)*0.4);
385393 // pNaviVehicle->_velo = pNaviVehicle->_velo + (velo)((pB_pNaviVehicle->_velo - pNaviVehicle->_velo)*0.2 + (pF_pNaviVehicle->_velo - pNaviVehicle->_velo)*0.4);
386394 // }
395+ GgafDx::NaviVehicle* pF_pNaviVehicle = pF->getNaviVehicle();
396+ if (pNaviVehicle->_velo > 0 && pF_pNaviVehicle->_velo > 0 ) {
387397
388398
399+ }
400+
389401
390402 } else {
391403 //レーザー末尾処理
--- a/VioletVreath/src/jp/gecchi/VioletVreath/actor/my/MyShip.h
+++ b/VioletVreath/src/jp/gecchi/VioletVreath/actor/my/MyShip.h
@@ -32,7 +32,7 @@ namespace VioletVreath {
3232
3333
3434 /** レーザーの同時dispatch数 */
35-#define N_DISPATCH_AT_ONCE (3)
35+#define N_DISPATCH_AT_ONCE (2)
3636 /**
3737 * 自機クラス
3838 * @version 1.00
--- a/VioletVreath_launcher/TODO.txt
+++ b/VioletVreath_launcher/TODO.txt
@@ -29,5 +29,9 @@ onDispatch() コールバック共通化
2929 現在の速度が多少ブレても、加速度ベクトルがブレないようにすればよいのでは?
3030 *8 を *2にしてみてはどうか?
3131 逆に *8 を *30 にしてみてはどうか?
32+BUSHINを止めてみる
33+N_DISPATCH_AT_ONCE が 1 で 分身を回さない場合はギザギザはおきない
34+N_DISPATCH_AT_ONCE が 1 で 分身を回すとギザギザ(の元)が起きる
35+N_DISPATCH_AT_ONCE が 3 で 分身を回さない場合はギザギザはおきない
36+つまりギザギザの原因は分身を回す(=向きから角度の精度が甘い)
3237
33-レーザーの先がふにゃる。