Commit 3d3d351696b04922142de41b59189abb6d130851
Committed by
Eunki Hong
1 parent
61f63af0
Fix svace issue for bullet-physics
Change-Id: Ic9bd3319cde9152168aa353b728aca6b34593414 Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
Showing
2 changed files
with
10 additions
and
10 deletions
examples/bullet-physics/ball-renderer.cpp
| ... | ... | @@ -118,7 +118,7 @@ Geometry BallRenderer::CreateBallGeometry() |
| 118 | 118 | vertices.emplace_back(Vertex{Vector3{b, -a, 0}}); |
| 119 | 119 | vertices.emplace_back(Vertex{Vector3{-b, -a, 0}}); |
| 120 | 120 | |
| 121 | - for(auto vertex : vertices) | |
| 121 | + for(auto& vertex : vertices) | |
| 122 | 122 | { |
| 123 | 123 | vertex.aPosition.Normalize(); |
| 124 | 124 | } | ... | ... |
examples/bullet-physics/physics-demo-controller.cpp
| ... | ... | @@ -77,13 +77,13 @@ public: |
| 77 | 77 | mWindow.SetBackgroundColor(Color::DARK_SLATE_GRAY); |
| 78 | 78 | Window::WindowSize windowSize = mWindow.GetSize(); |
| 79 | 79 | |
| 80 | - auto cameraActor = mWindow.GetRenderTaskList().GetTask(0).GetCameraActor(); | |
| 81 | - cameraActor[CameraActor::Property::FIELD_OF_VIEW] = Math::PI/2.5f; // 72 degrees | |
| 82 | - cameraActor[Actor::Property::POSITION_X] = 500; | |
| 83 | - float z = cameraActor[Actor::Property::POSITION_Z]; | |
| 84 | - cameraActor[Actor::Property::POSITION_Z] = z-100; | |
| 80 | + auto cameraActor = mWindow.GetRenderTaskList().GetTask(0).GetCameraActor(); | |
| 81 | + cameraActor[CameraActor::Property::FIELD_OF_VIEW] = Math::PI / 2.5f; // 72 degrees | |
| 82 | + cameraActor[Actor::Property::POSITION_X] = 500; | |
| 83 | + float z = cameraActor[Actor::Property::POSITION_Z]; | |
| 84 | + cameraActor[Actor::Property::POSITION_Z] = z - 100; | |
| 85 | 85 | cameraActor[CameraActor::Property::TARGET_POSITION] = Vector3(); |
| 86 | - cameraActor[CameraActor::Property::TYPE] = Camera::LOOK_AT_TARGET; | |
| 86 | + cameraActor[CameraActor::Property::TYPE] = Camera::LOOK_AT_TARGET; | |
| 87 | 87 | mPhysicsTransform.SetIdentityAndScale(Vector3(1.0f, -1.0f, 1.0f)); |
| 88 | 88 | mPhysicsTransform.SetTranslation(Vector3(windowSize.GetWidth() * 0.5f, |
| 89 | 89 | windowSize.GetHeight() * 0.5f, |
| ... | ... | @@ -98,11 +98,11 @@ public: |
| 98 | 98 | mWindow.Add(mPhysicsRoot); |
| 99 | 99 | |
| 100 | 100 | auto scopedAccessor = mPhysicsAdaptor.GetPhysicsAccessor(); |
| 101 | - auto bulletWorld = scopedAccessor->GetNative().Get<btDiscreteDynamicsWorld*>(); | |
| 101 | + auto bulletWorld = scopedAccessor->GetNative().Get<btDiscreteDynamicsWorld*>(); | |
| 102 | 102 | bulletWorld->setGravity(btVector3(0, -200, 0)); |
| 103 | 103 | |
| 104 | 104 | CreateGround(scopedAccessor, windowSize); |
| 105 | - mBrick = CreateLargeBrick(scopedAccessor); | |
| 105 | + mBrick = CreateLargeBrick(scopedAccessor); | |
| 106 | 106 | mSelectedActor = mBrick; |
| 107 | 107 | |
| 108 | 108 | CreateBall(scopedAccessor); |
| ... | ... | @@ -628,7 +628,7 @@ private: |
| 628 | 628 | PhysicsActor mBrick; |
| 629 | 629 | PhysicsActor mSelectedActor; |
| 630 | 630 | |
| 631 | - btRigidBody* mPickedBody; | |
| 631 | + btRigidBody* mPickedBody{nullptr}; | |
| 632 | 632 | float mOldPickingDistance{0.0f}; |
| 633 | 633 | int mPickedSavedState{0}; |
| 634 | 634 | btTypedConstraint* mPickedConstraint{nullptr}; | ... | ... |