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

Improve Lua angle/vectors a bit #282

Merged
merged 1 commit into from
Jun 19, 2016
Merged

Improve Lua angle/vectors a bit #282

merged 1 commit into from
Jun 19, 2016

Conversation

squeek502
Copy link
Member

  • Add player:GetEyeAngles()

  • Add __tostring() implementations for Vector and QAngle classes

  • Convert VectorAngles and AngleVectors to use Lua-style return values rather than C++ style pass-by-reference parameters. Example usage of the new functions:

    local eye_angles = player:GetEyeAngles()
    local forward, right, up = AngleVectors(eye_angles)
    local angles = VectorAngles(forward)
    assert(angles == eye_angles)

Note: This change is NOT backwards compatible, but as far as I can tell, no existing Lua scripts use either VectorAngles or AngleVectors currently (at least none that I have downloaded on my computer)

- Add player:GetEyeAngles()
- Add __tostring() implementations for Vector and QAngle classes
- Convert VectorAngles and AngleVectors to use Lua-style return values rather than C++ style pass-by-reference parameters. Example usage of the new functions:

    local eye_angles = player:GetEyeAngles()
    local forward, right, up = AngleVectors(eye_angles)
    local angles = VectorAngles(forward)
    assert(angles == eye_angles)

Note: This change is NOT backwards compatible, but as far as I can tell, no existing Lua scripts use either VectorAngles or AngleVectors currently (at least none that I have downloaded on my computer)
@AfterShockFF
Copy link
Member

Seems fine, whats this for?

@squeek502
Copy link
Member Author

No specific purpose, just something I noticed could be improved when testing other changes.

@squeek502 squeek502 merged commit fad1c8c into beta Jun 19, 2016
@squeek502 squeek502 deleted the lua/angles-vectors branch July 3, 2016 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants