Rigs of Rods 2023.09
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
Ellipsoid.h
Go to the documentation of this file.
1/*
2--------------------------------------------------------------------------------
3This source file is part of SkyX.
4Visit http://www.paradise-studios.net/products/skyx/
5
6Copyright (C) 2009-2012 Xavier Vergu�n Gonz�lez <xavyiy@gmail.com>
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#ifndef _SkyX_VClouds_Ellipsoid_H_
25#define _SkyX_VClouds_Ellipsoid_H_
26
27#include "Prerequisites.h"
28
29#include "DataManager.h"
30
31namespace SkyX { namespace VClouds{
32
39 {
40 public:
53 Ellipsoid(const int& a, const int& b, const int& c,
54 const int& nx, const int& ny, const int& nz,
55 const int& x, const int& y, const int& z,
56 const Ogre::Real& DynLibManager = 1.0f);
57
60 ~Ellipsoid();
61
67 void move(const int& Ax, const int& Ay, const int& Az);
68
75 const Ogre::Vector3 getProbabilities(const int& x, const int& y, const int& z) const;
76
84 void updateProbabilities(DataManager::Cell ***c, const int &nx, const int &ny, const int &nz, const bool& delayedResponse = true);
85
88 const bool isOutOfCells() const;
89
93 inline const Ogre::Vector3 getDimensions() const
94 {
95 return Ogre::Vector3(mA, mB, mC);
96 }
97
101 inline const Ogre::Vector3 getPosition() const
102 {
103 return Ogre::Vector3(mX, mY, mZ);
104 }
105
109 void setDimensions(const Ogre::Vector3& Dimensions);
110
114 inline void setPosition(const Ogre::Vector3& Position)
115 {
116 mX = Position.x;
117 mY = Position.y;
118 mZ = Position.z;
119 }
120
121 private:
128 const float _getLength(const int& x, const int& y, const int& z) const;
129
131 int mA, mB, mC, mA2, mB2, mC2;
132
134 int mX, mY, mZ;
135
137 int mNx, mNy, mNz;
138
140 Ogre::Real mDensity;
141 };
142
143}}
144
145#endif
Ellipsoid class x^2 y^2 z^2 / + / + / = 1 a^2 b^2 c^2.
Definition Ellipsoid.h:39
void setPosition(const Ogre::Vector3 &Position)
Set position.
Definition Ellipsoid.h:114
const Ogre::Vector3 getPosition() const
Get position.
Definition Ellipsoid.h:101
const bool isOutOfCells() const
Determines if the ellipsoid is out of the cells domain and needs to be removed.
int mA
Ellipsoid parameters.
Definition Ellipsoid.h:131
Ogre::Real mDensity
Cloud density.
Definition Ellipsoid.h:140
const float _getLength(const int &x, const int &y, const int &z) const
Get length.
Definition Ellipsoid.cpp:46
void setDimensions(const Ogre::Vector3 &Dimensions)
Set dimensions.
void updateProbabilities(DataManager::Cell ***c, const int &nx, const int &ny, const int &nz, const bool &delayedResponse=true)
Update probabilities.
Definition Ellipsoid.cpp:82
const Ogre::Vector3 getDimensions() const
Get dimensions.
Definition Ellipsoid.h:93
void move(const int &Ax, const int &Ay, const int &Az)
Move the ellipsoid.
const Ogre::Vector3 getProbabilities(const int &x, const int &y, const int &z) const
Get probabilities at a point.
Definition Ellipsoid.cpp:75