fix door not closing all the way

fix auto uv generator
This commit is contained in:
James Lambert 2023-04-13 06:44:01 -06:00
parent c2bb0772f4
commit 0eb3a399a0
4 changed files with 24 additions and 16 deletions

View file

@ -125,6 +125,9 @@ Where `/home/james/Blender/blender-2.93.1-linux-x64` is the folder where Blender
- [x] Fast flying air whoosh sound
## Current Bug TODO List (Hardware Verified) (High->Low priority)
- [ ] fizzlers on new chambers
- [ ] investigate chell animation
----------------------- v8
- [ ] Player can clip through chamber 7 by walking back up the stairs (near the top).
- [ ] player can clip through back of elevator by jumping and strafeing at the back corners while inside.
- [ ] Player can trap themselves in chamber 5 by following instructions issue #75

View file

@ -34,26 +34,26 @@ bool MeshDefinitionGenerator::ShouldIncludeNode(aiNode* node) {
return node->mName.C_Str()[0] != '@' && node->mNumMeshes > 0;
}
double extractNumberValue(const std::string& nodeName, const std::string& label) {
std::size_t uvScaleAt = nodeName.find(" " + label + " ");
double extractNumberValue(const std::string& nodeName, const std::string& label, double def) {
std::size_t Attrat = nodeName.find(" " + label + " ");
if (uvScaleAt == std::string::npos) {
return 1.0;
if (Attrat == std::string::npos) {
return def;
}
std::size_t endUvScaleAt = uvScaleAt + label.length() + 2;
std::size_t spacePos = nodeName.find(" ", endUvScaleAt);
std::size_t endAttrat = Attrat + label.length() + 2;
std::size_t spacePos = nodeName.find(" ", endAttrat);
if (spacePos == std::string::npos) {
spacePos = nodeName.size();
}
std::string scale = nodeName.substr(endUvScaleAt, spacePos - endUvScaleAt);
std::string resultAsString = nodeName.substr(endAttrat, spacePos - endAttrat);
double result = atof(scale.c_str());
double result = atof(resultAsString.c_str());
if (result == 0.0) {
return 1.0f;
return def;
}
return result;
@ -93,14 +93,18 @@ void MeshDefinitionGenerator::AppendRenderChunks(const aiScene* scene, aiNode* n
if (extractMaterialAutoTileParameters(materialPtr, sTile, tTile)) {
std::string nodeName = node->mName.C_Str();
double uvScale = extractNumberValue(nodeName, "uvscale");
double uvScale = extractNumberValue(nodeName, "uvscale", 1.0f);
mesh->CubeProjectTex(
uvScale / (double)sTile,
uvScale / (double)tTile,
aiQuaternion(aiVector3D(1.0f, 0.0f, 0.0f), extractNumberValue(nodeName, "uvrotx") * (M_PI / 180.0f)) *
aiQuaternion(aiVector3D(0.0f, 1.0f, 0.0f), extractNumberValue(nodeName, "uvroty") * (M_PI / 180.0f)) *
aiQuaternion(aiVector3D(0.0f, 0.0f, 1.0f), extractNumberValue(nodeName, "uvrotz") * (M_PI / 180.0f)),
aiVector3D(extractNumberValue(nodeName, "uvtransx"), extractNumberValue(nodeName, "uvtransy"), extractNumberValue(nodeName, "uvtransz"))
aiQuaternion(aiVector3D(1.0f, 0.0f, 0.0f), extractNumberValue(nodeName, "uvrotx", 0.0f) * (M_PI / 180.0f)) *
aiQuaternion(aiVector3D(0.0f, 1.0f, 0.0f), extractNumberValue(nodeName, "uvroty", 0.0f) * (M_PI / 180.0f)) *
aiQuaternion(aiVector3D(0.0f, 0.0f, 1.0f), extractNumberValue(nodeName, "uvrotz", 0.0f) * (M_PI / 180.0f)),
aiVector3D(
extractNumberValue(nodeName, "uvtransx", 0.0f),
extractNumberValue(nodeName, "uvtransy", 0.0f),
extractNumberValue(nodeName, "uvtransz", 0.0f)
)
);
}

View file

@ -161,7 +161,7 @@ static void gameProc(void* arg) {
contactSolverInit(&gContactSolver);
portalSurfaceCleanupQueueInit();
savefileNew();
levelLoad(0);
levelLoad(2);
cutsceneRunnerReset();
controllersInit();
initAudio(fps);

View file

@ -190,7 +190,7 @@ void skAnimatorStep(struct SKAnimator* animator, float deltaTime) {
float duration = currentClip->nFrames / currentClip->fps;
if ((animator->currentTime >= duration && deltaTime) > 0.0f || (animator->currentTime < 0.0f && deltaTime < 0.0f)) {
if ((animator->currentTime >= duration && deltaTime > 0.0f) || (animator->currentTime < 0.0f && deltaTime < 0.0f)) {
if (animator->flags & SKAnimatorFlagsLoop) {
animator->currentTime = mathfMod(animator->currentTime, duration);
} else {
@ -246,6 +246,7 @@ void skAnimatorStep(struct SKAnimator* animator, float deltaTime) {
// only one frame is needed and is already present
animator->blendLerp = 1.0f;
animator->nextFrameStateIndex = existingNextFrame;
return;
}
if (existingNextFrame == 1) {