示例#1
0
        public override void _Process(float delta)
        {
            const int limit = 4;

            camPoint.RotateY(delta * 0.5f);
            position += velocity * delta * 10.0f;

            if (position.x > limit || position.x < -limit)
            {
                velocity.x *= -1;
            }

            if (position.y > limit || position.y < -limit)
            {
                velocity.y *= -1;
            }

            if (position.z > limit || position.z < -limit)
            {
                velocity.z *= -1;
            }

            sphere.Transform = new Transform(sphere.Transform.basis, position);
        }