Merge branch 'develop' into develop_mirrors

This commit is contained in:
Lwmte 2024-12-24 20:07:53 +01:00
commit 63ffb77bd6
3 changed files with 9 additions and 11 deletions

View file

@ -122,7 +122,7 @@
<td class="summary">Ammo used.</td>
</tr>
<tr>
<td class="name" ><a href="#traveledDistance">traveledDistance</a></td>
<td class="name" ><a href="#distanceTraveled">distanceTraveled</a></td>
<td class="summary">Distance traveled.</td>
</tr>
<tr>
@ -197,8 +197,8 @@
</dd>
<dt>
<a name = "traveledDistance"></a>
<strong>traveledDistance</strong>
<a name = "distanceTraveled"></a>
<strong>distanceTraveled</strong>
</dt>
<dd>
Distance traveled.
@ -206,7 +206,7 @@
<ul>
<li><span class="parameter">traveledDistance</span>
<li><span class="parameter">distanceTraveled</span>
<span class="types"><span class="type">int</span></span>
amount of traveled distance in world units. One meter is 420 world units.
</li>

View file

@ -330,6 +330,8 @@ void TestForObjectOnLedge(ItemInfo* item, CollisionInfo* coll)
bool TestLaraPosition(const ObjectCollisionBounds& bounds, ItemInfo* item, ItemInfo* laraItem)
{
DrawDebugBox(bounds.BoundingBox.ToBoundingOrientedBox(item->Pose), Color(1.0f, 0.0f, 0.0f), RendererDebugPage::CollisionStats);
auto deltaOrient = laraItem->Pose.Orientation - item->Pose.Orientation;
if (deltaOrient.x < bounds.OrientConstraint.first.x || deltaOrient.x > bounds.OrientConstraint.second.x ||
deltaOrient.y < bounds.OrientConstraint.first.y || deltaOrient.y > bounds.OrientConstraint.second.y ||
@ -341,11 +343,7 @@ bool TestLaraPosition(const ObjectCollisionBounds& bounds, ItemInfo* item, ItemI
auto pos = (laraItem->Pose.Position - item->Pose.Position).ToVector3();
auto rotMatrix = item->Pose.Orientation.ToRotationMatrix();
// This solves once for all the minus sign hack of CreateFromYawPitchRoll.
// In reality it should be the inverse, but the inverse of a rotation matrix is equal to the transpose
// and transposing a matrix is faster.
// It's the only piece of code that does it, because we want Lara's location relative to the identity frame
// of the object we are test against.
// NOTE: Transpose = faster inverse.
rotMatrix = rotMatrix.Transpose();
pos = Vector3::Transform(pos, rotMatrix);

View file

@ -31,9 +31,9 @@ namespace TEN::Scripting
"ammoUsed", &Statistics::AmmoUsed,
/*** Distance traveled.
@tfield int traveledDistance amount of traveled distance in world units. One meter is 420 world units.
@tfield int distanceTraveled amount of traveled distance in world units. One meter is 420 world units.
*/
"traveledDistance", &Statistics::Distance,
"distanceTraveled", &Statistics::Distance,
/*** Health packs used.
@tfield int healthPacksUsed amount of used medipacks.