a gravity class. Mass isn't taken in account (true with a uniform gravity model, near earth ) More...
#include <ps_force.h>
Inherits NL3D::CPSForceIntensityHelper.
Public Member Functions | |
| virtual void | computeForces (CPSLocated &target) |
| Compute the force on the targets. | |
| virtual void | show () |
| Show the force (edition mode). | |
| CPSGravity (float g=9.8f) | |
| virtual void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
| serialization | |
| NLMISC_DECLARE_CLASS (CPSGravity) | |
| virtual bool | isIntegrable (void) const |
| check whether this force is integrable over time. The default is false | |
| virtual void | integrate (float date, CPSLocated *src, uint32 startIndex, uint32 numObjects, NLMISC::CVector *destPos=NULL, NLMISC::CVector *destSpeed=NULL, bool accumulate=false, uint posStride=sizeof(NLMISC::CVector), uint speedStride=sizeof(NLMISC::CVector)) const |
| inherited from CPSForce | |
| virtual void | integrateSingle (float startDate, float deltaT, uint numStep, const CPSLocated *src, uint32 indexInLocated, NLMISC::CVector *destPos, bool accumulate=false, uint posStride=sizeof(NLMISC::CVector)) const |
| Compute a trajectory on several steps for a single object, rather than a step for several object. | |
Protected Member Functions | |
| virtual void | setIntensity (float value) |
| inherited from CPSForceIntensityHelper | |
| virtual void | setIntensityScheme (CPSAttribMaker< float > *scheme) |
| inherited from CPSForceIntensityHelper | |
a gravity class. Mass isn't taken in account (true with a uniform gravity model, near earth )
Definition at line 389 of file ps_force.h.
| NL3D::CPSGravity::CPSGravity | ( | float | g = 9.8f |
) | [inline] |
Definition at line 400 of file ps_force.h.
References NL3D::CPSLocatedBindable::_Name, NL3D::CParticleSystem::getSerializeIdentifierFlag(), and setIntensity().
| void NL3D::CPSGravity::computeForces | ( | CPSLocated & | target | ) | [virtual] |
Compute the force on the targets.
Implements NL3D::CPSForce.
Definition at line 385 of file ps_force.cpp.
References NL3D::CPSForceIntensity::_IntensityScheme, NL3D::CPSForceIntensity::_K, NL3D::CPSLocatedBindable::_Owner, NL3D::CPSAttrib< T >::begin(), NL3D::CParticleSystem::EllapsedTime, NL3D::CPSAttrib< T >::end(), NL3D::CPSAttribMaker< T >::get(), NL3D::CPSLocated::getConversionMatrix(), NL3D::CPSLocated::getSize(), NL3D::CPSLocated::getSpeed(), NL3D::CParticleSystem::InsideSimLoop, NLMISC::CMatrix::mulVector(), NL_PS_FUNC, and nlassert.
| void NL3D::CPSGravity::integrate | ( | float | date, | |
| CPSLocated * | src, | |||
| uint32 | startIndex, | |||
| uint32 | numObjects, | |||
| NLMISC::CVector * | destPos = NULL, |
|||
| NLMISC::CVector * | destSpeed = NULL, |
|||
| bool | accumulate = false, |
|||
| uint | posStride = sizeof(NLMISC::CVector), |
|||
| uint | speedStride = sizeof(NLMISC::CVector) | |||
| ) | const [virtual] |
inherited from CPSForce
Reimplemented from NL3D::CPSForce.
Definition at line 508 of file ps_force.cpp.
References NL3D::CPSForceIntensity::_K, NL3D::CPSLocated::_PInfo, NL3D::CPSAttrib< T >::begin(), NEXT_POS, NEXT_SPEED, NL_PS_FUNC, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.
| void NL3D::CPSGravity::integrateSingle | ( | float | startDate, | |
| float | deltaT, | |||
| uint | numStep, | |||
| const CPSLocated * | src, | |||
| uint32 | indexInLocated, | |||
| NLMISC::CVector * | destPos, | |||
| bool | accumulate = false, |
|||
| uint | posStride = sizeof(NLMISC::CVector) | |||
| ) | const [virtual] |
Compute a trajectory on several steps for a single object, rather than a step for several object.
If the start date is lower than the creation date, the initial position is used NB : works only with integrable forces
Reimplemented from NL3D::CPSForce.
Definition at line 608 of file ps_force.cpp.
References NL3D::CPSForceIntensity::_K, NL3D::CPSLocated::_PInfo, NL3D::CPSLocated::CParametricInfo::Date, NL3D::FillBufUsingSubdiv(), NL3D::CPSLocated::isParametricMotionEnabled(), NL_PS_FUNC, nlassert, NL3D::CPSLocated::CParametricInfo::Pos, NL3D::ScaleFloatGE(), NL3D::CPSLocated::CParametricInfo::Speed, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.
| bool NL3D::CPSGravity::isIntegrable | ( | void | ) | const [virtual] |
check whether this force is integrable over time. The default is false
Reimplemented from NL3D::CPSForce.
Definition at line 502 of file ps_force.cpp.
References NL3D::CPSForceIntensity::_IntensityScheme, and NL_PS_FUNC.
| NL3D::CPSGravity::NLMISC_DECLARE_CLASS | ( | CPSGravity | ) |
| void NL3D::CPSGravity::serial | ( | NLMISC::IStream & | f | ) | throw (NLMISC::EStream) [virtual] |
serialization
Reimplemented from NL3D::CPSForceIntensityHelper.
Definition at line 494 of file ps_force.cpp.
References NL_PS_FUNC, and NL3D::CPSForceIntensityHelper::serial().
| void NL3D::CPSGravity::setIntensity | ( | float | value | ) | [protected, virtual] |
inherited from CPSForceIntensityHelper
Reimplemented from NL3D::CPSForceIntensity.
Definition at line 672 of file ps_force.cpp.
References NL3D::CPSForceIntensity::_IntensityScheme, NL_PS_FUNC, and NL3D::CPSForce::renewIntegrable().
Referenced by CPSGravity().
| void NL3D::CPSGravity::setIntensityScheme | ( | CPSAttribMaker< float > * | scheme | ) | [protected, virtual] |
inherited from CPSForceIntensityHelper
Reimplemented from NL3D::CPSForceIntensity.
Definition at line 686 of file ps_force.cpp.
References NL3D::CPSForceIntensity::_IntensityScheme, NL3D::CPSForce::cancelIntegrable(), and NL_PS_FUNC.
| void NL3D::CPSGravity::show | ( | ) | [virtual] |
Show the force (edition mode).
Implements NL3D::CPSForce.
Definition at line 416 of file ps_force.cpp.
References NL3D::CPSLocatedBindable::_Owner, NL3D::IDriver::activeIndexBuffer(), NL3D::IDriver::activeVertexBuffer(), NL3D::CPSAttrib< T >::begin(), NL3D::CPSLocatedBindable::computeI(), NL3D::CPSAttrib< T >::end(), NL3D::CPSLocatedBindable::getDriver(), NL3D::CPSLocatedBindable::getFontGenerator(), NL3D::CPSLocatedBindable::getFontManager(), NL3D::CPSLocatedBindable::getLocalToWorldMatrix(), NL3D::CIndexBuffer::getNumIndexes(), NL3D::CPSLocated::getPos(), I, NLMISC::CMatrix::identity(), NL3D::CIndexBuffer::lock(), NL3D::CVertexBuffer::lock(), NL_DEFAULT_INDEX_BUFFER_FORMAT, NL_PS_FUNC, nlassert, NL3D::CMaterial::one, NL3D::CVertexBuffer::PositionFlag, NL3D::CPSUtil::print(), NL3D::IDriver::renderLines(), NL3D::CMaterial::setBlend(), NL3D::CMaterial::setBlendFunc(), NL3D::CMaterial::setColor(), NL3D::CIndexBuffer::setFormat(), NL3D::CMaterial::setLighting(), NL3D::CIndexBufferReadWrite::setLine(), NL3D::CIndexBuffer::setNumIndexes(), NL3D::CVertexBuffer::setNumVertices(), NL3D::IDriver::setupModelMatrix(), NL3D::CVertexBufferReadWrite::setVertexCoord(), NL3D::CVertexBuffer::setVertexFormat(), NL3D::CMaterial::setZWrite(), and NLMISC::CMatrix::translate().
1.6.1