summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorEunki, Hong <eunkiki.hong@samsung.com>2023-09-04 10:19:47 +0900
committerEunki Hong <eunkiki.hong@samsung.com>2023-09-04 14:58:52 +0900
commit3d3d351696b04922142de41b59189abb6d130851 (patch)
treece4b7bc79806fb059cc173a0c4434cbadb24b1ab /examples
parent61f63af04f24bcecd4e9c0ff5191aa60a830794a (diff)
downloaddali-demo-3d3d351696b04922142de41b59189abb6d130851.tar.gz
dali-demo-3d3d351696b04922142de41b59189abb6d130851.tar.bz2
dali-demo-3d3d351696b04922142de41b59189abb6d130851.zip
Fix svace issue for bullet-physics
Change-Id: Ic9bd3319cde9152168aa353b728aca6b34593414 Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/bullet-physics/ball-renderer.cpp2
-rw-r--r--examples/bullet-physics/physics-demo-controller.cpp18
2 files changed, 10 insertions, 10 deletions
diff --git a/examples/bullet-physics/ball-renderer.cpp b/examples/bullet-physics/ball-renderer.cpp
index 6c4f8521..c5feeff5 100644
--- a/examples/bullet-physics/ball-renderer.cpp
+++ b/examples/bullet-physics/ball-renderer.cpp
@@ -118,7 +118,7 @@ Geometry BallRenderer::CreateBallGeometry()
vertices.emplace_back(Vertex{Vector3{b, -a, 0}});
vertices.emplace_back(Vertex{Vector3{-b, -a, 0}});
- for(auto vertex : vertices)
+ for(auto& vertex : vertices)
{
vertex.aPosition.Normalize();
}
diff --git a/examples/bullet-physics/physics-demo-controller.cpp b/examples/bullet-physics/physics-demo-controller.cpp
index 4052f282..93ec7712 100644
--- a/examples/bullet-physics/physics-demo-controller.cpp
+++ b/examples/bullet-physics/physics-demo-controller.cpp
@@ -77,13 +77,13 @@ public:
mWindow.SetBackgroundColor(Color::DARK_SLATE_GRAY);
Window::WindowSize windowSize = mWindow.GetSize();
- auto cameraActor = mWindow.GetRenderTaskList().GetTask(0).GetCameraActor();
- cameraActor[CameraActor::Property::FIELD_OF_VIEW] = Math::PI/2.5f; // 72 degrees
- cameraActor[Actor::Property::POSITION_X] = 500;
- float z = cameraActor[Actor::Property::POSITION_Z];
- cameraActor[Actor::Property::POSITION_Z] = z-100;
+ auto cameraActor = mWindow.GetRenderTaskList().GetTask(0).GetCameraActor();
+ cameraActor[CameraActor::Property::FIELD_OF_VIEW] = Math::PI / 2.5f; // 72 degrees
+ cameraActor[Actor::Property::POSITION_X] = 500;
+ float z = cameraActor[Actor::Property::POSITION_Z];
+ cameraActor[Actor::Property::POSITION_Z] = z - 100;
cameraActor[CameraActor::Property::TARGET_POSITION] = Vector3();
- cameraActor[CameraActor::Property::TYPE] = Camera::LOOK_AT_TARGET;
+ cameraActor[CameraActor::Property::TYPE] = Camera::LOOK_AT_TARGET;
mPhysicsTransform.SetIdentityAndScale(Vector3(1.0f, -1.0f, 1.0f));
mPhysicsTransform.SetTranslation(Vector3(windowSize.GetWidth() * 0.5f,
windowSize.GetHeight() * 0.5f,
@@ -98,11 +98,11 @@ public:
mWindow.Add(mPhysicsRoot);
auto scopedAccessor = mPhysicsAdaptor.GetPhysicsAccessor();
- auto bulletWorld = scopedAccessor->GetNative().Get<btDiscreteDynamicsWorld*>();
+ auto bulletWorld = scopedAccessor->GetNative().Get<btDiscreteDynamicsWorld*>();
bulletWorld->setGravity(btVector3(0, -200, 0));
CreateGround(scopedAccessor, windowSize);
- mBrick = CreateLargeBrick(scopedAccessor);
+ mBrick = CreateLargeBrick(scopedAccessor);
mSelectedActor = mBrick;
CreateBall(scopedAccessor);
@@ -628,7 +628,7 @@ private:
PhysicsActor mBrick;
PhysicsActor mSelectedActor;
- btRigidBody* mPickedBody;
+ btRigidBody* mPickedBody{nullptr};
float mOldPickingDistance{0.0f};
int mPickedSavedState{0};
btTypedConstraint* mPickedConstraint{nullptr};