Actor meshActor = Actor::New();
meshActor.AddRenderer( renderer );
- meshActor.SetSize(400, 400);
+ meshActor.SetSize( Vector3( 400.0f, 400.0f, 0.1f) );
drawTrace.Reset();
meshActor.SetParentOrigin( ParentOrigin::CENTER );
Actor meshActor = Actor::New();
meshActor.AddRenderer( renderer );
- meshActor.SetSize(400, 400);
+ meshActor.SetSize( Vector3( 400.0f, 400.0f, 0.1f) );
drawTrace.Reset();
- meshActor.SetParentOrigin( Vector3( -0.42f, 0.5f, 0.5f ) );
- meshActor.SetAnchorPoint( AnchorPoint::CENTER );
+ float offset = -0.01f;
+
+ meshActor.SetParentOrigin( Vector3( offset, 0.5f, 0.5f ) );
+ meshActor.SetAnchorPoint( AnchorPoint::CENTER_RIGHT );
Stage::GetCurrent().Add( meshActor );
application.SendNotification();
// This will be box culled
DALI_TEST_CHECK( !drawTrace.FindMethod( "DrawElements" ) );
+ float radius = meshActor.GetTargetSize().Length() * 0.5f;
+ Vector2 stageSize = Stage::GetCurrent().GetSize();
+
drawTrace.Reset();
- meshActor.SetParentOrigin( Vector3( -0.5f, 0.5f, 0.5f ) );
+ meshActor.SetParentOrigin( Vector3( -radius/stageSize.width + offset, 0.5f, 0.5f ) );
+ meshActor.SetAnchorPoint( AnchorPoint::CENTER );
application.SendNotification();
application.Render(16);
// This will be sphere culled
DALI_TEST_CHECK( !drawTrace.FindMethod( "DrawElements" ) );
+
END_TEST;
}
Actor meshActor = Actor::New();
meshActor.AddRenderer( renderer );
- meshActor.SetSize(400, 400);
+ meshActor.SetSize( Vector3( 400.0f, 400.0f, 0.1f) );
drawTrace.Reset();
- meshActor.SetParentOrigin( Vector3( 1.42f, 0.5f, 0.5f ) );
- meshActor.SetAnchorPoint( AnchorPoint::CENTER );
+ float offset = 1.01f;
+
+ meshActor.SetParentOrigin( Vector3( offset, 0.5f, 0.5f ) );
+ meshActor.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
Stage::GetCurrent().Add( meshActor );
application.SendNotification();
application.Render(16);
- // This should be box culled
+ // This will be box culled
DALI_TEST_CHECK( !drawTrace.FindMethod( "DrawElements" ) );
+ float radius = meshActor.GetTargetSize().Length() * 0.5f;
+ Vector2 stageSize = Stage::GetCurrent().GetSize();
+
drawTrace.Reset();
- meshActor.SetParentOrigin( Vector3( 1.5f, 0.0f, 0.5f ) );
+ meshActor.SetParentOrigin( Vector3( radius/stageSize.width + offset, 0.5f, 0.5f ) );
+ meshActor.SetAnchorPoint( AnchorPoint::CENTER );
application.SendNotification();
application.Render(16);
- // This should be sphere culled
+ // This will be sphere culled
DALI_TEST_CHECK( !drawTrace.FindMethod( "DrawElements" ) );
+
END_TEST;
}
Actor meshActor = Actor::New();
meshActor.AddRenderer( renderer );
- meshActor.SetSize(400, 400);
+ meshActor.SetSize( Vector3( 400.0f, 400.0f, 0.1f) );
drawTrace.Reset();
- meshActor.SetParentOrigin( Vector3( 0.5f, -0.32f, 0.5f ) );
- meshActor.SetAnchorPoint( AnchorPoint::CENTER );
+ float offset = -0.01f;
+
+ meshActor.SetParentOrigin( Vector3( 0.5f, offset, 0.5f ) );
+ meshActor.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
Stage::GetCurrent().Add( meshActor );
application.SendNotification();
application.Render(16);
- // This should be box culled
+ // This will be box culled
DALI_TEST_CHECK( !drawTrace.FindMethod( "DrawElements" ) );
+ float radius = meshActor.GetTargetSize().Length() * 0.5f;
+ Vector2 stageSize = Stage::GetCurrent().GetSize();
+
drawTrace.Reset();
- meshActor.SetParentOrigin( Vector3( 0.5f, -0.5f, 0.5f ) );
+ meshActor.SetParentOrigin( Vector3( 0.5f, -radius/stageSize.width + offset, 0.5f ) );
+ meshActor.SetAnchorPoint( AnchorPoint::CENTER );
application.SendNotification();
application.Render(16);
// This will be sphere culled
DALI_TEST_CHECK( !drawTrace.FindMethod( "DrawElements" ) );
+
END_TEST;
}
Actor meshActor = Actor::New();
meshActor.AddRenderer( renderer );
- meshActor.SetSize(400, 400);
+ meshActor.SetSize( Vector3( 400.0f, 400.0f, 0.1f) );
drawTrace.Reset();
- meshActor.SetParentOrigin( Vector3( 0.5f, 1.32f, 0.5f ) );
- meshActor.SetAnchorPoint( AnchorPoint::CENTER );
+ float offset = 1.01f;
+
+ meshActor.SetParentOrigin( Vector3( 0.5f, offset, 0.5f ) );
+ meshActor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
Stage::GetCurrent().Add( meshActor );
application.SendNotification();
application.Render(16);
- // This should be box culled
+ // This will be box culled
DALI_TEST_CHECK( !drawTrace.FindMethod( "DrawElements" ) );
+ float radius = meshActor.GetTargetSize().Length() * 0.5f;
+ Vector2 stageSize = Stage::GetCurrent().GetSize();
+
drawTrace.Reset();
- meshActor.SetParentOrigin( Vector3( 0.5f, 1.5f, 0.5f ) );
+ meshActor.SetParentOrigin( Vector3( 0.5f, radius/stageSize.width + offset, 0.5f ) );
+ meshActor.SetAnchorPoint( AnchorPoint::CENTER );
application.SendNotification();
application.Render(16);
// This will be sphere culled
DALI_TEST_CHECK( !drawTrace.FindMethod( "DrawElements" ) );
+
END_TEST;
}
Actor meshActor = Actor::New();
meshActor.AddRenderer( renderer );
- meshActor.SetSize(400, 400);
+ meshActor.SetSize( Vector3( 400.0f, 400.0f, 0.1f) );
drawTrace.Reset();
meshActor.SetParentOrigin( Vector3( 0.5f, 0.5f, 7.0f ) );
Actor meshActor = Actor::New();
meshActor.AddRenderer( renderer );
- meshActor.SetSize(400, 400);
+ meshActor.SetSize( Vector3( 400.0f, 400.0f, 0.1f) );
drawTrace.Reset();
meshActor.SetParentOrigin( Vector3( 0.5f, 0.5f, -7.0f ) );
Actor meshActor = Actor::New();
meshActor.AddRenderer( renderer );
- meshActor.SetSize(400, 400);
+ meshActor.SetSize( Vector3( 400.0f, 400.0f, 0.1f) );
drawTrace.Reset();
- meshActor.SetParentOrigin( Vector3( 0.5f, 0.5f, -7.0f ) );
+ meshActor.SetParentOrigin( ParentOrigin::CENTER );
meshActor.SetAnchorPoint( AnchorPoint::CENTER );
Stage::GetCurrent().Add( meshActor );
DALI_PROPERTY_TABLE_BEGIN
DALI_PROPERTY( "geometry-type", STRING, true, false, true, Dali::Geometry::Property::GEOMETRY_TYPE )
DALI_PROPERTY( "geometry-center", VECTOR3, true, true, true, Dali::Geometry::Property::GEOMETRY_CENTER )
-DALI_PROPERTY( "geometry-half-extents", VECTOR3, true, true, true, Dali::Geometry::Property::GEOMETRY_HALF_EXTENTS )
DALI_PROPERTY( "requires-depth-test", BOOLEAN, true, false, true, Dali::Geometry::Property::REQUIRES_DEPTH_TEST )
DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX )
SceneGraph::AnimatablePropertyMessage<Vector3>::Send( GetEventThreadServices(), mSceneObject, &mSceneObject->mCenter, &SceneGraph::AnimatableProperty<Vector3>::Bake, propertyValue.Get<Vector3>() );
break;
}
-
- case Dali::Geometry::Property::GEOMETRY_HALF_EXTENTS :
- {
- SceneGraph::AnimatablePropertyMessage<Vector3>::Send( GetEventThreadServices(), mSceneObject, &mSceneObject->mHalfExtents, &SceneGraph::AnimatableProperty<Vector3>::Bake, propertyValue.Get<Vector3>() );
- break;
- }
-
case Dali::Geometry::Property::REQUIRES_DEPTH_TEST :
{
SceneGraph::DoubleBufferedPropertyMessage<bool>::Send( GetEventThreadServices(), mSceneObject, &mSceneObject->mRequiresDepthTest, &SceneGraph::DoubleBufferedProperty<bool>::Set, propertyValue.Get<bool>() );
break;
}
- case Dali::Geometry::Property::GEOMETRY_HALF_EXTENTS :
- {
- if( mSceneObject )
- {
- value = mSceneObject->mHalfExtents[bufferIndex];
- }
- break;
- }
-
case Dali::Geometry::Property::REQUIRES_DEPTH_TEST :
{
if( mSceneObject )
property = &mSceneObject->mCenter;
break;
}
- case Dali::Geometry::Property::GEOMETRY_HALF_EXTENTS :
- {
- property = &mSceneObject->mHalfExtents;
- break;
- }
default:
{
DALI_ASSERT_ALWAYS( 0 && "Property is not animatable" );
property = &mSceneObject->mCenter;
break;
}
- case Dali::Geometry::Property::GEOMETRY_HALF_EXTENTS :
- {
- property = &mSceneObject->mHalfExtents;
- break;
- }
case Dali::Geometry::Property::REQUIRES_DEPTH_TEST :
{
property = &mSceneObject->mRequiresDepthTest;