Skip to content

Easily convert Vec3 to Vec2 #5905

Answered by DJMcNab
DasLixou asked this question in Q&A
Discussion options

You must be logged in to vote

Why not use Vec3::truncate to convert from a Vec3 to a Vec2?

The example the code you've given would then use Vec2::extend, i.e. transform.translation.truncate().extend(0.0)

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by DasLixou
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants