1 #ifndef __DALI_DYNAMICS_COLLISION_H__
2 #define __DALI_DYNAMICS_COLLISION_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.
21 // BASE CLASS INCLUDES
22 #include <dali/public-api/object/base-handle.h>
24 namespace Dali DALI_IMPORT_API
30 namespace Internal DALI_INTERNAL
33 class DynamicsCollision;
35 } // namespace Internal
38 * @brief Contains information about a collision between two actors.
40 class DynamicsCollision : public BaseHandle
44 * @brief Create an uninitialized handle.
46 * Initialized handles are received in DynamicsWorld::SignalCollision handlers
51 * @brief Virtual destructor.
53 virtual ~DynamicsCollision();
56 * @copydoc Dali::BaseHandle::operator=
58 using BaseHandle::operator=;
62 * @brief Get the first actor in the collision.
64 * @return The first actor in the collision
69 * @brief Get the second actor in the collision.
71 * @return The second actor in the collision
76 * @brief Get the force of the impact.
78 * @return the impact force
79 * @note currently returns 0.5f for a new collision and 0.0f for dispersal
81 float GetImpactForce() const;
84 * @brief Get the point of contact on the first Actor.
86 * @return The point of contact on the first Actor
88 Vector3 GetPointOnA() const;
91 * @brief Get the point of contact on the second Actor.
93 * @return The point of contact on the second Actor
95 Vector3 GetPointOnB() const;
98 * @brief Get the collision normal.
100 * @return The collision normal
102 Vector3 GetNormal() const;
104 // Not intended for application developers
107 * @brief This constructor is used internally by Dali.
109 * @param [in] internal A pointer to a newly allocated Dali resource
111 explicit DALI_INTERNAL DynamicsCollision( Internal::DynamicsCollision* internal );
112 }; // class DynamicsCollision
116 #endif /* __DALI_DYNAMICS_COLLISION_H__ */