parent
8c7a17ff8f
commit
7a48e058da
|
@ -353,6 +353,26 @@ namespace Oyster
|
|||
return *this;
|
||||
}
|
||||
|
||||
inline bool GravityWell::operator == ( const GravityWell &gravity ) const
|
||||
{
|
||||
if( this->position == gravity.position )
|
||||
if( this->mass == gravity.mass )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool GravityWell::operator != ( const GravityWell &gravity ) const
|
||||
{
|
||||
if( this->position == gravity.position )
|
||||
if( this->mass == gravity.mass )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
inline GravityDirected::GravityDirected( )
|
||||
{
|
||||
this->impulse = ::Oyster::Math::Float3::null;
|
||||
|
@ -370,6 +390,16 @@ namespace Oyster
|
|||
return *this;
|
||||
}
|
||||
|
||||
inline bool GravityDirected::operator == ( const GravityDirected &gravity ) const
|
||||
{
|
||||
return this->impulse == gravity.impulse;
|
||||
}
|
||||
|
||||
inline bool GravityDirected::operator != ( const GravityDirected &gravity ) const
|
||||
{
|
||||
return this->impulse != gravity.impulse;
|
||||
}
|
||||
|
||||
inline GravityDirectedField::GravityDirectedField( )
|
||||
{
|
||||
this->normalizedDirection = ::Oyster::Math::Float3::null;
|
||||
|
@ -393,6 +423,28 @@ namespace Oyster
|
|||
return *this;
|
||||
}
|
||||
|
||||
inline bool GravityDirectedField::operator == ( const GravityDirectedField &gravity ) const
|
||||
{
|
||||
if( this->normalizedDirection == gravity.normalizedDirection )
|
||||
if( this->mass == gravity.mass )
|
||||
if( this->magnitude == gravity.magnitude )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool GravityDirectedField::operator != ( const GravityDirectedField &gravity ) const
|
||||
{
|
||||
if( this->normalizedDirection == gravity.normalizedDirection )
|
||||
if( this->mass == gravity.mass )
|
||||
if( this->magnitude == gravity.magnitude )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
inline Gravity::Gravity()
|
||||
{
|
||||
this->gravityType = GravityType_Undefined;
|
||||
|
@ -437,6 +489,36 @@ namespace Oyster
|
|||
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline bool Gravity::operator == ( const Gravity &gravity ) const
|
||||
{
|
||||
if( this->gravityType == gravity.gravityType )
|
||||
{
|
||||
switch( this->gravityType )
|
||||
{
|
||||
case GravityType_Well: return this->well == gravity.well;
|
||||
case GravityType_Directed: return this->directed == gravity.directed;
|
||||
case GravityType_DirectedField: return this->directedField == gravity.directedField;
|
||||
default: return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool Gravity::operator != ( const Gravity &gravity ) const
|
||||
{
|
||||
if( this->gravityType == gravity.gravityType )
|
||||
{
|
||||
switch( this->gravityType )
|
||||
{
|
||||
case GravityType_Well: return this->well != gravity.well;
|
||||
case GravityType_Directed: return this->directed != gravity.directed;
|
||||
case GravityType_DirectedField: return this->directedField != gravity.directedField;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,7 +123,10 @@ namespace Oyster { namespace Physics
|
|||
|
||||
GravityWell( );
|
||||
GravityWell( const GravityWell &gravityWell );
|
||||
GravityWell& operator=( const GravityWell &gravityWell );
|
||||
GravityWell & operator = ( const GravityWell &gravityWell );
|
||||
|
||||
bool operator == ( const GravityWell &gravity ) const;
|
||||
bool operator != ( const GravityWell &gravity ) const;
|
||||
};
|
||||
|
||||
struct GravityDirected
|
||||
|
@ -133,6 +136,9 @@ namespace Oyster { namespace Physics
|
|||
GravityDirected( );
|
||||
GravityDirected( const GravityDirected &gravityDirected );
|
||||
GravityDirected & operator = ( const GravityDirected &gravityDirected );
|
||||
|
||||
bool operator == ( const GravityDirected &gravity ) const;
|
||||
bool operator != ( const GravityDirected &gravity ) const;
|
||||
};
|
||||
|
||||
struct GravityDirectedField
|
||||
|
@ -143,7 +149,10 @@ namespace Oyster { namespace Physics
|
|||
|
||||
GravityDirectedField( );
|
||||
GravityDirectedField( const GravityDirectedField &gravityDirectedField );
|
||||
GravityDirectedField & operator=( const GravityDirectedField &gravityDirectedField );
|
||||
GravityDirectedField & operator = ( const GravityDirectedField &gravityDirectedField );
|
||||
|
||||
bool operator == ( const GravityDirectedField &gravity ) const;
|
||||
bool operator != ( const GravityDirectedField &gravity ) const;
|
||||
};
|
||||
|
||||
struct Gravity
|
||||
|
@ -177,6 +186,9 @@ namespace Oyster { namespace Physics
|
|||
Gravity( );
|
||||
Gravity( const Gravity &gravity );
|
||||
Gravity & operator = ( const Gravity &gravity );
|
||||
|
||||
bool operator == ( const Gravity &gravity ) const;
|
||||
bool operator != ( const Gravity &gravity ) const;
|
||||
};
|
||||
}
|
||||
} }
|
||||
|
|
Loading…
Reference in New Issue