feat: add projectile marker support for grenades and smokes#79
Merged
Conversation
Thrown projectiles (grenades, smokes) are now exported as markers in the v1 JSON format instead of fire lines. This enables the web viewer to display grenade/smoke icons with trajectory positions. Changes: - Add ProjectileEventToProjectileMarker converter that extracts icon filename from Arma path and creates marker with trajectory states - Modify handleProjectileEvent to route thrown projectiles (Weapon="throw") to AddMarker instead of RecordFiredEvent - Add tests for projectile marker conversion The marker format follows web viewer expectations: - Type: magIcons/<icon_filename>.paa - Side: GLOBAL (-1) - OwnerID: firer's OCAP ID - Positions: trajectory from throw to impact
The M coordinate in LineStringZM now stores the actual frame number from SQF instead of tickTime. This enables accurate frame-by-frame animation of projectile markers in the web viewer. Before: M = tickTime (unused) After: M = frameNo (used for marker state CaptureFrame)
- Add EndFrame field to core.Marker - Set endFrame to last position's frame for projectile markers (when grenade explodes/dissipates) instead of -1 (persist forever) - Regular markers default to -1 via builder (0 treated as -1) - Update MarkerToCore to set EndFrame: -1 for regular markers
Merging this branch changes the coverage (1 decrease, 1 increase)
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
ProjectileEventToProjectileMarkerconverter that extracts icon filename from Arma path and creates marker with trajectory stateshandleProjectileEventto route thrown projectiles (Weapon="throw") toAddMarkerinstead ofRecordFiredEventMarker Format
The marker format follows web viewer expectations:
magIcons/<icon_filename>.paaGLOBAL(-1)Example Output
Test plan
ProjectileEventToProjectileMarkerpass