/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
// CLASS HEADER
#include <dali/public-api/object/property-value.h>
+// EXTERNAL INCLUDES
+#include <ostream>
+
// INTERNAL INCLUDES
#include <dali/public-api/object/any.h>
#include <dali/public-api/math/angle-axis.h>
case Property::ROTATION:
{
- mImpl = new Impl( value.Get<Quaternion>() );
+ // Orientations have two representations
+ DALI_ASSERT_DEBUG( typeid(Quaternion) == value.mImpl->mValue.GetType() ||
+ typeid(AngleAxis) == value.mImpl->mValue.GetType() );
+
+ if ( typeid(Quaternion) == value.mImpl->mValue.GetType() )
+ {
+ mImpl = new Impl( value.Get<Quaternion>() );
+ }
+ else
+ {
+ mImpl = new Impl( value.Get<AngleAxis>() );
+ }
break;
}
case Property::ROTATION:
{
- mImpl = new Impl( Quaternion(0.f, Vector4::YAXIS) );
+ mImpl = new Impl( Quaternion( Radian(0.f), Vector3::YAXIS) );
break;
}
case Property::ROTATION:
{
- mImpl->mValue = value.Get<Quaternion>();
+ // Orientations have two representations
+ DALI_ASSERT_DEBUG( typeid(Quaternion) == value.mImpl->mValue.GetType() ||
+ typeid(AngleAxis) == value.mImpl->mValue.GetType() );
+
+ if ( typeid(Quaternion) == value.mImpl->mValue.GetType() )
+ {
+ mImpl = new Impl( value.Get<Quaternion>() );
+ }
+ else
+ {
+ mImpl = new Impl( value.Get<AngleAxis>() );
+ }
break;
}
{
Quaternion quaternion = AnyCast<Quaternion>(mImpl->mValue);
- Radian angleRadians(0.0f);
- quaternion.ToAxisAngle( angleAxisValue.axis, angleRadians );
- angleAxisValue.angle = angleRadians;
+ quaternion.ToAxisAngle( angleAxisValue.axis, angleAxisValue.angle );
}
else
{