mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-15 01:24:35 +02:00
#3 fix frame bbox calculation in air
This commit is contained in:
BIN
bin/OpenLara.exe
BIN
bin/OpenLara.exe
Binary file not shown.
@@ -955,7 +955,7 @@ struct Lara : Controller {
|
|||||||
break;
|
break;
|
||||||
case STAND_AIR : {
|
case STAND_AIR : {
|
||||||
int fSize = sizeof(TR::AnimFrame) + getModel().mCount * sizeof(uint16) * 2;
|
int fSize = sizeof(TR::AnimFrame) + getModel().mCount * sizeof(uint16) * 2;
|
||||||
TR::AnimFrame *frame = (TR::AnimFrame*)&level->frameData[(anim->frameOffset + (int(animTime * 30.0f / anim->frameRate) * fSize) / 2)];
|
TR::AnimFrame *frame = (TR::AnimFrame*)&level->frameData[((anim->frameOffset + (int(animTime * 30.0f / anim->frameRate) * fSize)) >> 1)];
|
||||||
|
|
||||||
f = info.floor - (p.y + frame->box.maxY);
|
f = info.floor - (p.y + frame->box.maxY);
|
||||||
c = (p.y + frame->box.minY) - info.ceiling;
|
c = (p.y + frame->box.minY) - info.ceiling;
|
||||||
|
@@ -618,7 +618,7 @@ struct Level {
|
|||||||
// Debug::Level::rooms(level, lara->pos, lara->getEntity().room);
|
// Debug::Level::rooms(level, lara->pos, lara->getEntity().room);
|
||||||
// Debug::Level::lights(level);
|
// Debug::Level::lights(level);
|
||||||
// Debug::Level::portals(level);
|
// Debug::Level::portals(level);
|
||||||
// Debug::Level::meshes(level);
|
Debug::Level::meshes(level);
|
||||||
// Debug::Level::entities(level);
|
// Debug::Level::entities(level);
|
||||||
Debug::Level::info(level, lara->getEntity(), (int)lara->state, lara->animIndex, int(lara->animTime * 30.0f));
|
Debug::Level::info(level, lara->getEntity(), (int)lara->state, lara->animIndex, int(lara->animTime * 30.0f));
|
||||||
Debug::end();
|
Debug::end();
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
<span id="status">Starting...</span>
|
<span id="status">Starting...</span>
|
||||||
<input type="button" value="fullscreen" onclick="Module.requestFullScreen(false, true)"><br><br>
|
<input type="button" value="fullscreen" onclick="Module.requestFullScreen(false, true)"><br><br>
|
||||||
<canvas id="canvas" width="160" height="120" oncontextmenu="event.preventDefault()"></canvas><br>
|
<canvas id="canvas" width="160" height="120" oncontextmenu="event.preventDefault()"></canvas><br>
|
||||||
<span id="info"><a target="_blank" href="https://github.com/XProger/OpenLara">OpenLara on github</a></span>
|
<span id="info"><a target="_blank" href="https://github.com/XProger/OpenLara">OpenLara on github</a><br>(controls: move - WASD, jump - Space, action - E/MouseL, walk - Shift, camera - MouseR)</span>
|
||||||
|
|
||||||
<script type='text/javascript'>
|
<script type='text/javascript'>
|
||||||
var statusElement = document.getElementById('status');
|
var statusElement = document.getElementById('status');
|
||||||
|
Reference in New Issue
Block a user