44 #include "quaternion.h"
45 #include "exception.h"
47 #include "stringtool.h"
55 #include "btBulletDynamicsCommon.h"
68 std::cout <<
"Hello world! From PrintHello()" << std::endl;
78 case 0:
return this->
X;
79 case 1:
return this->
Y;
80 case 2:
return this->
Z;
92 case 0:
return this->
X;
93 case 1:
return this->
Y;
94 case 2:
return this->
Z;
169 if (1.0==this->
X && 0.0==this->
Y && 0.0==this->
Z)
172 }
else if (0.0==this->
X) {
173 if (1.0==this->
Y && 0.0==this->
Z)
176 }
else if (0.0==this->
Y && 1.0==this->
Z) {
214 {
return Vector3(this->
X * scalar, this->
Y * scalar, this->
Z * scalar); }
217 {
return Vector3(this->
X / scalar, this->
Y / scalar, this->
Z / scalar); }
242 {
return( Vec.
X == this->X && Vec.
Y == this->Y && Vec.
Z == this->Z ); }
245 {
return( Vec.getX() == this->
X && Vec.getY() == this->
Y && Vec.getZ() == this->
Z ); }
248 {
return ( Vec.x == this->X && Vec.y == this->Y && Vec.z == this->Z ); }
252 {
return ( Vec.
X != this->X || Vec.
Y != this->Y || Vec.
Z != this->Z ); }
255 {
return ( Vec.getX() != this->
X || Vec.getY() != this->
Y || Vec.getZ() != this->
Z ); }
258 {
return ( Vec.x != this->X || Vec.y != this->Y || Vec.z != this->Z ); }
261 {
return ( this->X <= Vec.X && this->Y <= Vec.Y && this->
Z <= Vec.
Z); }
263 {
return ( this->
X >= Vec.
X && this->Y >= Vec.
Y && this->Z >= Vec.
Z); }
284 {
return Vector3(
X+Vec.getX(),
Y+Vec.getY(),
Z+Vec.getZ()); }
287 {
return Vector3(
X-Vec.getX(),
Y-Vec.getY(),
Z-Vec.getZ()); }
290 {
return Vector3(
X*Vec.getX(),
Y*Vec.getY(),
Z*Vec.getZ()); }
293 {
return Vector3(
X/Vec.getX(),
Y/Vec.getY(),
Z/Vec.getZ()); }
299 {
return Vector3(
X+Vec.x,
Y+Vec.y,
Z+Vec.z); }
302 {
return Vector3(
X-Vec.x,
Y-Vec.y,
Z-Vec.z); }
305 {
return Vector3(
X*Vec.x,
Y*Vec.y,
Z*Vec.z); }
308 {
return Vector3(
X/Vec.x,
Y/Vec.y,
Z/Vec.z); }
316 this->
Y * Vec.
Z - this->Z * Vec.
Y,
317 this->Z * Vec.
X - this->X * Vec.
Z,
318 this->X * Vec.
Y - this->Y * Vec.
X
324 return this->
X * Vec.
X + this->
Y * Vec.
Y + this->
Z * Vec.
Z;
332 (*this) /= TempLength;
344 return (*
this) / TempLength;
352 return (Destination - *
this).
Normalize();
373 return (*
this - OtherVec).Length();
378 return (*
this - OtherVec).SquaredLength();
388 return (
X *
X +
Y *
Y +
Z *
Z);
409 if( Dot < (1e-6 - 1.0) )
411 if( FallBackAxis !=
Vector3() )
423 Real InvSqr = 1 / Sqr;
427 Ret.
X = Cross.
X * InvSqr;
428 Ret.
Y = Cross.
Y * InvSqr;
429 Ret.
Z = Cross.
Z * InvSqr;
455 if( Other.
X > this->X ) this->
X = Other.
X;
456 if( Other.
Y > this->Y ) this->
Y = Other.
Y;
457 if( Other.
Z > this->Z ) this->
Z = Other.
Z;
463 if( Other.
X < this->X ) this->
X = Other.
X;
464 if( Other.
Y < this->Y ) this->
Y = Other.
Y;
465 if( Other.
Z < this->Z ) this->
Z = Other.
Z;
475 Theirs.setX(this->
X);
476 Theirs.setY(this->
Y);
477 Theirs.setZ(this->
Z);
491 Ogre::Vector3 Theirs;
514 if( VersionAttr && XAttr && YAttr && ZAttr )
545 {
return String(
"Vector3"); }
549 {
return lhs + Vec; }
553 {
return lhs * Vec; }
558 {
return lhs + Vec; }
562 {
return lhs * Vec; }
587 Ogre::Vector3& operator << (Ogre::Vector3& VecTo,
const btVector3& VecFrom)
589 VecTo.x=VecFrom.getX();
590 VecTo.y=VecFrom.getY();
591 VecTo.z=VecFrom.getZ();
595 btVector3& operator << (btVector3& VecTo,
const Ogre::Vector3& VecFrom)
597 VecTo.setX(VecFrom.x);
598 VecTo.setY(VecFrom.y);
599 VecTo.setZ(VecFrom.z);