Exemplo n.º 1
0
        public override void OnAttachedToTackObject()
        {
            base.OnAttachedToTackObject();

            m_previousPosition = new Vector2f(GetParent().Position);
            TackPhysics.GetInstance().RegisterPhysicsComponent(this);
        }
Exemplo n.º 2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            Timer = new Stopwatch();
            Timer.Start();

            Internal_UpdateCycleCounter = 0;
            Internal_RenderCycleCounter = 0;

            Sprite.LoadDefaultSprite();

            //mTackConsole.OnStart();

            mAudioManager = new AudioManager();
            mAudioManager.OnStart();

            mTackObjectManager = new TackObjectManager();
            mTackObjectManager.OnStart();

            mTackRender = new TackRenderer();
            mTackRender.OnStart();

            mTackPhysics = new TackPhysics();
            mTackPhysics.Start();

            TackInput.OnStart();

            onStartFunction();

            mTackObjectManager.RunTackObjectStartMethods();
        }
        public static void EnableDebugDrawCommand(string[] args)
        {
            if (args.Length == 1)
            {
                TackConsole.EngineLog(EngineLogType.Message, "Value: " + TackPhysics.GetInstance().ShouldDebugDrawBodies);
                return;
            }

            if (args.Length == 2)
            {
                if (bool.TryParse(args[1], out bool res))
                {
                    TackPhysics.GetInstance().ShouldDebugDrawBodies = res;
                    TackConsole.EngineLog(EngineLogType.Message, "Set {0} to Value: {1}", args[0], res);
                }
                else
                {
                    TackConsole.EngineLog(EngineLogType.Error, "Failed to convert '{0}' to a boolean value", args[1]);
                }

                return;
            }

            TackConsole.EngineLog(EngineLogType.Error, "Incorrect number of arguments for command: " + args[0]);
        }
Exemplo n.º 4
0
        public void OnRender()
        {
            // Render everything in world
            RenderQuadRendererComponents();

            // Render TackPhysics debug objects
            TackPhysics.GetInstance().Render();

            // Render GUI
            m_guiInstance.OnGUIRender();
        }
Exemplo n.º 5
0
 internal virtual void AddGravityForce()
 {
     m_currentGravityForce += TackPhysics.GetInstance().Gravity *m_gravityModifier *(float)Engine.EngineTimer.LastCycleTime;
 }
Exemplo n.º 6
0
        public override void OnDetachedFromTackObject()
        {
            base.OnDetachedFromTackObject();

            TackPhysics.GetInstance().DeregisterPhysicsComponent(this);
        }