/src/ogre/OgreMain/src/OgreBillboard.cpp
Line | Count | Source |
1 | | /* |
2 | | ----------------------------------------------------------------------------- |
3 | | This source file is part of OGRE |
4 | | (Object-oriented Graphics Rendering Engine) |
5 | | For the latest info, see http://www.ogre3d.org/ |
6 | | |
7 | | Copyright (c) 2000-2014 Torus Knot Software Ltd |
8 | | |
9 | | Permission is hereby granted, free of charge, to any person obtaining a copy |
10 | | of this software and associated documentation files (the "Software"), to deal |
11 | | in the Software without restriction, including without limitation the rights |
12 | | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
13 | | copies of the Software, and to permit persons to whom the Software is |
14 | | furnished to do so, subject to the following conditions: |
15 | | |
16 | | The above copyright notice and this permission notice shall be included in |
17 | | all copies or substantial portions of the Software. |
18 | | |
19 | | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
20 | | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
21 | | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
22 | | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
23 | | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
24 | | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
25 | | THE SOFTWARE. |
26 | | ----------------------------------------------------------------------------- |
27 | | */ |
28 | | #include "OgreStableHeaders.h" |
29 | | |
30 | | #include "OgreBillboard.h" |
31 | | #include "OgreBillboardSet.h" |
32 | | |
33 | | namespace Ogre { |
34 | | |
35 | | //----------------------------------------------------------------------- |
36 | | Billboard::Billboard(): |
37 | 0 | mOwnDimensions(false), |
38 | 0 | mUseTexcoordRect(false), |
39 | 0 | mTexcoordIndex(0), |
40 | 0 | mPosition(Vector3::ZERO), |
41 | 0 | mDirection(Vector3::ZERO), |
42 | 0 | mColour(0xFFFFFFFF), |
43 | 0 | mRotation(0) |
44 | 0 | { |
45 | 0 | } |
46 | | //----------------------------------------------------------------------- |
47 | | Billboard::~Billboard() |
48 | 0 | { |
49 | 0 | } |
50 | | //----------------------------------------------------------------------- |
51 | | Billboard::Billboard(const Vector3& position, BillboardSet* owner, const ColourValue& colour) |
52 | 0 | : mOwnDimensions(false) |
53 | 0 | , mUseTexcoordRect(false) |
54 | 0 | , mTexcoordIndex(0) |
55 | 0 | , mPosition(position) |
56 | 0 | , mDirection(Vector3::ZERO) |
57 | 0 | , mColour(colour.getAsBYTE()) |
58 | 0 | , mRotation(0) |
59 | 0 | { |
60 | 0 | } |
61 | | //----------------------------------------------------------------------- |
62 | | void Billboard::setDimensions(float width, float height) |
63 | 0 | { |
64 | 0 | mOwnDimensions = true; |
65 | 0 | mWidth = width; |
66 | 0 | mHeight = height; |
67 | 0 | } |
68 | | //----------------------------------------------------------------------- |
69 | | void Billboard::setTexcoordIndex(uint16 texcoordIndex) |
70 | 0 | { |
71 | 0 | mTexcoordIndex = texcoordIndex; |
72 | 0 | mUseTexcoordRect = false; |
73 | 0 | } |
74 | | //----------------------------------------------------------------------- |
75 | | void Billboard::setTexcoordRect(const FloatRect& texcoordRect) |
76 | 0 | { |
77 | 0 | mTexcoordRect = texcoordRect; |
78 | 0 | mUseTexcoordRect = true; |
79 | 0 | } |
80 | | } |
81 | | |