From fe9c9e8f987c128a88cb265ec65028a44460e931 Mon Sep 17 00:00:00 2001 From: escape209 Date: Thu, 1 Aug 2024 18:51:26 +0100 Subject: [PATCH] Match zLasso_InitTimer --- src/SB/Game/zLasso.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/SB/Game/zLasso.cpp b/src/SB/Game/zLasso.cpp index c46b508f9..f118774b4 100644 --- a/src/SB/Game/zLasso.cpp +++ b/src/SB/Game/zLasso.cpp @@ -1,3 +1,38 @@ #include "zLasso.h" +#include "iModel.h" + #include + +void zLasso_InitTimer(zLasso* lasso, F32 interpTime) +{ + lasso->secsTotal = interpTime; + lasso->secsLeft = interpTime; + + lasso->stRadius = lasso->tgRadius = lasso->crRadius = 0.0f; + lasso->stSlack = lasso->tgSlack = lasso->crSlack = 0.0f; + + iModelTagEval(lasso->model->Data, &lasso->tag, lasso->model->Mat, &lasso->crCenter); + + xVec3Copy(&lasso->anchor, (xVec3*)&lasso->model->Mat->pos); + xVec3SubFrom(&lasso->crCenter, &lasso->anchor); + xVec3Copy(&lasso->honda, &lasso->crCenter); + + lasso->currDist = lasso->lastDist = 0.0f; + + xVec3Init(&lasso->stNormal, 0, 1, 0); + xVec3Init(&lasso->tgNormal, 0, 1, 0); + xVec3Init(&lasso->crNormal, 0, 1, 0); + + xVec3Copy(&lasso->lastRefs[0], &lasso->crCenter); + xVec3Copy(&lasso->lastRefs[1], &lasso->crCenter); + xVec3Copy(&lasso->lastRefs[2], &lasso->crCenter); + xVec3Copy(&lasso->lastRefs[3], &lasso->crCenter); + xVec3Copy(&lasso->lastRefs[4], &lasso->crCenter); + + lasso->reindex[0] = 0; + lasso->reindex[1] = 1; + lasso->reindex[2] = 2; + lasso->reindex[3] = 3; + lasso->reindex[4] = 4; +} \ No newline at end of file