File tree Expand file tree Collapse file tree 3 files changed +58
-2
lines changed
Expand file tree Collapse file tree 3 files changed +58
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) .
66
77
8+ ## [ Unreleased]
9+
10+ ### added
11+
12+ * Add a function to the ` ACubismMotion ` class that sets arbitrary data in the callback. by [ @MizunagiKB ] ( https://github.com/MizunagiKB )
13+
14+
815## [ 5-r.1-beta.1] - 2023-08-17
916
1017### Added
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ ACubismMotion::ACubismMotion()
2424 , _weight(1 .0f )
2525 , _offsetSeconds(0 .0f ) // 再生の開始時刻
2626 , _onFinishedMotion(NULL )
27+ , _onFinishedMotionCustomData(NULL )
2728{ }
2829
2930ACubismMotion::~ACubismMotion ()
@@ -151,6 +152,22 @@ ACubismMotion::FinishedMotionCallback ACubismMotion::GetFinishedMotionHandler()
151152 return this ->_onFinishedMotion ;
152153}
153154
155+ void ACubismMotion::SetFinishedMotionCustomData (void * onFinishedMotionCustomData)
156+ {
157+ this ->_onFinishedMotionCustomData = onFinishedMotionCustomData;
158+ }
159+
160+ void * ACubismMotion::GetFinishedMotionCustomData ()
161+ {
162+ return this ->_onFinishedMotionCustomData ;
163+ }
164+
165+ void ACubismMotion::SetFinishedMotionHandlerAndMotionCustomData (FinishedMotionCallback onFinishedMotionHandler, void * onFinishedMotionCustomData)
166+ {
167+ this ->_onFinishedMotion = onFinishedMotionHandler;
168+ this ->_onFinishedMotionCustomData = onFinishedMotionCustomData;
169+ }
170+
154171csmBool ACubismMotion::IsExistModelOpacity () const
155172{
156173 return false ;
Original file line number Diff line number Diff line change @@ -179,6 +179,38 @@ class ACubismMotion
179179 */
180180 FinishedMotionCallback GetFinishedMotionHandler ();
181181
182+ /* *
183+ * @brief ユーザー任意データの登録
184+ *
185+ * ユーザー任意データを登録します。
186+ *
187+ * @param[in] onFinishedMotionCustomData ユーザー任意データ
188+ */
189+ void SetFinishedMotionCustomData (void * onFinishedMotionCustomData);
190+
191+ /* *
192+ * @brief ユーザー任意データの取得
193+ *
194+ * ユーザー任意データを取得します。
195+ *
196+ * @return 登録されているユーザー任意データ。
197+ */
198+ void * GetFinishedMotionCustomData ();
199+
200+ /* *
201+ * @brief モーション再生終了コールバックとユーザー任意データの登録
202+ *
203+ * モーション再生終了コールバックを登録する。
204+ * IsFinishedフラグを設定するタイミングで呼び出される。
205+ * 以下の状態の際には呼び出されない:
206+ * 1. 再生中のモーションが「ループ」として設定されているとき
207+ * 2. コールバックにNULLが登録されているとき
208+ *
209+ * @param[in] onFinishedMotionHandler モーション再生終了コールバック関数
210+ * @param[in] onFinishedMotionCustomData ユーザー任意データ
211+ */
212+ void SetFinishedMotionHandlerAndMotionCustomData (FinishedMotionCallback onFinishedMotionHandler, void * onFinishedMotionCustomData);
213+
182214 /* *
183215 * @brief 透明度のカーブが存在するかどうかを確認する
184216 *
@@ -258,8 +290,8 @@ class ACubismMotion
258290
259291 csmVector<const csmString*> _firedEventValues;
260292
261- // モーション再生終了コールバック関数
262- FinishedMotionCallback _onFinishedMotion;
293+ FinishedMotionCallback _onFinishedMotion; // /< モーション再生終了コールバック関数ポインタ
294+ void * _onFinishedMotionCustomData; // /< モーション再生終了コールバックに戻されるデータ
263295};
264296
265297}}}
You can’t perform that action at this time.
0 commit comments