Premium Only Content

Operator Overloading (Custom Vector Class) - C++ in 2021
In this lesson, we create an implementation of our own Vector class! We do so in the context of learning operator overloading including:
Vector Addition
Vector Subtraction
Vector * Scalar
Vector / Scalar
Comparison Operators
Conversion Operators
OStream operator
Type wrapping builtin functions
In the end, we'll have a class implementation that will be usable in your own game projects!
Professional C++ by Marc Gregoire: https://amzn.to/3eVMlaU
Chapters:
0:00 Intro
0:35 Follow ups from last lesson
2:50 Code Cleanup
3:55 Create Vector3 class
5:18 THEORY - Operator Overloading
16:50 +(addition) Operator
19:00 - (substraction) Operator
19:50 ostream operator
22:37 First usage / test
25:08 Vector * Scalar (Multiplication) operator (RHS)
26:05 Vector / Scalar (Division) operator (RHS)
27:37 Changing your Left Hand Operand (Multiplication)
29:50 Comparison Operator Overloads
35:00 (BONUS) Type wrapping for overloading builtin types
-
1:37:39
Ozzadar - Game Development
3 years agoVulkan Vertex + Index Buffers | Cross Platform Game Engine Development
792 -
LIVE
JULIE GREEN MINISTRIES
1 hour agoLIVE WITH JULE AND TIM BALLARD
9,087 watching -
LIVE
The Mike Schwartz Show
1 hour agoTHE MIKE SCHWARTZ SHOW with DR. MICHAEL J SCHWARTZ 10-07-2025
3,964 watching -
12:46
RTT: Guns & Gear
5 hours agoThis Might Be the Best .45 Cal Suppressor: Anechoic Suppressors AnechoX 45L
45 -
LIVE
Matt Kohrs
11 hours agoLive Day Trading: Ripping Higher || Stock Market Open
568 watching -
LIVE
Wendy Bell Radio
5 hours agoWorse Than Watergate
7,763 watching -
LIVE
Barry Cunningham
1 hour agoMUST SEE LIVE: PAM BONDI SENATE HEARING!
1,309 watching -
LIVE
LFA TV
12 hours agoLIVE & BREAKING NEWS! | TUESDAY 10/7/25
2,544 watching -
1:01:26
Chad Prather
14 hours agoTake Away the Stone: When Faith Meets the Impossible
24.7K19 -
24:26
Tucker Carlson
16 hours agoThe 9/11 Files: They Could Have Stopped It | Ep 3
62.9K54