From 4e65d070a1732b7b6d1a7c5be7ce646025b72538 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Wed, 3 Sep 2014 18:19:12 +0800 Subject: [PATCH] rename BillBoard Model --- cocos/3d/CCBillBoard.cpp | 8 ++++---- cocos/3d/CCBillBoard.h | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cocos/3d/CCBillBoard.cpp b/cocos/3d/CCBillBoard.cpp index a987f9dfd6..adbafea6bb 100644 --- a/cocos/3d/CCBillBoard.cpp +++ b/cocos/3d/CCBillBoard.cpp @@ -33,7 +33,7 @@ NS_CC_BEGIN BillBorad::BillBorad() : _zDepthInView(0.0f) -, _mode(Mode::View_Oriented) +, _mode(Mode::View_Point_Oriented) { } @@ -105,7 +105,7 @@ void BillBorad::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) Vec3 camDir; switch (_mode) { - case Mode::View_Oriented: + case Mode::View_Point_Oriented: camDir = Vec3(transform.m[12] - camWorldMat.m[12], transform.m[13] - camWorldMat.m[13], transform.m[14] - camWorldMat.m[14]); break; case Mode::View_Plane_Oriented: @@ -144,8 +144,8 @@ void BillBorad::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) //FIXME: frustum culling here { - _quadCommand.init(_zDepthInView, _texture->getName(), getGLProgramState(), _blendFunc, &_quad, 1, _billboardTransform); - renderer->addTransparentCommand(&_quadCommand); + _quadCommand.init(_zDepthInView, _texture->getName(), getGLProgramState(), _blendFunc, &_quad, 1, _billboardTransform); + renderer->addTransparentCommand(&_quadCommand); } } diff --git a/cocos/3d/CCBillBoard.h b/cocos/3d/CCBillBoard.h index be80932060..2edef15ac4 100644 --- a/cocos/3d/CCBillBoard.h +++ b/cocos/3d/CCBillBoard.h @@ -38,7 +38,7 @@ public: enum class Mode { - View_Oriented, + View_Point_Oriented, View_Plane_Oriented }; /// @{ @@ -49,7 +49,7 @@ public: * * @return An autoreleased BillBorad object. */ - static BillBorad* create(Mode mode = Mode::View_Oriented); + static BillBorad* create(Mode mode = Mode::View_Point_Oriented); /** * Creates a BillBorad with an image filename. @@ -60,7 +60,7 @@ public: * @param filename A path to image file, e.g., "scene1/monster.png" * @return An autoreleased BillBorad object. */ - static BillBorad* create(const std::string& filename, Mode mode = Mode::View_Oriented); + static BillBorad* create(const std::string& filename, Mode mode = Mode::View_Point_Oriented); /** * Creates a BillBorad with an image filename and a rect. @@ -69,7 +69,7 @@ public: * @param rect A subrect of the image file * @return An autoreleased BillBorad object */ - static BillBorad* create(const std::string& filename, const Rect& rect, Mode mode = Mode::View_Oriented); + static BillBorad* create(const std::string& filename, const Rect& rect, Mode mode = Mode::View_Point_Oriented); /** * Creates a BillBorad with a Texture2D object. @@ -79,7 +79,7 @@ public: * @param texture A pointer to a Texture2D object. * @return An autoreleased BillBorad object */ - static BillBorad* createWithTexture(Texture2D *texture, Mode mode = Mode::View_Oriented); + static BillBorad* createWithTexture(Texture2D *texture, Mode mode = Mode::View_Point_Oriented); /** Set the billboard rotation mode. */ void setMode(Mode mode);