------------------------------------------------------------- Description: Applies spring force to a particle. Arguments: position - Particle position velocity - Particle velocity (not used) dt - Frame time (not used) mass - Particle mass (not used) Return value: Spring force to apply to a particle -------------------------------------------------------------
| 34 | // Spring force to apply to a particle |
| 35 | // ------------------------------------------------------------- |
| 36 | XMVECTOR Tr2ParticleSpring::GetForce( FXMVECTOR position, FXMVECTOR velocity, float dt, float mass ) |
| 37 | { |
| 38 | XMVECTOR direction = XMVectorSubtract( position, m_position ); |
| 39 | return XMVectorScale( direction, -m_springConstant ); |
| 40 | } |
| 41 | |
| 42 | void Tr2ParticleSpring::RenderDebugInfo( ITr2DebugRenderer2& renderer, const Matrix& worldTransform, const CcpMath::AxisAlignedBox& aabb ) const |
| 43 | { |