-
Notifications
You must be signed in to change notification settings - Fork 151
Fix Particle Cannon beam height visual bug #2220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix Particle Cannon beam height visual bug #2220
Conversation
Greptile Overview
|
| Filename | Overview |
|---|---|
| GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp | Increased orbital beam Z offset from 500.0f to 5000.0f and replaced magic numbers with named constant ORBITAL_BEAM_Z_OFFSET |
Sequence Diagram
sequenceDiagram
participant Update as ParticleUplinkCannonUpdate::update()
participant CreateGroundToOrbit as createGroundToOrbitLaser()
participant CreateOrbitToTarget as createOrbitToTargetLaser()
participant LaserUpdate as LaserUpdate
Note over Update: Particle Cannon fires
Update->>Update: Calculate m_currentTargetPosition (ground)
Update->>Update: Set orbitPosition.z = m_currentTargetPosition.z + ORBITAL_BEAM_Z_OFFSET
Update->>LaserUpdate: initLaser(orbitPosition, m_currentTargetPosition)
Note over LaserUpdate: Beam drawn from orbit (5000.0f above target) to ground
Note over CreateGroundToOrbit: Ground-to-orbit laser
CreateGroundToOrbit->>CreateGroundToOrbit: Set orbitPosition.z = m_laserOriginPosition.z + ORBITAL_BEAM_Z_OFFSET
CreateGroundToOrbit->>LaserUpdate: initLaser(m_laserOriginPosition, orbitPosition)
Note over LaserUpdate: Beam drawn from building to orbit (5000.0f above)
Note over CreateOrbitToTarget: Orbit-to-target laser
CreateOrbitToTarget->>CreateOrbitToTarget: Set orbitPosition.z = m_initialTargetPosition.z + ORBITAL_BEAM_Z_OFFSET
CreateOrbitToTarget->>LaserUpdate: initLaser(orbitPosition, m_initialTargetPosition)
Note over LaserUpdate: Beam drawn from orbit (5000.0f above) to target
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 1 comment
| #include "GameLogic/Module/ActiveBody.h" | ||
|
|
||
|
|
||
| const Real ORBITAL_BEAM_Z_OFFSET = 5000.0f; // TheSuperHackers @fix Mirelle 30/01/2026: Raised from 500.0f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider moving ORBITAL_BEAM_Z_OFFSET to the header file ParticleUplinkCannonUpdate.h per coding standards for code-level constants.
Context Used: Rule from dashboard - Prefer defining code-level constants (math constants, feature macros, etc.) in header files rather t... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp
Line: 62:62
Comment:
Consider moving `ORBITAL_BEAM_Z_OFFSET` to the header file `ParticleUplinkCannonUpdate.h` per coding standards for code-level constants.
**Context Used:** Rule from `dashboard` - Prefer defining code-level constants (math constants, feature macros, etc.) in header files rather t... ([source](https://app.greptile.com/review/custom-context?memory=9aca79ba-17d4-4c71-918f-10816f7fc751))
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.|
yes please : D |
Particle Cannon "Short Beam" Fix Walkthrough
Goal
Fix the visual bug where the Particle Uplink Cannon's laser beam appeared cut off or "floating" mid-air when viewed from a distance or on high-elevation maps, rather than striking from orbit.
Changes
We modified ParticleUplinkCannonUpdate.cpp to increase the orbital origin height of the beam.
ParticleUplinkCannonUpdate.cpp
Increased Height: Changed the vertical offset from 500.0f to 5000.0f in three key locations:
update()
createGroundToOrbitLaser()
createOrbitToTargetLaser()
Introduced Named Constant: Defined ORBITAL_BEAM_Z_OFFSET to replace the magic number.
const Real ORBITAL_BEAM_Z_OFFSET = 5000.0f;
These changes ensure the beam's origin point is high enough even when zoomed out or on high maps, maintaining the illusion of an orbital strike.