allow direct particle position alteration in order for mouse spring work
This commit is contained in:
parent
caef3fede8
commit
0348d55d21
@ -168,7 +168,7 @@ public:
|
||||
|
||||
if (m_spring)
|
||||
{
|
||||
m_particle->ApplyTranslation(dx);
|
||||
m_particle->SetPosition(B);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -81,6 +81,11 @@ public:
|
||||
// Get the vertex index.
|
||||
u32 GetVertex() const;
|
||||
|
||||
// Set the particle position.
|
||||
// If the particle is dynamic changing the position directly might lead
|
||||
// to physically incorrect simulation behaviour.
|
||||
void SetPosition(const b3Vec3& position);
|
||||
|
||||
// Get the particle position.
|
||||
const b3Vec3& GetPosition() const;
|
||||
|
||||
@ -175,6 +180,12 @@ inline u32 b3Particle::GetVertex() const
|
||||
return m_vertex;
|
||||
}
|
||||
|
||||
inline void b3Particle::SetPosition(const b3Vec3& position)
|
||||
{
|
||||
m_position = position;
|
||||
m_translation.SetZero();
|
||||
}
|
||||
|
||||
inline const b3Vec3& b3Particle::GetPosition() const
|
||||
{
|
||||
return m_position;
|
||||
|
Loading…
x
Reference in New Issue
Block a user