utc-Dali-CustomActor.cpp
utc-Dali-Degree.cpp
utc-Dali-DistanceField.cpp
- utc-Dali-DynamicsBody.cpp
utc-Dali-DynamicsBodyConfig.cpp
- utc-Dali-DynamicsJoint.cpp
utc-Dali-DynamicsShape.cpp
utc-Dali-DynamicsWorld.cpp
utc-Dali-DynamicsWorldConfig.cpp
#include <dali/internal/event/actor-attachments/actor-attachment-impl.h>
#include <dali/internal/event/animation/constraint-impl.h>
-#include <dali/public-api/dynamics/dynamics-body.h>
-#include <dali/public-api/dynamics/dynamics-joint.h>
-#include <dali/public-api/dynamics/dynamics-body-config.h>
-
-#ifdef DYNAMICS_SUPPORT
-#include <dali/internal/event/dynamics/dynamics-declarations.h>
-#include <dali/internal/event/dynamics/dynamics-body-config-impl.h>
-#include <dali/internal/event/dynamics/dynamics-body-impl.h>
-#include <dali/internal/event/dynamics/dynamics-joint-impl.h>
-#include <dali/internal/event/dynamics/dynamics-world-impl.h>
-#endif
-
namespace Dali
{
return GetImplementation(*this).OffStageSignal();
}
-DynamicsBody Actor::EnableDynamics(DynamicsBodyConfig bodyConfig)
-{
-#ifdef DYNAMICS_SUPPORT
- Internal::DynamicsBodyConfig& internal = GetImplementation(bodyConfig);
-
- Internal::DynamicsBodyPtr body( GetImplementation(*this).EnableDynamics( &internal ) );
-
- return DynamicsBody( body.Get() );
-#else
- return DynamicsBody();
-#endif
-}
-
-DynamicsJoint Actor::AddDynamicsJoint( Actor attachedActor, const Vector3& offset )
-{
-#ifdef DYNAMICS_SUPPORT
- Internal::ActorPtr internalActor( &GetImplementation(attachedActor) );
- Internal::DynamicsJointPtr joint( GetImplementation(*this).AddDynamicsJoint( internalActor, offset) );
-
- return DynamicsJoint( joint.Get() );
-#else
- return DynamicsJoint();
-#endif
-}
-
-DynamicsJoint Actor::AddDynamicsJoint( Actor attachedActor, const Vector3& offsetA, const Vector3& offsetB )
-{
-#ifdef DYNAMICS_SUPPORT
- Internal::ActorPtr internalActor( &GetImplementation(attachedActor) );
- Internal::DynamicsJointPtr joint( GetImplementation(*this).AddDynamicsJoint( internalActor, offsetA, offsetB) );
-
- return DynamicsJoint( joint.Get() );
-#else
- return DynamicsJoint();
-#endif
-}
-
-int Actor::GetNumberOfJoints() const
-{
-#ifdef DYNAMICS_SUPPORT
- return GetImplementation(*this).GetNumberOfJoints();
-#else
- return int();
-#endif
-}
-
-DynamicsJoint Actor::GetDynamicsJointByIndex( const int index )
-{
-#ifdef DYNAMICS_SUPPORT
- Internal::DynamicsJointPtr joint( GetImplementation(*this).GetDynamicsJointByIndex( index ) );
-
- return DynamicsJoint( joint.Get() );
-#else
- return DynamicsJoint();
-#endif
-}
-
-DynamicsJoint Actor::GetDynamicsJoint( Actor attachedActor )
-{
-#ifdef DYNAMICS_SUPPORT
- Internal::DynamicsJointPtr joint( GetImplementation(*this).GetDynamicsJoint( &GetImplementation(attachedActor) ) );
-
- return DynamicsJoint( joint.Get() );
-#else
- return DynamicsJoint();
-#endif
-}
-
-void Actor::RemoveDynamicsJoint( DynamicsJoint joint )
-{
-#ifdef DYNAMICS_SUPPORT
- GetImplementation(*this).RemoveDynamicsJoint( &GetImplementation(joint) );
-#endif
-}
-
-void Actor::DisableDynamics()
-{
-#ifdef DYNAMICS_SUPPORT
- GetImplementation(*this).DisableDynamics();
-#endif
-}
-
-DynamicsBody Actor::GetDynamicsBody()
-{
-#ifdef DYNAMICS_SUPPORT
- Internal::DynamicsBodyPtr internal(GetImplementation(*this).GetDynamicsBody());
- return DynamicsBody( internal.Get() );
-#else
- return DynamicsBody();
-#endif
-}
-
Actor::Actor(Internal::Actor* internal)
: Handle(internal)
{
class Animation;
class Constraint;
struct Degree;
-class DynamicsBody;
-class DynamicsBodyConfig;
-class DynamicsJoint;
class Quaternion;
class Layer;
struct Radian;
*/
OffStageSignalType& OffStageSignal();
-public: // Dynamics
-
- /**
- * @brief Enable dynamics for this actor.
- *
- * The actor will behave as a rigid/soft body in the simulation
- * @pre The actor is not already acting as a DynamicsBody and IsDynamicsRoot() returns false
- *
- * @param [in] bodyConfig The DynamicsBodyConfig specifying the dynamics properties for this actor in the dynamics world.
- * @return The DynamicsBody
- */
- DynamicsBody EnableDynamics(DynamicsBodyConfig bodyConfig);
-
- /**
- * @brief Add a joint constraint to this actor.
- *
- * @param[in] attachedActor The other actor in the joint
- * @param[in] offset The offset (relative to this actor) of the origin of the joint
- * @return The new joint
- * @pre Both actors are dynamics enabled actors (IE Actor::EnableDynamics()) has been invoked for both actors).
- * @post If the two actors are already connected by a joint, The existing joint is returned
- * and offset is ignored.
- */
- DynamicsJoint AddDynamicsJoint( Actor attachedActor, const Vector3& offset );
-
- /**
- * @brief Add a joint constraint to this actor.
- *
- * @param[in] attachedActor The other actor in the joint
- * @param[in] offsetA The offset (relative to this actor) of the origin of the joint
- * @param[in] offsetB The offset (relative to attachedActor) of the origin of the joint
- * @return The new joint
- * @pre Both actors are dynamics enabled actors (IE Actor::EnableDynamics()) has been invoked for both actors).
- * @post If the two actors are already connected by a joint, The existing joint is returned
- * and offset is ignored.
- */
- DynamicsJoint AddDynamicsJoint( Actor attachedActor, const Vector3& offsetA, const Vector3& offsetB );
-
- /**
- * @brief Get the number of DynamicsJoint objects added to this actor.
- *
- * @return The number of DynamicsJoint objects added to this actor
- */
- int GetNumberOfJoints() const;
-
- /**
- * @brief Get a joint by index.
- *
- * @param[in] index The index of the joint.
- * Use GetNumberOfJoints to get the valid range of indices.
- * @return The joint.
- */
- DynamicsJoint GetDynamicsJointByIndex( const int index );
-
- /**
- * @brief Get the joint between this actor and attachedActor.
- *
- * @param[in] attachedActor The other actor in the joint
- * @return The joint.
- */
- DynamicsJoint GetDynamicsJoint( Actor attachedActor );
-
- /**
- * @brief Remove a joint from this actor
- *
- * @param[in] joint The joint to be removed
- */
- void RemoveDynamicsJoint( DynamicsJoint joint );
-
- /**
- * @brief Disable dynamics for this actor.
- *
- * The actor will be detached from the DynamicsBody/DynamicsJoint associated with it through EnableDynamics
- */
- void DisableDynamics();
-
- /**
- * @brief Get the associated DynamicsBody.
- *
- * @return A DynamicsBody
- */
- DynamicsBody GetDynamicsBody();
-
public: // Not intended for application developers
/**