VIDEO: renamed init to setSize
parent
a494c2c32b
commit
45ad8fd7c9
|
@ -202,7 +202,7 @@ app::AppState Client::onInit() {
|
|||
return app::AppState::InitFailure;
|
||||
}
|
||||
|
||||
_camera.init(windowDimension());
|
||||
_camera.setSize(windowDimension());
|
||||
|
||||
if (!_animationCache->init()) {
|
||||
Log::error("Failed to initialize character cache");
|
||||
|
@ -372,7 +372,7 @@ app::AppState Client::onRunning() {
|
|||
|
||||
void Client::onWindowResize(void *windowHandle, int windowWidth, int windowHeight) {
|
||||
Super::onWindowResize(windowHandle, windowWidth, windowHeight);
|
||||
_camera.init(windowDimension());
|
||||
_camera.setSize(windowDimension());
|
||||
}
|
||||
|
||||
void Client::authFailed() {
|
||||
|
|
|
@ -25,7 +25,7 @@ TestApp::~TestApp() {
|
|||
|
||||
void TestApp::onWindowResize(void *windowHandle, int windowWidth, int windowHeight) {
|
||||
Super::onWindowResize(windowHandle, windowWidth, windowHeight);
|
||||
camera().init(windowDimension());
|
||||
camera().setSize(windowDimension());
|
||||
}
|
||||
|
||||
app::AppState TestApp::onConstruct() {
|
||||
|
@ -83,7 +83,7 @@ app::AppState TestApp::onInit() {
|
|||
}
|
||||
|
||||
Log::info("Set window dimensions: %ix%i (aspect: %f)", _frameBufferDimension.x, _frameBufferDimension.y, _aspect);
|
||||
camera().init(windowDimension());
|
||||
camera().setSize(windowDimension());
|
||||
camera().setWorldPosition(glm::vec3(0.0f, 50.0f, 100.0f));
|
||||
camera().lookAt(glm::vec3(0.0f));
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ void IMGUIApp::onWindowResize(void *windowHandle, int windowWidth, int windowHei
|
|||
io.DisplayFramebufferScale = ImVec2(xScale, yScale);
|
||||
}
|
||||
|
||||
_camera.init(windowDimension());
|
||||
_camera.setSize(windowDimension());
|
||||
_camera.update(0.0);
|
||||
video::ScopedShader scoped(_shader);
|
||||
_shader.setViewprojection(_camera.projectionMatrix());
|
||||
|
|
|
@ -306,7 +306,7 @@ void NuklearApp::initUIConfig(struct nk_convert_config& config) {
|
|||
|
||||
void NuklearApp::onWindowResize(void *windowHandle, int windowWidth, int windowHeight) {
|
||||
Super::onWindowResize(windowHandle, windowWidth, windowHeight);
|
||||
_camera.init(windowDimension());
|
||||
_camera.setSize(windowDimension());
|
||||
}
|
||||
|
||||
app::AppState NuklearApp::onConstruct() {
|
||||
|
|
|
@ -36,7 +36,7 @@ void nkc_model(struct nkc_context* cctx, struct nkc_model* model) {
|
|||
}
|
||||
|
||||
const glm::ivec2 size(bounds.w, bounds.h);
|
||||
model->camera.init(size);
|
||||
model->camera.setSize(size);
|
||||
model->camera.update(0.0);
|
||||
|
||||
const nk_color& c = ctx->style.window.background;
|
||||
|
|
|
@ -140,7 +140,7 @@ void Camera::rotate(const glm::quat& rotation) {
|
|||
_dirty |= DIRTY_ORIENTATION;
|
||||
}
|
||||
|
||||
void Camera::init(const glm::ivec2& windowSize) {
|
||||
void Camera::setSize(const glm::ivec2& windowSize) {
|
||||
if (_windowSize == windowSize) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ protected:
|
|||
public:
|
||||
Camera(CameraType type = CameraType::FirstPerson, CameraMode mode = CameraMode::Perspective);
|
||||
|
||||
void init(const glm::ivec2& windowSize);
|
||||
void setSize(const glm::ivec2& windowSize);
|
||||
int frameBufferHeight() const;
|
||||
|
||||
inline bool dirty() const {
|
||||
|
@ -394,7 +394,7 @@ inline float Camera::targetDistance() const {
|
|||
|
||||
inline Camera uiCamera(const glm::ivec2& windowSize) {
|
||||
Camera camera(CameraType::FirstPerson, video::CameraMode::Orthogonal);
|
||||
camera.init(windowSize);
|
||||
camera.setSize(windowSize);
|
||||
camera.setNearPlane(-1.0f);
|
||||
camera.setFarPlane(1.0f);
|
||||
camera.update(0.0);
|
||||
|
|
|
@ -27,7 +27,7 @@ protected:
|
|||
Camera camera;
|
||||
camera.setNearPlane(0.1f);
|
||||
camera.setFarPlane(100.0f);
|
||||
camera.init(dimension);
|
||||
camera.setSize(dimension);
|
||||
camera.setWorldPosition(position);
|
||||
camera.lookAt(lookAt, lookAlong);
|
||||
camera.update(0.0);
|
||||
|
@ -114,7 +114,7 @@ TEST_F(CameraTest, testCameraFrustumCullingPerspective) {
|
|||
|
||||
TEST_F(CameraTest, testCameraFrustumCullingOrthogonal) {
|
||||
Camera camera;
|
||||
camera.init(glm::vec2(100.0f, 100.0f));
|
||||
camera.setSize(glm::vec2(100.0f, 100.0f));
|
||||
camera.setMode(CameraMode::Orthogonal);
|
||||
camera.setWorldPosition(glm::vec3(0.1, 1.0, 0.1));
|
||||
camera.lookAt(glm::vec3(0.0), glm::forward);
|
||||
|
|
|
@ -40,8 +40,8 @@ void PlayerCamera::setCameraTarget() {
|
|||
_camera.update(0.0);
|
||||
}
|
||||
|
||||
bool PlayerCamera::init(const glm::ivec2& windowSize) {
|
||||
_camera.init(windowSize);
|
||||
bool PlayerCamera::setSize(const glm::ivec2& windowSize) {
|
||||
_camera.setSize(windowSize);
|
||||
_camera.setFarPlane(10.0f);
|
||||
_camera.setRotationType(video::CameraRotationType::Target);
|
||||
_camera.setFieldOfView(_fieldOfView);
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
void setTargetDistance(float targetDistance);
|
||||
|
||||
void construct();
|
||||
bool init(const glm::ivec2& windowSize);
|
||||
bool setSize(const glm::ivec2& windowSize);
|
||||
void shutdown();
|
||||
void update(const glm::vec3& entityPosition, double nowSeconds, double deltaFrameSeconds, double speed);
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ app::AppState TestCamera::onInit() {
|
|||
bool targetCamera = i == 0;
|
||||
bool ortho = i == 2;
|
||||
|
||||
_renderCamera[i].init(ortho ? glm::ivec2(100, 50) : ortho ? glm::ivec2(100, 50) : windowDimension());
|
||||
_renderCamera[i].setSize(ortho ? glm::ivec2(100, 50) : ortho ? glm::ivec2(100, 50) : windowDimension());
|
||||
_renderCamera[i].setOmega(glm::vec3(0.0f, 0.1f, 0.0f));
|
||||
|
||||
_renderCamera[i].setWorldPosition(glm::zero<glm::vec3>());
|
||||
|
|
|
@ -46,7 +46,7 @@ app::AppState TestOctreeVisit::onInit() {
|
|||
}
|
||||
|
||||
void TestOctreeVisit::updateCamera() {
|
||||
_octreeCamera.init(_ortho ? glm::ivec2(100, 50) : windowDimension());
|
||||
_octreeCamera.setSize(_ortho ? glm::ivec2(100, 50) : windowDimension());
|
||||
_octreeCamera.setOmega(_omega);
|
||||
|
||||
_octreeCamera.setWorldPosition(_pos);
|
||||
|
|
|
@ -113,7 +113,7 @@ app::AppState TestTraze::onInit() {
|
|||
_textCamera.setMode(video::CameraMode::Orthogonal);
|
||||
_textCamera.setNearPlane(-10.0f);
|
||||
_textCamera.setFarPlane(10.0f);
|
||||
_textCamera.init(windowDimension());
|
||||
_textCamera.setSize(windowDimension());
|
||||
_textCamera.update(0.0);
|
||||
|
||||
_voxelFontRender.setViewProjectionMatrix(_textCamera.viewProjectionMatrix());
|
||||
|
|
|
@ -169,7 +169,7 @@ app::AppState MapView::onInit() {
|
|||
return app::AppState::InitFailure;
|
||||
}
|
||||
|
||||
_camera.init(windowDimension());
|
||||
_camera.setSize(windowDimension());
|
||||
|
||||
const glm::vec3& pos = spawnPos();
|
||||
Log::info("Spawn entity at %s", glm::to_string(pos).c_str());
|
||||
|
@ -450,7 +450,7 @@ app::AppState MapView::onCleanup() {
|
|||
|
||||
void MapView::onWindowResize(void *windowHandle, int windowWidth, int windowHeight) {
|
||||
Super::onWindowResize(windowHandle, windowWidth, windowHeight);
|
||||
_camera.init(windowDimension());
|
||||
_camera.setSize(windowDimension());
|
||||
}
|
||||
|
||||
bool MapView::onKeyPress(int32_t key, int16_t modifier) {
|
||||
|
|
|
@ -97,7 +97,7 @@ bool Thumbnailer::renderVolume() {
|
|||
}
|
||||
|
||||
video::Camera camera;
|
||||
camera.init(glm::ivec2(_outputSize));
|
||||
camera.setSize(glm::ivec2(_outputSize));
|
||||
camera.setRotationType(video::CameraRotationType::Target);
|
||||
camera.setMode(video::CameraMode::Perspective);
|
||||
camera.setAngles(0.0f, 0.0f, 0.0f);
|
||||
|
|
|
@ -52,10 +52,10 @@ void ViewportController::init(ViewportController::SceneCameraMode mode) {
|
|||
|
||||
void ViewportController::onResize(const glm::ivec2& frameBufferSize, const glm::ivec2& windowSize) {
|
||||
if (_camera.mode() == video::CameraMode::Perspective) {
|
||||
_camera.init(windowSize);
|
||||
_camera.setSize(windowSize);
|
||||
} else {
|
||||
const glm::ivec2 size = windowSize / 5;
|
||||
_camera.init(size);
|
||||
_camera.setSize(size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue