本文整理汇总了C++中target_camera::update方法的典型用法代码示例。如果您正苦于以下问题:C++ target_camera::update方法的具体用法?C++ target_camera::update怎么用?C++ target_camera::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类target_camera
的用法示例。
在下文中一共展示了target_camera::update方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
bool update(float delta_time) {
// Accumulate time
total_time += delta_time;
// Update the scale - base on sin wave
s = 1.0f + sinf(total_time);
// Multiply by 5
s *= 5.0f;
// Increment theta - half a rotation per second
theta += pi<float>() * delta_time;
// Check if key is pressed
if (glfwGetKey(renderer::get_window(), GLFW_KEY_UP)) {
pos += vec3(0.0f, 0.0f, -5.0f) * delta_time;
}
if (glfwGetKey(renderer::get_window(), GLFW_KEY_DOWN)) {
pos += vec3(0.0f, 0.0f, 5.0f) * delta_time;
}
if (glfwGetKey(renderer::get_window(), GLFW_KEY_LEFT)) {
pos += vec3(-5.0f, 0.0f, 0.0f) * delta_time;
}
if (glfwGetKey(renderer::get_window(), GLFW_KEY_RIGHT)) {
pos += vec3(5.0f, 0.0f, 0.0f) * delta_time;
}
// Update the camera
cam.update(delta_time);
return true;
}
示例2: update
bool update(float delta_time) {
// Update camera
static float x = 0.0f;
x += delta_time;
cam.set_position(vec3(10.0f * sinf(x), 10.0f, 10.0f * cosf(x)));
cam.update(delta_time);
return true;
}
示例3: update
bool update(float delta_time) {
cam.update(delta_time);
// *********************************
// Set skybox position to camera position (camera in centre of skybox)
// rotate the sphere
// *********************************
return true;
}
示例4: update
bool update(float delta_time) {
// Use up an down to modify the dissolve factor
if (glfwGetKey(renderer::get_window(), GLFW_KEY_UP))
dissolve_factor = clamp(dissolve_factor + 0.1f * delta_time, 0.0f, 1.0f);
if (glfwGetKey(renderer::get_window(), GLFW_KEY_DOWN))
dissolve_factor = clamp(dissolve_factor - 0.1f * delta_time, 0.0f, 1.0f);
// Update camera
cam.update(delta_time);
uv_scroll += vec2(0, delta_time * 0.05);
return true;
}
示例5: update
bool update(float delta_time) {
// Accumulate time
total_time += delta_time;
// Update the scale - base on sin wave
s = 1.0f + sinf(total_time);
// Multiply by 5
s *= 5.0f;
// Increment theta - half a rotation per second
theta += pi<float>() * delta_time;
// Update the camera
cam.update(delta_time);
return true;
}
示例6: update
bool update(float delta_time)
{
if (glfwGetKey(renderer::get_window(), GLFW_KEY_UP))
theta -= pi<float>() * delta_time;
if (glfwGetKey(renderer::get_window(), GLFW_KEY_DOWN))
theta += pi<float>() * delta_time;
if (glfwGetKey(renderer::get_window(), GLFW_KEY_RIGHT))
rho -= pi<float>() * delta_time;
if (glfwGetKey(renderer::get_window(), GLFW_KEY_LEFT))
rho += pi<float>() * delta_time;
// Update the camera
cam.update(delta_time);
return true;
}
示例7: update
bool update(float delta_time) {
// Range of the point light
static float range = 20.0f;
// *********************************
// WSAD to move point light
// O and P to change range
// *********************************
// Set range
light.set_range(range);
// Rotate the sphere
meshes["sphere"].get_transform().rotate(vec3(0.0f, half_pi<float>(), 0.0f) * delta_time);
cam.update(delta_time);
return true;
}
示例8: update
bool update(float delta_time) {
if (glfwGetKey(renderer::get_window(), '1'))
cam.set_position(vec3(50, 10, 50));
if (glfwGetKey(renderer::get_window(), '2'))
cam.set_position(vec3(-50, 10, 50));
if (glfwGetKey(renderer::get_window(), '3'))
cam.set_position(vec3(-50, 10, -50));
if (glfwGetKey(renderer::get_window(), '4'))
cam.set_position(vec3(50, 10, -50));
// Rotate the sphere
meshes["sphere"].get_transform().rotate(vec3(0.0f, half_pi<float>(), 0.0f) * delta_time);
cam.update(delta_time);
return true;
}
示例9: update
bool update(float delta_time) {
if (glfwGetKey(renderer::get_window(), '1')) {
cam.set_position(vec3(50, 10, 50));
}
if (glfwGetKey(renderer::get_window(), '2')) {
cam.set_position(vec3(-50, 10, 50));
}
if (glfwGetKey(renderer::get_window(), '3')) {
cam.set_position(vec3(-50, 10, -50));
}
if (glfwGetKey(renderer::get_window(), '4')) {
cam.set_position(vec3(50, 10, -50));
}
cam.update(delta_time);
return true;
}
示例10: update
bool update(float delta_time) {
// Rotate the teapot
meshes["teapot"].get_transform().rotate(vec3(0.0f, 0.0f, half_pi<float>()) * delta_time);
// *********************************
// Update the shadow map properties from the spot light
// *********************************
// Press s to save
if (glfwGetKey(renderer::get_window(), 'S') == GLFW_PRESS)
shadow.buffer->save("test.png");
cam.update(delta_time);
return true;
}