-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refs/heads/dev' into cpp20
- Loading branch information
Showing
58 changed files
with
447 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
add_example(NAME "fonts" LINK_IMGUI WEB WEB_EMBED | ||
"../data/fonts@data/fonts" | ||
"../data/fonts@data/fonts" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
add_example(NAME "hemi_light" WEB) | ||
add_example(NAME "point_light" WEB ) | ||
add_example(NAME "point_light" WEB) | ||
add_example(NAME "spot_light" WEB) | ||
add_example(NAME "directional" WEB) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
|
||
#ifndef THREEPP_KEYCONTROLLER_HPP | ||
#define THREEPP_KEYCONTROLLER_HPP | ||
|
||
#include "threepp/input/KeyListener.hpp" | ||
|
||
#include "Youbot.hpp" | ||
|
||
class KeyController: public threepp::KeyListener { | ||
|
||
public: | ||
KeyController(Youbot& youbot) | ||
: youbot_(&youbot) {} | ||
|
||
void onKeyPressed(KeyEvent evt) override { | ||
if (evt.key == Key::W) { | ||
keyState_.up = true; | ||
} else if (evt.key == Key::S) { | ||
keyState_.down = true; | ||
} else if (evt.key == Key::D) { | ||
keyState_.right = true; | ||
} else if (evt.key == Key::A) { | ||
keyState_.left = true; | ||
} | ||
} | ||
|
||
void onKeyReleased(KeyEvent evt) override { | ||
if (evt.key == Key::W) { | ||
keyState_.up = false; | ||
} else if (evt.key == Key::S) { | ||
keyState_.down = false; | ||
} else if (evt.key == Key::D) { | ||
keyState_.right = false; | ||
} else if (evt.key == Key::A) { | ||
keyState_.left = false; | ||
} | ||
} | ||
|
||
void update(float dt) { | ||
|
||
if (keyState_.up) { | ||
youbot_->driveForwards(dt); | ||
} | ||
if (keyState_.down) { | ||
youbot_->driveBackwards(dt); | ||
} | ||
if (keyState_.right) { | ||
youbot_->driveRight(dt); | ||
} | ||
if (keyState_.left) { | ||
youbot_->driveLeft(dt); | ||
} | ||
} | ||
|
||
private: | ||
Youbot* youbot_; | ||
|
||
struct KeyState { | ||
bool left = false; | ||
bool right = false; | ||
bool up = false; | ||
bool down = false; | ||
} keyState_; | ||
}; | ||
|
||
#endif//THREEPP_KEYCONTROLLER_HPP |
Oops, something went wrong.