public virtual void Tick(float deltaTime) { physicsTransform.Mass = projectileData.bulletMass; //affectors.ForEach(n => n.Tick_PrePhysics(deltaTime)); foreach (AffectorBase affector in affectors) { affector.Tick_PrePhysics(deltaTime); } physicsTransform.Tick(deltaTime); //If we hit something, process it TerminalBallisticsData terminalData = terminalDetector.Tick(this); //, true); //Have we hit anything? if (terminalData != null) { terminalCalculators.ForEach(n => n.ProcessTerminalHit(terminalData)); //We have hit something! } if (IsDead()) //Do this speed check before an effector speeds us up again { Active = false; //Only set this when we actually die } //affectors.ForEach(n => n.Tick_PostPhysics(deltaTime)); foreach (AffectorBase affector in affectors) { affector.Tick_PostPhysics(deltaTime); } //Debug information //Debug.DrawLine(physicsTransform.PrevPosition, physicsTransform.Position, Color.blue, 120); //DrawingFuncs.DrawStar(physicsTransform.Position, Color.green, 0.5f, 120); physicsTransform.RenderDebug(deltaTime, deltaTime, 20.0f); }
void Update() { physicsTransform.Tick((decimal)Time.deltaTime); transform.position = physicsTransform.Position; }