DynamicsBodyConfig softConfig( DynamicsBodyConfig::New() );
softConfig.SetType(DynamicsBodyConfig::SOFT);
- Cloth mesh(Cloth::New(10.0f, 10.0f, 10, 10));
- DynamicsShape meshShape(DynamicsShape::NewMesh(mesh));
+ DynamicsShape meshShape(DynamicsShape::NewSphere(1.f));
softConfig.SetShape( meshShape );
softConfig.SetMass(1.0f);
MeshActor softActor(MeshActor::New(mesh));
[enable_backtrace=$enableval],
[enable_backtrace=yes])
-AC_ARG_ENABLE([dynamics],
- [AC_HELP_STRING([--enable-dynamics],
- [Builds with dynamics support])],
- [dynamics_support=$enableval],
- [dynamics_support=no])
-
if test "x$enable_debug" = "xyes"; then
DALI_CFLAGS="$DALI_CFLAGS -DDEBUG_ENABLED"
fi
enable_backtrace="no"
fi
-DALI_DYNAMICS_SUPPORT=
-if test "x$dynamics_support" = "xyes"; then
- DALI_CFLAGS="$DALI_CFLAGS -DDALI_DYNAMICS_SUPPORT"
- DALI_DYNAMICS_SUPPORT=-DDALI_DYNAMICS_SUPPORT
-fi
-AC_SUBST(DALI_DYNAMICS_SUPPORT)
-
# Must come after Emscripten feature test
if test "x$enable_backtrace" = "xyes"; then
DALI_CFLAGS="$DALI_CFLAGS -DBACKTRACE_ENABLED"
fi
-AM_CONDITIONAL([DALI_DYNAMICS_SUPPORT], [test x$dynamics_support = xyes])
-
if test x$DALI_DATA_RW_DIR != x; then
dataReadWriteDir=$DALI_DATA_RW_DIR
else
Data Dir (Read Only): $dataReadOnlyDir
Emscripten: $enable_emscripten
Backtrace: $enable_backtrace
- Dynamics: $dynamics_support
"
Version: ${apiversion}
Requires:
Libs: -L${libdir} -ldali-core
-Cflags: -I${includedir} @DALI_DYNAMICS_SUPPORT@
+Cflags: -I${includedir}
$(public_api_src_files) \
$(devel_api_src_files)
-if DALI_DYNAMICS_SUPPORT
-src_files += $(internal_dynamics_src_files)
-endif
-
lib_LTLIBRARIES = libdali-core.la
libdali_core_la_SOURCES = $(dali_shaders_src_file) \
develapicommon_HEADERS = $(devel_api_core_common_header_files)
develapidynamics_HEADERS = $(devel_api_core_dynamics_header_files)
develapievents_HEADERS = $(devel_api_core_events_header_files)
-develapigeometry_HEADERS = $(devel_api_core_geometry_header_files)
develapiimages_HEADERS = $(devel_api_core_images_header_files)
develapimodeling_HEADERS = $(devel_api_core_modeling_header_files)
develapiobject_HEADERS = $(devel_api_core_object_header_files)
* - DynamicsShape::CONE
* - x radius of base
* - y length of cone
- * - DynamicsShape::MESH
- * - x width
- * - y height
- * - z number of extra division on x and y
*/
void SetShape(const DynamicsShape::ShapeType type, const Vector3& dimensions);
#include <dali/internal/event/dynamics/dynamics-cone-shape-impl.h>
#include <dali/internal/event/dynamics/dynamics-cube-shape-impl.h>
#include <dali/internal/event/dynamics/dynamics-cylinder-shape-impl.h>
-#include <dali/internal/event/dynamics/dynamics-mesh-shape-impl.h>
#include <dali/internal/event/dynamics/dynamics-sphere-shape-impl.h>
#include <dali/internal/event/dynamics/dynamics-world-impl.h>
#endif
// BASE CLASS INCLUDES
#include <dali/public-api/object/base-handle.h>
-#include <dali/devel-api/geometry/cloth.h>
namespace Dali
{
CONE, ///< A cone defined by the radius of its base and its height
CUBE, ///< A cube defined by width,height and depth
CYLINDER, ///< A cylinder defined by the radius of its ends and its height
- MESH, ///< A shape defined by a triangular mesh
SPHERE, ///< A sphere defined by its radius
}; // enum ShapeType
static DynamicsShape NewCylinder(const float radius, const float length);
/**
- * @brief Creates a mesh.
- *
- * @param[in] mesh A mesh.
- * @return A handle to the new shape
- */
- static DynamicsShape NewMesh(Cloth mesh);
-
- /**
* @brief Creates a sphere.
*
* @param[in] radius The radius of the sphere.
$(devel_api_src_dir)/dynamics/dynamics-world.cpp \
$(devel_api_src_dir)/dynamics/dynamics-world-config.cpp \
$(devel_api_src_dir)/events/hit-test-algorithm.cpp \
- $(devel_api_src_dir)/geometry/cloth.cpp \
$(devel_api_src_dir)/images/atlas.cpp \
$(devel_api_src_dir)/images/distance-field.cpp \
$(devel_api_src_dir)/object/property-buffer.cpp \
devel_api_core_events_header_files = \
$(devel_api_src_dir)/events/hit-test-algorithm.h
-devel_api_core_geometry_header_files = \
- $(devel_api_src_dir)/geometry/cloth.h
-
devel_api_core_images_header_files = \
$(devel_api_src_dir)/images/atlas.h \
$(devel_api_src_dir)/images/distance-field.h
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/devel-api/geometry/cloth.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/event/modeling/cloth-impl.h>
-
-namespace Dali
-{
-
-namespace
-{
-
-} // namespace
-
-Cloth::Cloth()
-{
-}
-
-Cloth::~Cloth()
-{
-}
-
-Cloth::Cloth(const Cloth& handle)
-{
-}
-
-Cloth& Cloth::operator=(const Cloth& rhs)
-{
- BaseHandle::operator=(rhs);
- return *this;
-}
-
-Cloth Cloth::New( const float width, const float height, const int xSteps, const int ySteps, const Rect<float>& textureCoordinates )
-{
- Dali::Geometry geometry;
- //TODO: MESH_REWORK: create the geometry
-
- Internal::ClothIPtr clothPtr = Internal::Cloth::New( GetImplementation(geometry) );
- return Cloth( clothPtr.Get() );
-}
-
-Cloth Cloth::DownCast( BaseHandle handle )
-{
- return Cloth( dynamic_cast<Dali::Internal::Cloth*>(handle.GetObjectPtr()) );
-}
-
-Cloth::Cloth(Internal::Cloth* internal)
-{
-}
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_CLOTH_H__
-#define __DALI_CLOTH_H__
-
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-// INTERNAL INCLUDES
-#include <dali/public-api/math/rect.h>
-#include <dali/public-api/math/vector4.h>
-#include <dali/public-api/object/base-handle.h>
-
-namespace Dali
-{
-
-namespace Internal DALI_INTERNAL
-{
-class Cloth;
-}
-
-/**
- * @brief A Cloth is a specialized mesh that can be used and modified
- * by the Dynamics engine.
- */
-class DALI_IMPORT_API Cloth : public BaseHandle
-{
-public:
-
- /**
- * @brief Create an initialized plane aligned on the XY axis.
- *
- * @param[in] width The width of the plane
- * @param[in] height The height of the plane
- * @param[in] xSteps The number of vertices along the X axis
- * @param[in] ySteps The number of vertices along the Y axis
- * @param[in] textureCoordinates UV coordinates.
- * @return A handle to a newly allocated Dali resource.
- */
- static Cloth New(const float width,
- const float height,
- const int xSteps,
- const int ySteps,
- const Rect<float>& textureCoordinates = Rect<float>(0.0f, 0.0f, 1.0f, 1.0f));
-
-
- /**
- * @brief Create an uninitialized Cloth; this can be initialized with Cloth::New().
- *
- * Calling member functions with an uninitialized Dali::Object is not allowed.
- */
- Cloth();
-
- /**
- * @brief Destructor
- *
- * This is non-virtual since derived Handle types must not contain data or virtual methods.
- */
- ~Cloth();
-
- /**
- * @brief This copy constructor is required for (smart) pointer semantics.
- *
- * @param [in] handle A reference to the copied handle
- */
- Cloth(const Cloth& handle);
-
- /**
- * @brief This assignment operator is required for (smart) pointer semantics.
- *
- * @param [in] rhs A reference to the copied handle
- * @return A reference to this
- */
- Cloth& operator=(const Cloth& rhs);
-
- /**
- * @brief Downcast an Object handle to a Cloth handle.
- *
- * If handle points to a Cloth object the downcast produces valid
- * handle. If not the returned handle is left uninitialized.
- *
- * @param[in] handle to an object
- * @return handle to a Cloth object or an uninitialized handle
- */
- static Cloth DownCast( BaseHandle handle );
-
-public: // Not intended for application developers
-
- /**
- * @brief This constructor is used by Dali New() methods.
- *
- * @param [in] cloth A pointer to a newly allocated Dali resource
- */
- explicit DALI_INTERNAL Cloth(Internal::Cloth* cloth);
-};
-
-} // namespace Dali
-
-#endif // __DALI_CLOTH_H__
#include <dali/internal/event/dynamics/dynamics-cone-shape-impl.h>
#include <dali/internal/event/dynamics/dynamics-cube-shape-impl.h>
#include <dali/internal/event/dynamics/dynamics-cylinder-shape-impl.h>
-#include <dali/internal/event/dynamics/dynamics-mesh-shape-impl.h>
#include <dali/internal/event/dynamics/dynamics-sphere-shape-impl.h>
-#include <dali/internal/event/modeling/mesh-impl.h>
-#include <dali/devel-api/geometry/cloth.h>
namespace Dali
{
mShape = new DynamicsCylinderShape(dimensions.x, dimensions.y);
break;
}
- @todo Remove cloth handling
- case Dali::DynamicsShape::MESH:
- {
- mShape = new DynamicsCubeShape(dimensions);
- break;
- }
case Dali::DynamicsShape::SPHERE:
{
mShape = new DynamicsSphereShape(dimensions.x);
class DynamicsCylinderShape;
typedef IntrusivePtr<DynamicsCylinderShape> DynamicsCylinderShapePtr;
-class DynamicsMeshShape;
-typedef IntrusivePtr<DynamicsMeshShape> DynamicsMeshShapePtr;
-
class DynamicsSphereShape;
typedef IntrusivePtr<DynamicsSphereShape> DynamicsSphereShapePtr;
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/event/modeling/cloth-impl.h>
-
-// EXTERNAL INCLUDES
-#include <stdio.h>
-
-// INTERNAL INCLUDES
-
-namespace Dali
-{
-namespace Internal
-{
-
-ClothIPtr Cloth::New( Geometry& geometry )
-{
- ClothIPtr cloth( new Cloth( geometry ) );
- return cloth;
-}
-
-Cloth::Cloth( Geometry& geometry )
-{
-}
-
-Cloth::~Cloth()
-{
-}
-
-} // namespace Internal
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_INTERNAL_CLOTH_H__
-#define __DALI_INTERNAL_CLOTH_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/devel-api/geometry/cloth.h>
-#include <dali/internal/event/common/object-impl.h>
-#include <dali/internal/event/rendering/geometry-impl.h>
-
-namespace Dali
-{
-class MeshData;
-
-namespace Internal
-{
-class Cloth;
-
-typedef IntrusivePtr<Cloth> ClothIPtr; ///< smart pointer to a Cloth
-
-/**
- * A single cloth in a 3D model
- */
-class Cloth : public BaseObject
-{
-public: // construction, destruction and initialisation
-
- /**
- * Create a new cloth.
- * @param[in] clothData the mesh data
- * @return A smart-pointer to the newly allocated Cloth.
- */
- static ClothIPtr New( Geometry& clothData );
-
- /**
- * Construct a new Cloth. This is not discardable or scalable.
- * @param[in] clothData the mesh data
- */
- Cloth( Geometry& clothData );
-
-protected:
- /**
- * A reference counted object may only be deleted by calling Unreference()
- */
- virtual ~Cloth();
-
-private:
- // Undefined
- Cloth(const Cloth&);
-
- // Undefined
- Cloth& operator=(const Cloth& rhs);
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Internal::Cloth& GetImplementation(Dali::Cloth& cloth)
-{
- DALI_ASSERT_ALWAYS( cloth && "Cloth handle is empty" );
-
- BaseObject& handle = cloth.GetBaseObject();
-
- return static_cast<Internal::Cloth&>(handle);
-}
-
-inline const Internal::Cloth& GetImplementation(const Dali::Cloth& cloth)
-{
- DALI_ASSERT_ALWAYS( cloth && "Cloth handle is empty" );
-
- const BaseObject& handle = cloth.GetBaseObject();
-
- return static_cast<const Internal::Cloth&>(handle);
-}
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_CLOTH_H__
$(internal_src_dir)/event/images/nine-patch-image-impl.cpp \
$(internal_src_dir)/event/images/resource-image-impl.cpp \
$(internal_src_dir)/event/images/native-image-impl.cpp \
- $(internal_src_dir)/event/modeling/cloth-impl.cpp \
$(internal_src_dir)/event/object/custom-object-internal.cpp \
$(internal_src_dir)/event/render-tasks/render-task-impl.cpp \
$(internal_src_dir)/event/render-tasks/render-task-list-impl.cpp \
#include <dali/integration-api/dynamics/dynamics-factory-intf.h>
#include <dali/integration-api/dynamics/dynamics-shape-intf.h>
#include <dali/internal/update/dynamics/scene-graph-dynamics-shape.h>
-#include <dali/internal/update/dynamics/scene-graph-dynamics-mesh-shape.h>
#include <dali/internal/update/dynamics/scene-graph-dynamics-world.h>
-#include <dali/internal/update/modeling/scene-graph-mesh.h>
-#include <dali/internal/update/modeling/internal-mesh-data.h>
#include <dali/internal/update/nodes/node.h>
namespace Dali
#include <dali/internal/event/common/event-thread-services.h>
#include <dali/internal/event/dynamics/dynamics-declarations.h>
#include <dali/internal/update/common/double-buffered.h>
-#include <dali/internal/update/modeling/scene-graph-mesh-declarations.h>
#include <dali/public-api/math/vector3.h>
namespace Dali
private:
Node& mNode; // weak reference to the Node
DynamicsWorld& mWorld;
- Mesh* mMesh;
DoubleBuffered<Vector3> mLinearVelocity;
DoubleBuffered<Vector3> mAngularVelocity;
+++ /dev/null
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/update/dynamics/scene-graph-dynamics-mesh-shape.h>
-
-// INTERNAL HEADERS
-#include <dali/integration-api/debug.h>
-#include <dali/integration-api/dynamics/dynamics-factory-intf.h>
-#include <dali/integration-api/dynamics/dynamics-shape-intf.h>
-#include <dali/internal/update/resources/resource-manager.h>
-#include <dali/internal/event/common/thread-local-storage.h>
-#include <dali/internal/update/dynamics/scene-graph-dynamics-world.h>
-#include <dali/internal/update/modeling/scene-graph-mesh.h>
-#include <dali/internal/update/modeling/internal-mesh-data.h>
-#include <dali/devel-api/dynamics/dynamics-shape.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace SceneGraph
-{
-
-DynamicsMeshShape::DynamicsMeshShape(DynamicsWorld& world, ResourceManager& resourceManager, const Integration::ResourceId meshId )
-: DynamicsShape(world),
- mResourceManager(resourceManager),
- mMeshId(meshId)
-{
- DALI_LOG_INFO(Debug::Filter::gDynamics, Debug::Verbose, "%s - meshId:%d\n", __PRETTY_FUNCTION__, static_cast<int>(mMeshId));
-}
-
-
-DynamicsMeshShape::~DynamicsMeshShape()
-{
- DALI_LOG_INFO(Debug::Filter::gDynamics, Debug::Verbose, "%s\n", __PRETTY_FUNCTION__);
-}
-
-void DynamicsMeshShape::Initialize()
-{
- DALI_LOG_INFO(Debug::Filter::gDynamics, Debug::Verbose, "%s\n", __PRETTY_FUNCTION__);
-
- mShape = mWorld.GetDynamicsFactory().CreateDynamicsShape();
-
- Mesh* mesh( GetMesh() );
- DALI_ASSERT_DEBUG( mesh );
-
- MeshData& meshData( mesh->GetMeshData(Mesh::UPDATE_THREAD ) );
- mShape->Initialize( Dali::DynamicsShape::MESH, meshData.GetVertices(), meshData.GetFaces() );
-
- DynamicsShape::Initialize();
-}
-
-Mesh* DynamicsMeshShape::GetMesh() const
-{
- return mResourceManager.GetMesh(mMeshId);
-}
-
-} // namespace SceneGraph
-
-} // namespace Internal
-
-} // namespace Dali