beyond-all-reason / beyond-all-reason/RecoilEngine

Allow Model Pieces to be animated in world space

Open
#1,320 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
679
Forks
290
Avg merge
3d 2h
Merged PRs (30d)
40

Description

rarely there comes up a need to be able to translate and/or rotate pieces in world space in the unit animation

there's only a couple of examples I know of at this time:
- having a piece point straight down no matter what (I forget what for, Legion Phoenix beam's aim not being effected by roll?)
- being able to position and rotate model pieces freely so that the Legion Mukade (legpede) can be procedurally animated
- Here I am manually undoing the object space transform- but the animation script is not updated fast enough for a perfect cancellation, resulting in the body pieces being flung about as the unit/head piece goes over hills
- https://discord.com/channels/549281623154229250/692380056001052693/1210807328065060884
- Enabling `upright` removes the roll/pitch following from the unit- making the tail more stable but now the head piece doesn't rotate to match the ground :(
- https://discord.com/channels/549281623154229250/692380056001052693/1210818973365440612

What if I could just... not have to deal with trying to cancel out the unit/object space transformation?

I am trying to pin down what needs to be done before I start laying down code changes

Also this issue provides a place to discuss this

Possible Work to be Done
- Allow for setting one or more flags to ignore parent's transformations- translation, rotation, and/or scale. I imagine a `SetPieceWorldSpaceFlags(pieceIdNumber, bitFlags)` COB function would handle this.
- Also scale would likely not need to be ignored very often.
- Create a `WorldTurn` function or `Turn` bool parameter that applies rotation around a world space axis
- Shorthand for setting the ignore parent rotation flag + applying a Turn animation?
- Do the same for `Move`?
- If bool parameter added to Move/Turn, then does the `SetPieceWorldSpaceFlags` function even have a reason to be exposed to the COB environment? (Still probably going to be used internally)

Contributor guide

Open the contributing guide

Research direction

Start with the unit animation path and the COB Move/Turn behavior named in the issue. Compare the proposed world-space flags with WorldTurn and possible Move changes; done would mean a concrete design and implementation scope for translating or rotating pieces in world space without manually cancelling parent transforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.