Skip to content

Commit d79153b

Browse files
committed
init
1 parent a0d0538 commit d79153b

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1212

1313
- `Lerp` can now be used on Vectors and Matrices/Rotations, not just numbers.
1414

15+
- Added missing `HDFirearm` lua bindings, `EjectionOffset` (R/W) and `EjectionPos` (R). Work similarly to their Muzzle variants.
16+
1517
</details>
1618

1719
<details><summary><b>Changed</b></summary>

Source/Entities/HDFirearm.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,10 @@ Vector HDFirearm::GetMuzzlePos() const {
531531
return m_Pos + RotateOffset(m_MuzzleOff);
532532
}
533533

534+
Vector HDFirearm::GetEjectionPos() const {
535+
return m_Pos + RotateOffset(m_EjectOff);
536+
}
537+
534538
void HDFirearm::RestDetection() {
535539
HeldDevice::RestDetection();
536540

Source/Entities/HDFirearm.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,24 @@ namespace RTE {
273273

274274
/// Sets the unrotated relative offset from the position to the muzzle or
275275
/// other equivalent point of this.
276-
/// @param newOffset Bew ofsset value.
276+
/// @param newOffset New offset value.
277277
void SetMuzzleOffset(Vector newOffset) override { m_MuzzleOff = newOffset; }
278278

279+
/// Gets the absolute position of the muzzle or other equivalent point of
280+
/// this.
281+
/// @return A vector describing the absolute world coordinates for the Shell
282+
/// ejection point of this
283+
Vector GetEjectionPos() const;
284+
285+
/// Gets the unrotated relative offset from the position to the Shell ejection point.
286+
/// @return A unrotated vector describing the relative for the Shell ejection point of
287+
/// this from this' position.
288+
Vector GetEjectionOffset() const { return m_EjectOff; }
289+
290+
/// Sets the unrotated relative offset from the position to the Shell ejection point.
291+
/// @param newOffset New offset value.
292+
void SetEjectionOffset(Vector newOffset) { m_EjectOff = newOffset; }
293+
279294
/// Gets this HDFirearm's pre fire sound. Ownership is NOT transferred!
280295
/// @return The SoundContainer for this HDFirearm's pre fire sound.
281296
SoundContainer* GetPreFireSound() const { return m_PreFireSound; }

Source/Lua/LuaBindingsEntities.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,8 @@ LuaBindingRegisterFunctionDefinitionForType(EntityLuaBindings, HDFirearm) {
607607
return ConcreteTypeLuaClassDefinition(HDFirearm, HeldDevice)
608608

609609
.property("ReloadEndOffset", &HDFirearm::GetReloadEndOffset, &HDFirearm::SetReloadEndOffset)
610+
.property("EjectionPos", &HDFirearm::GetEjectionPos)
611+
.property("EjectionOffset", &HDFirearm::GetEjectionOffset, &HDFirearm::SetEjectionOffset)
610612
.property("RateOfFire", &HDFirearm::GetRateOfFire, &HDFirearm::SetRateOfFire)
611613
.property("MSPerRound", &HDFirearm::GetMSPerRound)
612614
.property("FullAuto", &HDFirearm::IsFullAuto, &HDFirearm::SetFullAuto)

0 commit comments

Comments
 (0)