RenderItem::RenderItem()
: mModelMatrix( false ),
mModelViewMatrix( false ),
+ mColor( Vector4::ZERO ),
mSize(),
- mRenderer( NULL ),
- mNode( NULL ),
- mTextureSet( NULL ),
+ mRenderer( nullptr ),
+ mNode( nullptr ),
+ mTextureSet( nullptr ),
mDepthIndex( 0 ),
- mIsOpaque( true )
+ mIsOpaque( true ),
+ mIsUpdated( false )
{
}
-RenderItem::~RenderItem()
-{
-}
+RenderItem::~RenderItem() = default;
-
-ClippingBox RenderItem::CalculateViewportSpaceAABB( const int viewportWidth, const int viewportHeight ) const
+ClippingBox RenderItem::CalculateViewportSpaceAABB( const Vector3& size, const int viewportWidth, const int viewportHeight ) const
{
// Calculate extent vector of the AABB:
- const float halfActorX = mSize.x * 0.5f;
- const float halfActorY = mSize.y * 0.5f;
+ const float halfActorX = size.x * 0.5f;
+ const float halfActorY = size.y * 0.5f;
// To transform the actor bounds to screen-space, We do a fast, 2D version of a matrix multiply optimized for 2D quads.
// This reduces float multiplications from 64 (16 * 4) to 12 (4 * 3).
static_cast<float>( viewportWidth ) * 0.5f - aabb.x,
static_cast<float>( viewportHeight ) * 0.5f - aabb.y );
- int x = static_cast< int >( roundf( aabbInScreen.x ) );
- int y = static_cast< int >( roundf( aabbInScreen.y ) );
+ int x = static_cast< int >( floor( aabbInScreen.x ) );
+ int y = static_cast< int >( floor( aabbInScreen.y ) );
int z = static_cast< int >( roundf( aabbInScreen.z ) );
int w = static_cast< int >( roundf( aabbInScreen.w ) );
gRenderItemPool.Free( static_cast<RenderItem*>( ptr ) );
}
-
} // namespace SceneGraph
} // namespace Internal