1 #ifndef __SCENE_GRAPH_DYNAMICS_MESH_SHAPE_H__
2 #define __SCENE_GRAPH_DYNAMICS_MESH_SHAPE_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/internal/update/dynamics/scene-graph-dynamics-shape.h>
25 #include <dali/integration-api/resource-declarations.h>
26 #include <dali/internal/common/message.h>
27 #include <dali/internal/common/event-to-update.h>
28 #include <dali/internal/event/dynamics/dynamics-declarations.h>
29 #include <dali/internal/update/modeling/scene-graph-mesh-declarations.h>
37 class ResourceManager;
44 class DynamicsMeshShape : public DynamicsShape
49 * @param[in] world The dynamics world object
50 * @param[in] resourceManager The resource manager
51 * @param[in] meshId ID for the mesh resource
53 DynamicsMeshShape( DynamicsWorld& world, ResourceManager& resourceManager, const Integration::ResourceId meshId );
58 virtual ~DynamicsMeshShape();
61 * Initialize the mesh.
65 Mesh* GetMesh() const;
68 // unimplemented copy constructor and assignment operator
69 DynamicsMeshShape(const DynamicsMeshShape&);
70 DynamicsMeshShape& operator=(const DynamicsMeshShape&);
73 ResourceManager& mResourceManager;
74 Integration::ResourceId mMeshId;
75 }; // class DynamicsMeshShape
77 inline void InitializeDynamicsMeshShapeMessage( EventToUpdate& eventToUpdate, const DynamicsMeshShape& shape )
79 typedef Message< DynamicsMeshShape > LocalType;
81 // Reserve some memory inside the message queue
82 unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
84 // Construct message in the message queue memory; note that delete should not be called on the return value
85 new (slot) LocalType( &shape, &DynamicsMeshShape::Initialize );
88 } // namespace SceneGraph
90 } // namespace Internal
94 #endif // __SCENE_GRAPH_DYNAMICS_MESH_SHAPE_H__