00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OGRE 00004 (Object-oriented Graphics Rendering Engine) 00005 For the latest info, see http://www.ogre3d.org/ 00006 00007 Copyright © 2000-2002 The OGRE Team 00008 Also see acknowledgements in Readme.html 00009 00010 This program is free software; you can redistribute it and/or modify it under 00011 the terms of the GNU Lesser General Public License as published by the Free Software 00012 Foundation; either version 2 of the License, or (at your option) any later 00013 version. 00014 00015 This program is distributed in the hope that it will be useful, but WITHOUT 00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public License along with 00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00022 http://www.gnu.org/copyleft/lesser.txt. 00023 ----------------------------------------------------------------------------- 00024 */ 00025 #include "OgreStableHeaders.h" 00026 00027 #include "OgreBillboard.h" 00028 00029 #include "OgreBillboardSet.h" 00030 00031 namespace Ogre { 00032 00033 //----------------------------------------------------------------------- 00034 Billboard::Billboard(): 00035 mOwnDimensions(false), 00036 mPosition(Vector3::ZERO), 00037 mDirection(Vector3::ZERO), 00038 mParentSet(0), 00039 mColour(ColourValue::White), 00040 mRotation(0) 00041 { 00042 } 00043 //----------------------------------------------------------------------- 00044 Billboard::~Billboard() 00045 { 00046 } 00047 //----------------------------------------------------------------------- 00048 Billboard::Billboard(const Vector3& position, BillboardSet* owner, const ColourValue& colour) 00049 { 00050 mPosition = position; 00051 mOwnDimensions = false; 00052 mParentSet = owner; 00053 mColour = colour; 00054 } 00055 //----------------------------------------------------------------------- 00056 void Billboard::setRotation(const Radian& rotation) 00057 { 00058 mRotation = rotation; 00059 if (mRotation != Radian(0)) 00060 mParentSet->_notifyBillboardTextureCoordsModified(); 00061 } 00062 //----------------------------------------------------------------------- 00063 void Billboard::setPosition(const Vector3& position) 00064 { 00065 mPosition = position; 00066 } 00067 //----------------------------------------------------------------------- 00068 void Billboard::setPosition(Real x, Real y, Real z) 00069 { 00070 mPosition.x = x; 00071 mPosition.y = y; 00072 mPosition.z = z; 00073 } 00074 //----------------------------------------------------------------------- 00075 const Vector3& Billboard::getPosition(void) const 00076 { 00077 return mPosition; 00078 } 00079 //----------------------------------------------------------------------- 00080 void Billboard::setDimensions(Real width, Real height) 00081 { 00082 mOwnDimensions = true; 00083 mWidth = width; 00084 mHeight = height; 00085 mParentSet->_notifyBillboardResized(); 00086 } 00087 //----------------------------------------------------------------------- 00088 bool Billboard::hasOwnDimensions(void) const 00089 { 00090 return mOwnDimensions; 00091 } 00092 //----------------------------------------------------------------------- 00093 void Billboard::_notifyOwner(BillboardSet* owner) 00094 { 00095 mParentSet = owner; 00096 } 00097 //----------------------------------------------------------------------- 00098 void Billboard::setColour(const ColourValue& colour) 00099 { 00100 mColour = colour; 00101 } 00102 //----------------------------------------------------------------------- 00103 const ColourValue& Billboard::getColour(void) const 00104 { 00105 return mColour; 00106 } 00107 //----------------------------------------------------------------------- 00108 Real Billboard::getOwnWidth(void) const 00109 { 00110 return mWidth; 00111 } 00112 //----------------------------------------------------------------------- 00113 Real Billboard::getOwnHeight(void) const 00114 { 00115 return mHeight; 00116 } 00117 00118 00119 00120 00121 } 00122
Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:48:15 2004