2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/update/dynamics/scene-graph-dynamics-cylinder-shape.h>
22 #include <dali/integration-api/debug.h>
23 #include <dali/integration-api/dynamics/dynamics-factory-intf.h>
24 #include <dali/integration-api/dynamics/dynamics-shape-intf.h>
25 #include <dali/internal/update/dynamics/scene-graph-dynamics-world.h>
26 #include <dali/public-api/dynamics/dynamics-shape.h>
37 DynamicsCylinderShape::DynamicsCylinderShape(DynamicsWorld& world)
38 : DynamicsShape(world)
40 DALI_LOG_INFO(Debug::Filter::gDynamics, Debug::Verbose, "%s\n", __PRETTY_FUNCTION__);
43 DynamicsCylinderShape::~DynamicsCylinderShape()
45 DALI_LOG_INFO(Debug::Filter::gDynamics, Debug::Verbose, "%s\n", __PRETTY_FUNCTION__);
48 void DynamicsCylinderShape::Initialize(const float radius, const float length)
50 DALI_LOG_INFO(Debug::Filter::gDynamics, Debug::Verbose, "%s - (radius: %.1f length: %.1f)\n", __PRETTY_FUNCTION__, radius, length);
52 mShape = mWorld.GetDynamicsFactory().CreateDynamicsShape();
53 const float worldScale((1.0f / mWorld.GetWorldScale()) );
54 mShape->Initialize( Dali::DynamicsShape::CYLINDER, Vector3( radius * worldScale, length * worldScale, 0.0f ) );
56 DynamicsShape::Initialize();
60 } // namespace SceneGraph
62 } // namespace Internal