MCPcopy Create free account
hub / github.com/carbonengine/trinity / GetForce

Method GetForce

trinity/Particle/Tr2ParticleSpring.cpp:36–40  ·  view source on GitHub ↗

------------------------------------------------------------- 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 -------------------------------------------------------------

Source from the content-addressed store, hash-verified

34// Spring force to apply to a particle
35// -------------------------------------------------------------
36XMVECTOR 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
42void Tr2ParticleSpring::RenderDebugInfo( ITr2DebugRenderer2& renderer, const Matrix& worldTransform, const CcpMath::AxisAlignedBox& aabb ) const
43{

Callers 1

UpdateSimulationMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected