Skip to content
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

ejection direction #664

Open
MindlessCoat opened this issue Mar 10, 2025 · 0 comments
Open

ejection direction #664

MindlessCoat opened this issue Mar 10, 2025 · 0 comments

Comments

@MindlessCoat
Copy link

For modders who change weapon models or just want shells to eject to the right.

I'm not sure why this was done in the original code, but the ejected brass debris is having it's linear ( and also angular ) velocity forced to eject based on the player view axis after it is launched. This isn't necessary and prevents a negative y value for the vector being used which is needed to eject right.

in Weapon.cpp comment out this:

//linear_velocity = 40 * ( playerViewAxis[0] + playerViewAxis[1] + playerViewAxis[2] );
//angular_velocity.Set( 10 * gameLocal.random.CRandomFloat(), 10 * gameLocal.random.CRandomFloat(), 10 * gameLocal.random.CRandomFloat() );

//debris->GetPhysics()->SetLinearVelocity( linear_velocity );
//debris->GetPhysics()->SetAngularVelocity( angular_velocity );

After modifying the code, if needed we can get the shotgun shell to eject right with one last change:

Change the y value to something negative for this vector being used in 'debris_shotgunbrass'

"velocity" "-25 -100 50"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant