Project

General

Profile

SO3Engine
SO3RayCast.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
29#ifndef __SO3_RAYCAST_H__
30#define __SO3_RAYCAST_H__
31
33
34namespace SO3
35{
36
41{
42public:
44 std::string sceneName;
47 std::string entityName;
50 Ogre::Vector3 point;
53 Ogre::Vector3 v1;
54 Ogre::Vector3 v2;
55 Ogre::Vector3 v3;
56 Ogre::Vector2 pReal1;
57 Ogre::Vector2 pReal2;
58 Ogre::Vector2 pReal3;
59 Ogre::Vector2 uvResult;
60protected:
61private:
62
63public:
68
72 SRaycastResult(const SRaycastResult& copiedRaycast);
73protected:
74private:
75};
76
80{
81public:
82protected:
83private:
84
85public:
89 static SRaycastResult Cast(SCamera* camera, const float& relativePosX, const float& relativePosY, Ogre::SubEntity* subEntity, bool getUvCoordonate=false);
90
91 static SRaycastResult Cast(Ogre::Camera* camera, const float& relativePosX, const float& relativePosY, Ogre::SubEntity* subEntity, bool getUvCoordonate = false);
92
96 static SRaycastResult Cast(SScene* sm, Ogre::Vector3 pos, Ogre::Vector3 dir, Ogre::Real maxdist, bool getUvCoordonate = false);
97
101 static void GetMeshInformation(const Ogre::MeshPtr mesh, size_t &vertex_count, Ogre::Vector3* &vertices, size_t &index_count, unsigned long* &indices, const Ogre::Vector3 &position, const Ogre::Quaternion &orient, const Ogre::Vector3 &scale);
102protected:
103private:
107 SRaycast();
108
111 static void GetSubEntityInformation(Ogre::SubEntity* subEntity, size_t &vertex_count, Ogre::Vector3* &vertices, size_t &index_count, unsigned long* &indices);
112};
113
114}
115
116#endif
librairies include
static SRaycastResult Cast(SCamera *camera, const float &relativePosX, const float &relativePosY, Ogre::SubEntity *subEntity, bool getUvCoordonate=false)
static void GetMeshInformation(const Ogre::MeshPtr mesh, size_t &vertex_count, Ogre::Vector3 *&vertices, size_t &index_count, unsigned long *&indices, const Ogre::Vector3 &position, const Ogre::Quaternion &orient, const Ogre::Vector3 &scale)
Ogre::Vector3 point
Definition SO3RayCast.h:50
std::string sceneName
Definition SO3RayCast.h:44
std::string entityName
Definition SO3RayCast.h:47
SMaterial * material
Definition SO3RayCast.h:48
SViewPort * viewport
Definition SO3RayCast.h:45
Ogre::Vector2 pReal2
Definition SO3RayCast.h:57
Ogre::Vector3 v1
Definition SO3RayCast.h:53
Ogre::Vector3 v2
Definition SO3RayCast.h:54
Ogre::Vector2 uvResult
Definition SO3RayCast.h:59
Ogre::Vector2 pReal3
Definition SO3RayCast.h:58
Ogre::Vector3 v3
Definition SO3RayCast.h:55
Ogre::Vector2 pReal1
Definition SO3RayCast.h:56