MCPcopy Create free account
hub / github.com/android/ndk-samples / Update

Method Update

teapots/image-decoder/src/main/cpp/TeapotRenderer.cpp:130–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130void TeapotRenderer::Update(float) {
131 const float CAM_X = 0.f;
132 const float CAM_Y = 0.f;
133 const float CAM_Z = 700.f;
134
135 mat_view_ = ndk_helper::Mat4::LookAt(ndk_helper::Vec3(CAM_X, CAM_Y, CAM_Z),
136 ndk_helper::Vec3(0.f, 0.f, 0.f),
137 ndk_helper::Vec3(0.f, 1.f, 0.f));
138
139 if (camera_) {
140 camera_->Update();
141 mat_view_ = camera_->GetTransformMatrix() * mat_view_ *
142 camera_->GetRotationMatrix() * mat_model_;
143 } else {
144 mat_view_ = mat_view_ * mat_model_;
145 }
146}
147
148void TeapotRenderer::Render() {
149 //

Callers 1

DrawFrameMethod · 0.45

Calls 1

Vec3Class · 0.85

Tested by

no test coverage detected