MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / UpdateSystemMotion

Method UpdateSystemMotion

GTE/Graphics/ParticleController.cpp:67–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67void ParticleController::UpdateSystemMotion(float ctrlTime)
68{
69 auto particles = static_cast<Particles*>(mObject);
70
71 float dSize = ctrlTime * systemSizeChange;
72 particles->SetSizeAdjust(particles->GetSizeAdjust() + dSize);
73 if (particles->GetSizeAdjust() < 0.0f)
74 {
75 particles->SetSizeAdjust(0.0f);
76 }
77
78 float distance = ctrlTime * systemLinearSpeed;
79 Vector3<float> currentTrn = particles->localTransform.GetTranslation();
80 Vector3<float> deltaTrn = distance * systemLinearAxis;
81 particles->localTransform.SetTranslation(currentTrn + deltaTrn);
82
83 float angle = ctrlTime * systemAngularSpeed;
84 Matrix3x3<float> currentRot;
85 particles->localTransform.GetRotation(currentRot);
86 Matrix3x3<float> deltaRot =
87 Rotation<3, float>(AxisAngle<3, float>(systemAngularAxis, angle));
88 particles->localTransform.SetRotation(deltaRot * currentRot);
89}
90
91void ParticleController::UpdatePointMotion(float ctrlTime)
92{

Callers

nothing calls this directly

Calls 6

SetSizeAdjustMethod · 0.80
GetSizeAdjustMethod · 0.80
SetTranslationMethod · 0.80
GetRotationMethod · 0.80
SetRotationMethod · 0.80
GetTranslationMethod · 0.45

Tested by

no test coverage detected