Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
DVDGeometryBuffer.inl
Go to the documentation of this file.
1/***********************************************************************
2 created: Wed, 8th Feb 2012
3 author: Lukas E Meindl (based on code by Paul D Turner)
4*************************************************************************/
5/***************************************************************************
6 * Copyright (C) 2004 - 2013 Paul D Turner & The CEGUI Development Team
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining
9 * a copy of this software and associated documentation files (the
10 * "Software"), to deal in the Software without restriction, including
11 * without limitation the rights to use, copy, modify, merge, publish,
12 * distribute, sublicense, and/or sell copies of the Software, and to
13 * permit persons to whom the Software is furnished to do so, subject to
14 * the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be
17 * included in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 ***************************************************************************/
27#pragma once
28#ifndef DVD_CEGUIDVDGeometryBuffer_inl_
29#define DVD_CEGUIDVDGeometryBuffer_inl_
30
31#include "DVDTexture.h"
32
33namespace CEGUI
34{
35
36inline void DVDGeometryBuffer::appendVertex( const Vertex& vertex )
37{
38 appendGeometry( &vertex, 1 );
39}
40
41inline void DVDGeometryBuffer::setTranslation( const Vector3f& v )
42{
43 _translation = v;
44 _matrixValid = false;
45}
46
47inline void DVDGeometryBuffer::setRotation( const Quaternion& r )
48{
49 _rotation = r;
50 _matrixValid = false;
51}
52
53inline void DVDGeometryBuffer::setPivot( const Vector3f& p )
54{
55 _pivot = Vector3f( p.d_x, p.d_y, p.d_z );
56 _matrixValid = false;
57}
58
59inline void DVDGeometryBuffer::setClippingRegion( const Rectf& region )
60{
61 _clipRect.top( ceguimax( 0.0f, region.top() ) );
62 _clipRect.left( ceguimax( 0.0f, region.left() ) );
63 _clipRect.bottom( ceguimax( 0.0f, region.bottom() ) );
64 _clipRect.right( ceguimax( 0.0f, region.right() ) );
65}
66
67inline void DVDGeometryBuffer::setActiveTexture( Texture* texture )
68{
69 _activeTexture = static_cast<DVDTexture*>(texture);
70}
71
73{
74 return _activeTexture;
75}
76
78{
79 return (uint)_vertices.size();
80}
81
83{
84 return (uint)_batches.size();
85}
86
87inline void DVDGeometryBuffer::setRenderEffect( RenderEffect* effect )
88{
89 _effect = effect;
90}
91
93{
94 return _effect;
95}
96
97inline void DVDGeometryBuffer::setClippingActive( const bool active )
98{
99 _clippingActive = active;
100}
101
103{
104 return _clippingActive;
105}
106
107}
108
109#endif //DVD_CEGUIDVDGeometryBuffer_inl_
BatchList _batches
list of texture batches added to the geometry buffer
Rectf _clipRect
rectangular clip region
bool isClippingActive() const override
void setTranslation(const Vector3f &t) override
Texture * getActiveTexture() const override
Vector3f _pivot
pivot point for rotation
RenderEffect * _effect
RenderEffect that will be used by the GeometryBuffer.
void setPivot(const Vector3f &p) override
Vector3f _translation
translation vector
uint getVertexCount() const override
VertexList _vertices
container where added geometry is stored.
void setRenderEffect(RenderEffect *effect) override
bool _clippingActive
whether clipping will be active for the current batch
DVDTexture * _activeTexture
last texture that was set as active
bool _matrixValid
true when d_matrix is valid and up to date
void appendGeometry(const Vertex *vbuff, uint vertex_count) override
void setClippingActive(bool active) override
uint getBatchCount() const override
void appendVertex(const Vertex &vertex) override
RenderEffect * getRenderEffect() override
Quaternion _rotation
rotation quaternion
void setActiveTexture(Texture *texture) override
void setClippingRegion(const Rectf &region) override
void setRotation(const Quaternion &r) override