Exemple #1
0
        protected override void DoUpdate()
        {
            if (this.renderer == null)
            {
                this.renderer = this.BindingObject.Renderer as BuildInRenderer;
            }

            double deltaAngle = Time.DeltaTime.TotalMilliseconds * Math.PI * 2 / this.RevolutionPeriod;
            double newAngle = this.currentAngle + deltaAngle;
            var position = new vec3(
                (float)(this.RevolutionRadius * Math.Cos(newAngle)),
                0,
                (float)(this.RevolutionRadius * Math.Sin(newAngle)));
            this.currentAngle = newAngle;

            this.renderer.WorldPosition = position;
        }
Exemple #2
0
        protected override void DoUpdate(double elapsedTime)
        {
            if (this.renderer == null)
            {
                this.renderer = this.BindingObject.Renderer as BuildInRenderer;
            }

            double deltaAngle = elapsedTime * Math.PI * 2 / this.RevolutionPeriod;
            double newAngle   = this.currentAngle + deltaAngle;
            var    position   = new vec3(
                (float)(this.RevolutionRadius * Math.Cos(newAngle)),
                0,
                (float)(this.RevolutionRadius * Math.Sin(newAngle)));

            this.currentAngle = newAngle;

            this.renderer.ModelMatrix = glm.translate(mat4.identity(), position);
        }
Exemple #3
0
        protected override void DoUpdate()
        {
            if (this.renderer == null)
            {
                this.renderer = this.BindingObject.Renderer as BuildInRenderer;
            }

            double deltaAngle = Time.DeltaTime.TotalMilliseconds * Math.PI * 2 / this.RevolutionPeriod;
            double newAngle   = this.currentAngle + deltaAngle;
            var    position   = new vec3(
                (float)(this.RevolutionRadius * Math.Cos(newAngle)),
                0,
                (float)(this.RevolutionRadius * Math.Sin(newAngle)));

            this.currentAngle = newAngle;

            this.renderer.WorldPosition = position;
        }