ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

stark/visual/actor.h

Go to the documentation of this file.
00001 /* ResidualVM - A 3D game interpreter
00002  *
00003  * ResidualVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the AUTHORS
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef STARK_VISUAL_ACTOR_H
00024 #define STARK_VISUAL_ACTOR_H
00025 
00026 #include "engines/stark/visual/visual.h"
00027 
00028 #include "common/array.h"
00029 #include "common/rect.h"
00030 
00031 #include "math/matrix4.h"
00032 #include "math/ray.h"
00033 #include "math/vector3d.h"
00034 
00035 
00036 namespace Stark {
00037 
00038 namespace Gfx {
00039 class Texture;
00040 class TextureSet;
00041 struct LightEntry;
00042 }
00043 
00044 class Model;
00045 struct Face;
00046 struct Material;
00047 class SkeletonAnim;
00048 class AnimHandler;
00049 
00050 
00051 class VisualActor : public Visual {
00052 public:
00053     static const VisualType TYPE = Visual::kActor;
00054 
00055     VisualActor();
00056     ~VisualActor() override;
00057 
00058     void setModel(Model *model);
00059     void setTexture(Gfx::TextureSet *texture);
00060     void setTextureFacial(Gfx::TextureSet *textureFacial);
00061     void setNewFace(char shape);
00062 
00063     void setAnimHandler(AnimHandler *animHandler);
00064     void setTime(uint32 time);
00065 
00066     void setCastShadow(bool cast) { _castsShadow = cast; }
00067 
00068     bool intersectRay(const Math::Ray &ray, const Math::Vector3d &position, float direction);
00069     Common::Rect getBoundingRect(const Math::Vector3d &position3d, float direction) const;
00070 
00071     virtual void render(const Math::Vector3d &position, float direction, const Common::Array<Gfx::LightEntry *> &lights) = 0;
00072 
00073 protected:
00074     AnimHandler *_animHandler;
00075     Model *_model;
00076     Gfx::TextureSet *_textureSet;
00077     Gfx::TextureSet *_textureSetFacial;
00078     char _faceTextureName;
00079     uint32 _time;
00080     bool _modelIsDirty;
00081     bool _castsShadow;
00082 
00083     Math::Matrix4 getModelMatrix(const Math::Vector3d &position, float direction) const;
00084     const Gfx::Texture *resolveTexture(const Material *material) const;
00085 };
00086 
00087 } // End of namespace Stark
00088 
00089 #endif // STARK_VISUAL_ACTOR_H


Generated on Sat Feb 9 2019 05:00:25 for ResidualVM by doxygen 1.7.1
curved edge   curved edge